Sunday, December 30, 2007

The Price of Donuts

The most recent time I had a donut was at CS Tea Time: A weekly gettogether of fellow CS nerds at the department of Computer Sciences at UT Austin. Surprisingly this is one of the few times when the samosa is valued more than a donut. Although unverified, a samosa may be bartered for as much as 2 or 3 chocolate and cheese filled donuts. Not that I am any different, I am one of the first to grab a samosa, then one for Priyanka.... but then while I wait for a second round of samosas, I do justice to the donuts, pick a glazed one up, and relish it reminiscing the days when that very bite was the best thing in the world....

My first memories of eating a donut was the "Monginis Doughnut" that amma would get. Amma would get it for chai naashta almost every Saturday, on her way back from work.. along with some veg puff pattice/chicken puff pattice.... I would wait with great anticipation....and after finishing off my share of chicken pattices, would relish the doughnut... telling amma how much I love them...

She would often tell stories of her first job, when the doughnut was her favorite snack... a means of celebrating the little joys of life... a commendation by her superiors... a small raise... a totaling error found.... Amma would spend about a rupee a day on traveling and food... The train and bus tickets would cost maybe 50 paise and she would spend the remaining 50 paise on donuts sometimes... it was a great luxury in those days for her... and she would enjoy every bite of that subtly sweetened cream in between the softest of O shaped bread, pretty much my reaction as a kid.

I remember buying donuts as a 10 year old kid... for about Rs. 5 and then later as a college kid for about Rs 8, which was about 16% of my Rs 50 daily allowance. As I've grown up, I have picked up a lot of my parents' traits... cherishing food and using it as a form of celebration...

The donuts we get here in Austin cost between 50 cents and a dollar (about 25-40 INR)... the prices have come a long way for me... but donuts are and always will remain special... One high calorie bite... and I'm that kid again...waiting for my hardworking mom to return from work, on a warm Saturday afternoon. Now can there be any high-enough price for that?

Wednesday, June 27, 2007

Inactivity

Not much to do
Rather haven't done much
Over the last few days

Happens with me
Around the time I take a holiday
The days before and after
Are just filled with inactivity

So I think, is this idling
Due to peace of mind, or contentment
Maybe I have done enough work already
Maybe I'm going too fast and need to rest a bit
Before I go any further
Inhale the temporary serenity
Breathe in and revisit
What I need to do
What I must do
What I want
Strange
But shouldn't all those be the same?

Maybe inactivity and procrastination
Is not so bad
Maybe its the design phase
Before we actually code
Maybe its where the plot
Is put in place

Most of all
It makes me think
From a different perspective
And remind myself
Of my insignificant role
In the scheme of things
That is this universe

And that takes a whole load off
Of me
And makes me happy
In spite of everything

Now isn't that a good thing to have
Maybe that's what they teach you in meditation school
To let go
Or rather to remind you
That you can

Till Kingdom Come

This song is just amazing. Its strange, how many times a song can say exactly what one feels.

Till Kingdom Come

Still my heart and hold my tongue
I feel my time
My time has come
Let me in
Unlock the door
I never felt this way before

And the wheels just keep on turning
The drummer begins to drum
I don’t know which way I’m going
I don’t know which way I’ve come

Hold my head inside your hands
I need someone who understands
I need someone, someone who hears
For you I’ve waited all these years
For you I’d wait till kingdom come
Until my day, my day is done
And say you'll come and set me free
Just say you'll wait, you'll wait for me

In your tears and in your blood
In your fire and in your flood
I hear you laugh, I heard you sing
I wouldn’t change a single thing
And the wheels just keep on turning
The drummers begin to drum
I don’t know which way I’m going
I don’t know what I’ve become

For you I’d wait till kingdom come
Until my days, my days are done
And say you'll come and set me free
Just say you'll wait, you'll wait for me
Just say you'll wait, you'll wait for me
Just say you'll wait, you'll wait for me


Coldplay

Tuesday, June 26, 2007

Why I write the way I write

I like writing as if
I were writing a poem
It helps, cos' unlike prose
There is no commitment to complete the sentence
To plan out new arguments
Or carry on a single one
The same reason why I have never
Consisted with blogging
So I plan to write in bursts and lines
Cos this is how I think
This is what I am
Impulsive and at times hopefully poetic
This is how I see life
In fits and bursts

