If this blog helped you in any way, please donate a dollar here

Thursday, April 21, 2011

[OFF] How I screwed up my Microsoft Interview

It's almost a month since my interview call at Microsoft India Development Centre @Bangalore. The fateful day was 30th March, 2011 and I got an E-Mail from a recruiter around a week before that day. My friends, Ishan and Sudipto also received the interview call offer. It was a stunning moment for me, after which there was fall from grace.

It all started with a phone call from Ishan, my programming friend at IEM. He wanted me to be a part of their team for Overnite, the ACM-ICPC Programming Contest at IIT, Kharagpur this year. I agreed. We participated for the qualification rounds and qualified as toppers. Sudipto and me solving a problem each. To be frank, this qualifiers was among the worst I have ever seen from this institution.



Come 12th of March, I reached Kharagpur. It was around 9.30 PM. Ishan and Sudipto had reached earlier. I got to the hostel room allocated for us. Generally this contest starts from 12 midnight. So we thought. We reached the finals venue at 11.50 only to learn the start time was 11 PM. None of the organizers bothered to tell us or for that matter pick up our calls.

The night had just started and we were coding away furiously. Sudipto got one accepted. I got one partially accepted. We had started warming up. After a while we figured Brute Force was the order of the day. So... we bruted away happily. We were leading happily, until around 10 minutes or so another team got one more partially accepted. Ten minutes seemed like Ten Seconds as we came Runners-Up.

The team that beat us consisted of a certain Dheeraj Kumar Singh of IIT Kharagpur. 'The' guy who got a 70 Lakh offer from Facebook. The top 6 had 5 IIT Kgp teams. It was a massacre. Our golden sword of valor had got us through.

So now, we headed home, having conquered IIT Kharagpur, we were naturally pretty happy. Okay, cutting the crap... We were elated!

Now, what this had started was far beyond our imagination. A few days later Harith C. gave us a call that Microsoft wants to interview us and our return trip would be sponsored.

Stunning news!

We rushed to Hyderabad. We stayed at a Guest House at Madhapur, a rather cheap place considering the fact that Gacchibowli (where Microsoft Office was) is very expensive.

The days before the interview were very tough! We had no clue how to prepare. We searched google, looked up blogs, read some mathematical puzzles, opened up Cormen, wrote code by hand, did whatever we thought would do. I taught Sudipto the Trie, he taught me the Segment Tree.

So, it was the fateful day. There were 11 candidates. Eight from IITM Gwalior and we three. My name was last on the list. Everyone had started up their interviews. In the meanwhile, I kept feeling they are not going to interview me, I was not from IEM na. The IIT guys sent my college name as IEM. I kept frying myself when I was called inside.

The interviewer was young, around 25-26 perhaps. He asked me about the projects I did (which he found from my CV). I talked about ReProg - Uninstaller and I answered questions relating to that. Then he asked me about ProcHack - my process manager. He asked me about scheduling algorithm used in Windows. It was about this point I went blank... Igno Molnar came to my head. He changed the question to "What is a scheduler". I explained it gets things working. The only algorithm coming to my mind was Round Robin. I could not recall the name. I explained how it works but forgot it's name! He told me to code it. I asked him if I could use a priority queue. I have no idea why I did that, I know I should have started with a Interrupt Service Routine. He said I'd have to implement it. Again, I have no idea why I freaked out, and I started implementing a max-heap. Just a max-heap. The priority part was fine, but there was no queue functionality. He then asked me to write neatly.

The next question related to a very simple problem of string manipulation. It took me ages to figure what it meant. It's not as if he was speaking Hebrew, it's just my sense of understanding the simplest of Indian-English accents had gone seriously wrong. The question he posed was to reverse all the words of a string. For a moment I turned into a chimp... not knowing what to do. I coded string reverse! At this point the interviewer might have as well shown me the door.

Two more explanations later, I coded it. I knew it was ugly, but it worked (or so I hoped). Then, he asked me to not use extra space. I did that too. He then asked me to generate test cases. While doing that I knew where my code would fail for some boundary cases. I was kinda hoping he won't ask that. And so he did. I told him it would fail and I would need to change the code, make some surgeries here and there. And here. And there.

He asked me if I had any questions for him. I said 'not really' and escorted myself out. As if to add salt to the wound... I could not open the door! Now, they were convinced my IQ was -85.

I got out of the room and the first thought I had was that the string would not reverse. You see the logic behind reversing a string is to swap the first and last characters, followed by the 2nd and 2nd last, and so on. This was to repeat till the middle of the string. I repeated till the end. I knew the obvious.

A few minutes on results were announced. Sudipto was selected apart from 3 others from IITM, Gwalior. We had lunch.

I felt almost relieved. We went up to the Canteen and had lunch. Then we came back to the hotel room. Finals were the next day.

In the end, Sudipto was selected for Microsoft IDC as Software Developer Engineer. The other 3 also made it. My congratulations to them and of course Sudipto.

No comments:

Post a Comment