Sunday, April 8, 2007

Microsoft Interview Questions

Finally, they are here.....

A tad bit late, but here nevertheless....
I was worried initially abt revealing the questions....cos I was all set to go there... but now that I have changed my mind.....it doesn't matter....

I reached Seattle on February 1, 2007 at arnd 8 pm. I reached Courtyard by Marriott at around 8:35. Settled in, had a light "junky" dinner, and practised some code till abt 12 am, I guess.

My interview was scheduled to start at 11:30....a bit lucky cos that meant an easy start to the morning and the lunch interview to begin proceedings... I had a heavy breakfast, stocked up on some cereal bars, and practised some more code and left for One Microsoft Way at 10:30. The cab ride was just 10 minutes....and I reached the main reception at Building 19 a whole 45 minutes ahead of time. The receptionist gave me a lowdown of the administrative and infrastructural stuff and then I waited for my recruiter to come and meet me in the lobby. My friend kept me company on phone...and helped me a lot with some useful last minute prep....

11:15 first interview... type : HR, with the recruiter.

Just verified some stuff off the resume, asked if I had any offers....then asked why Microsoft....gave me a goody bag. Explained the day's schedule, asked me abt all the hype surrounding the interviews...and then directed me to the recruit shuttle. On the way we talked a lot abt life, my hobbies, sports I play and stuff....I decided to be extremely friendly with everyone I meet that day....

Aside: The interviews are well planned....but it's a relay setup. I just knew my first interviewer and his location, he would tell me abt the next guy and so on....

11:30 Recruit shuttle to Building 50 something....

11:40 Interview 1 At building 50 something...wait till Mr Mn Fg meets me in the lobby. All the waiting actually hepled me calm my nerves, but cd work the opposite way too. Very genial and welcoming Asian 45+ man. Test lead/manager for the Windows admin team. Amazing guy to have as ur first interviewer.... plus a Lunch interview...the atmosphere was very laid back and friendly. It was almost like a homecoming, interacting with him. The interview was a hybrid tech HR one with loads of pauses for eating. I could choose anything I wanted, but I went for a simple Indian rice+subji combo. If I had to redo this, I would have eaten only fruits. Now I'm a slow eater...especially wen I'm talking...so my meal was not ending at all....Mn Fg was extremely patient and we interacted like team mates
Questions: Strengths with examples/illustrations. Weaknesses with examples/illustrations. Team work experience. Life at Microsoft....suddenly out of the blue difference between int ** ptr and int * ptr. Then teh difference between NULL and empty string. Then back to some stories....and I was extremely attentive...also helping him complete some sentences... geeky techie discussions.

We then went up to his cube/office where he realised that there was very little time for a full fledged techie interview and asked me one simple question: Write a complete C program to find string length. Wow.... a sitter for q1... it really felt like my day from then on in....

I kinda cracked that q.....the key understanding was being able to differentiate between null and empty strings....which he really liked. He then asked me to write test cases for the same. I did that...and then he said, well if u had to use just 3 test cases which ones wud u use....and if u had just 1 which one wud u use? I guess I answered that satisfactorily too...and that was the end of interview 1...I'd rate it as a 85-90/100. On my way out he showed me a trophy with all the releases he had been a part of engraved on it (14 in all) and handed me a Vista frisbee....


1:30 Interview 2 Same building, 6/7 offices away from Mn Fg, Mr Ml.... he is another guy in Mn Fg's team, same age as me....another extremely friendly guy, started off with questions on my projects.... then the tech interview started

Q1 Write a program to find the number of 1's in the binary representation of an integer. Is there a faster method if we use characters instead of integers.

Q2 Implement a lease and release mechanism. When the caller calls lease it returns the smallest avaialable integer from a range. On release the number become available or leasing again. So for eg if 3 clients call lease thrice it would give 0, 1 and 2. Then if the client recieving the 1 releases it and some one calls lease again it shd return 1 and not 3.

I took some time on Q2...but I finally nailed it. He also asked me test cases for both questions as well as a way to automate the testing....


I would rate myself a 75-80/100 on that one.

3:00 Interview with Mr Ai Ni

Started slightly late....another impressive personality... Test lead of the Windows Update backend pipe team. We went right into the interview:

Q1 Why Microsoft? Does the test team play a major role....how can they have a stake in the ownership of the product. Give an example where u fixed a bug...that stumped several ppl....and how u debugged it...(working in the industry gives u an edge ...with such questions....) this part went well

Q2 I have a process which gets a lot (several thousands) of numbers in the night...I need to store it in some data structure, I have the whole night to do it...(so enough time for insertion) but I need to retrieve it the next day in very little time, how do I go abt doing this? Answer Obviously hash table...discussed hashing and rehashing..... we were heading toward a dead end...so he decided to give me some more time for retrieval...so I said binary tree....then he said what's the worst case... I said linear for a lopsided tree, so then wat? Balance the tree....so he gave me some test cases and made me write a balancing algorithm, which I think I wrote well....and he was quite happy with it....then he asked me if I had any questions...and I asked him if they use low level tree implementations in code at all....and he said well yes and no....and it was more a test of my thinking abilities rather than knowledge.....

I'd rate myself a 70-75/100, due to the hash table impasse


Interview 4 4:30 Mr Ty Ln, Ai Ni's manager.....probly one of the nicest ppl I've met....

I was tiring by this time...and it was 4:30 on a Friday...I remarked to Ty as we walked to his office...that I was sorry to keeping him from leaving early on a Friday evening....and he just laughed it off....we entered his office and almost immediately he drew an AND OR and X-OR gates on the white board and asked for their truth table.....now I'm a EE undergrad and I teach Logic to undergrads.....even if I were asleep....I shd be able to answer that....so I did...then he drew an opamp and fumbled with the inverting and non inverting configs....I corrected it for him... i remembered stuff that I'd done almost 4 years back....and the he asked me...wat wud happen if there were no feed back...and I said it wud be just liek a gate...and that was the answer he was looking for....he smiled bk almost mischievously....'are u surprised'...and I say of course I am....and he says well he has a EE back ground too....so we start off the interview on a good note....

Q1 Test the travelling salesman problem...Given a set of input coordinates, return the optimal path covering all points and back. i worked up some good test cases....actually all except one which I briefly alluded too...I knew I had forgotten something....and he sensed it and asked me if it wud be a problem if we just went ahead without it...and I said well yes and no....so he told me that one shd consider positive and -ve infinity as 2 points....

Q2 Write an optimal program given an array a of integers and length l to remove the duplicates and return the new length... I nailed that...and he did not ask me to speed it up...

it was almost 6:30 now...and he said 'well that's the last question I will ask u today'.... and he called me the shuttle to go back to Bldg 19...and then I went back to my hotel....after almost 7 hours of interviews....

I wud rate that interview a 85-90/100

So my overall rating would be arnd 82....which I wud say was pretty good for a non CS undergrad...with little preparation....I was pretty confident...and when I reached Austin...I was mailed by Mn Fg (instead of the recruiter) on Tuesday asking if I had heard from the recruiter abt his team's offer. Later that dy I was mailed by Ty Ln, that he was coming to Austin, and wanted to know if I cd meet him over dinner....

Well that meant an almost yes...and I did get an offer on Friday, a week after the interviews from my recruiter....


Everyone....each and everyone of my interviewers impressed me....and I feel sad at having missed the chance of working with such brilliant individuals.... but then Google is Google....my dream company....and I know I will be happier there....


Well more abt that interview some time later...for now its good night and shabba khair...and please take good care of urself....

Saturday, April 7, 2007

Wellness

I had written this quite sometime back (4/7/2007), and I believe the power of posterity always allows you to show emotions you din't mean to express at the time they originated...so here goes...

Pull and Push
To and Fro
We go

At times loud
At times silent
On and off

Strangely still
We manage to steal
Our share of happiness

A laugh here, a pout there
A warm word expressing care
Time well spent

Wellness
Is a thing of body and soul
They say

For me though
Its with you
At this moment here

Achievements, rewards, credit and gain
Make me happy, but then again...
Matter little for I know its true

I'm truly well with you...

Tuesday, April 3, 2007

Surreal

This feeling that I get
When things seem as if in a dream
When yearnings come true
As if they were always meant to be
Complications simplify
Leaving me to wonder why
They were ever a worry
I'm scared...though
All ups have downs
Lurking nearby
Hope I don't get carried away
By this dreamy phase
And have my feet on the ground
With joys abound
Surreal
It's what I feel


Google today confirmed the receipt of my acceptance of their offer. Complicated line rite. They also asked for my preferred user name, computer name and tee size.
Surreal
Is what I feel....

Wednesday, March 14, 2007

This moment

We shall never be here again....
this moment will never be here again
Life shall never be the same again...

What if I had nowhere to go, no care in the world...about how I'd look with my clothes all wet, about what people would think about me....if all I wanted was to be in the current moment and live it to the fullest, to gambol in the rain, what would I do? And why I am I waiting? After all i'm just a speck on an uninteresting orb, in a far corner of an insignificant galaxy....

Gotta keep walking

Sunday, March 4, 2007

What if this is as good as it gets

I might be the only person on the face of the earth that knows you're the greatest woman on earth. I might be the only one who appreciates how amazing you are in every single thing that you do,.......and in every single thought that you have, and how you say what you mean, and how you almost always mean something that's all about being straight and good. I think most people miss that about you, and I watch them, wondering how they can watch you......and never get that they just met the greatest woman alive. And the fact that I get it makes me feel good, about me.

Is that something that's bad for you to be around, for you?

Melvin Udall
As Good as it Gets

Thursday, March 1, 2007

Isn't it strange...

Isn't it strange
How we move our lives for another day
Like skipping a beat
What if a great wave should wash us all away
Just thinking out loud
Don't mean to dwell on this dying thing
But looking at blood
It's alive right now
Deep and sweet within
Pouring through our veins
Intoxicate moving wine to tears
Drinking it deep
Then an evening spent dancing
It's you and me
This love will open our world
From the dark side we can see a glow of something bright
There's much more than we see here
Don't burn the day away
Is this not enough
This blessed sip of life
Is it not enough
Staring down at the ground
Oh then complain and pray more from above
Greedy little pig
Stop just watch your world trickle away
Oh it's your problem now
It'll all be dead and gone in a few short years
Just love will open our eyes
Just love will put the hope in our minds
Much more than we could ever know
Don't burn the day away
Come sister my brother
Shake up your bones shake up your feet
I'm saying open up
And let the rain come pouring in
Wash out this tired notion
That the best is yet to come
But while you're dancing on the ground
Don't think of when you're gone
Love love what more is there
We need the light of love in here
Don't beat your head
Dry your eyes
Let the love in there
There are bad times
But that's ok
Just look for love in it
Don't burn the day away
Look
Here are we
On this starry night staring into space
And I must say
I feel as small as dust
Lying down here
What point could there be troubling
Head down wondering what will become of me
Why concern we cannot see
But no reason to abandon it
Time is short but that's all right
Maybe I'll go in the middle of the night
Take your hands from your eyes, my love
All good things must end some time
Don't burn the day away
Come sister my brother
Shake up your bones shake up your feet
I'm saying open up
And let the rain come flooding in
Wash out this tired notion
That the best is yet to come
But while you're dancing on the ground
Don't think of when you're gone
Love love what more is there
We need the light of love in here
Don't beat your head
Dry your eyes
Let the love in there
There are bad times
But that's ok
Just look for love in it

Pig
Dave Matthews Band

Sunday, January 7, 2007

Believing in Java -1

My most long awaited post series is finally here....
actually i don't know if many people were waiting for this :P
at least I was :)

So how do I start?

or rather how do you start?

If you are here then you must be:
1)a software junkie/nerd wanting to start with Java, but did not know where to start.
2)someone who knows the syntax, but never actually tried writing any code
3)a C++ programmer who finally realised that it sucked (actually just joking)
4)A forgetful 25 year old graduate student who must do this, so that he can immortalise his knowledge (provided blogger.com will survive the next ice age)


i am not explicitly going to teach OOP here....so if u are here for OOP purely...you must google something else....altho if you are patient....and iff i do not forget...there will be some examples

Let's start at the very beginning, a very good place to start....


Java is write once run anywhere...which means that the only requirement to run a java app on ur computer is to have a Java Virtual Machine installed on it. That's it. It doesn't matter what kinda hardware/OS u have, just make sure u have a JVM and u r good to go. I guess this is of the most powerful features of Java, a feature that makes it portable...the other stuff that i really like is:
1)Me no understand pointer speak.....(actually this is not very true)...but java does not require you to explicitly manage memory, which means on the upside, extremely programmer friendly...but on the downside could cause memory leaks...and is also considered by it's critics to be slow. Garbage collector settings are tweakable at the system level.
2)Extensible and hence infinitely powerful.
3)Relatively simple to program in.


To get a lowdown on other stuff....you must check out the wiki on Java (Programming Language)

However just having the JVM, which is part of the Java Runtime Environment (JRE) does not allow you to develop applications in Java. You also need a Developer's Kit..... a JDK. Both the runtime and the JDK are freely downloadable here

You may also download an IDE. IDEs make life really simple for a programmer, because of the on-the-fly compile feature among others. But its always better to start learning the harder way, using command line...that's how I started. 2 IDEs I believe in are Netbeans and Eclipse. Remember an IDE is just a development environment. It may not necessarily have the runtimes and other tools that come with a JDK.

Your first Java Program

Yes this is it, the Hello World you've all been waiting for


public class Hello
{
    public static void main(String args[])
    {
        System.out.println("Helo World");
    }
}

Wow so much code, but what do we do with it.

Step 1:

Using a text editor, (Word pad or notepad or editplus are pretty good editors if you do not have an IDE/don't know how to use one), create a file Hello.java. The default extension in Notepad is .txt. So don't create a file Hello.java.txt....instead change it to all files (*.*) and save as Hello.java. Copy paste the above code into the file and save. The source contains one class named Hello. Even if you might be deviating from my instructions, please ensure that the source code file name must be the same as the class.

Step 2:

U have the source file now. All that remains is to compile it. To compile a source all we need to do is to pass the file name with location to the javac tool. This and several other useful tools that are bundled with the JDK are available in the /bin folder. So a good idea would be to add this location to the PATH environmental variable.

also add this to the CLASSPATH variable

/lib/tools.jar.

In case you do not have a classpath variable create one and add this.

To add an entry is equivalent to appending to the existing text a semi colon and the new entry.

To compile type

javac /Hello.java

if you followed everything correctly uptil now, the command terminates succesfully and the prompt is on a new line.

There could be 3 kinds of errors.
1)A compilation error if you did not copy paste the code correctly or mistyped some syntax. Or you did not add the tools.jar entry. In case you cannot modify the classpath variable add a -classpath flag and provide the tools.jar entry after it.
2)A file not found error if the source code file does not exist, or the location specified is incorrect.
3)A command not found error, in case you did not add the bin location in PATH. In case you can't change the environmental variable don't worry. Specify the complete path for the javac command.

The class should be created at the location you are currently running the command.

Step 3:
To run the class type
java Hello.

If you get a similar error as 1 or 3 in Step 2, do similar work arounds.

You should have been able to see a Hello World.

Congratulations....you've just written your first Java application. Now rest for a while and wait for my next post.

Back from Arizona

Well, almost 4 days since I'm back, actually....so this post is a tad late.....
anyways...better late than never

As for the trip, I was quite apprehensive initially, but I guess it was really uncalled for...... made some really nice friends...... and met a most wonderful person..... We had great fun, watched so many movies, biked around, lazed around, let our hair down.........

A most amazing and refreshing break I would say. One that I never wanted to end....

Coming back is always tough... coming back to work...starting up again....leaving back memories of time well spent....

But then one must always come back..... and stay happy.....For life is just a collection of memories, both happy and sad....and its always better to focus on the happy to overcome the sad....

Actually the new year brings in a new start for me.... to overcome my inconsistencies, my shortcomings, to exceed and excel, to assert myself and achieve my true potential...to fulfill my dreams....and its been good I guess till now....

Should old acquaintance be forgot,
and never brought to mind ?
Should old acquaintance be forgot,
and auld lang syne ?
CHORUS:
For auld lang syne, my dear,
for auld lang syne,
we'll take a cup o’ kindness yet,
for auld lang syne.

And surely you’ll buy your pint cup !
And surely I’ll buy mine !
And we'll take a cup o’ kindness yet,
for auld lang syne.
CHORUS
We two have run about the hills,
and pulled the daisies fine ;
But we’ve wandered many a weary foot,
since auld lang syne.
CHORUS
We two have paddled in the stream,
from morning sun till dine (dinner time) ;
But seas between us broad have roared
since auld lang syne.
CHORUS
And there’s a hand my trusty friend !
And give us a hand o’ thine !
And we’ll take a right good-will draught,
for auld lang syne.
CHORUS



Happy New Year
and God Bless [:)]

meebo