Monday, April 23, 2012

Face To Face (Also, A Microsoft interview)


related posts:
the technical interview


Yay... so I passed the phone Interview, and now I'm supposed to go to the face to face interview.
At the time of these interviews (about a year ago) there were some instabilities in Egypt, which resulted in delays in my interviews, not only that, they actually got us the opportunity to have these interviews out of Egypt. So we went to Istanbul,Turkey.

We (me and my colleagues ) were flown (yay) to Istanbul, and we spent a night at a 5 star hotel (which was cool by the way), and I recorded this video when I first set foot in my hotel room.. note: if you don't know Arabic, then the video won't be of much value to you sorry

:D

Just a few note before we begin:

Although I woke up very early that morning, but I barely made it on time. Due to miscommunication between me and the taxi driver, I got around 2 miles away from where I should be :(, and for some reason , the driver refused to continue, so I left the taxi and tried to find my way.

I spent some time learning Turkish, along with some body language before the interviews, but the Turkish didn't help that well.

It was somewhat impossible where I was to find a taxi, as I was on the opposite side of where I was going, and there was no way I was gonna cross that street.

I asked some people for direction, and finally got to a sweets shop, where a young female customer who could speak some English helped translate my question to a worker at that shop.... it was a very nice situation :|

Another note I found very useful on some blog, is that the interviewing process is very exhaustive, so  I recommend  getting some energy bars, or chocolate with you to eat between interviews (it was a life savior ), also a bottle of water can be helpful, but they gave each one of us a bottle ..

Getting back to the interview:

The first interview was nice, my interviewer spent a few minutes intoducing himself, get to know me and answer any questions I asked.

He asked If I was asked the triangles question in the phone interview ,and I answered Yes.

The rest of the interview was only one question.

He asked me to implement the insert method of a sorted doubly linked list, which is somewhat not that hard, but has its tricks.

At that point, it was about 3 years since I implemented  or even used a linked list, but I looked at it while studying for the interview.

I wondered why not a normal linked list, why a doubly linked list... he didn't seem to notice, but I realized after trying to implement it that it is even easier with doubly linked lists ().

 It was just a demonstration of knowledge... he didn't insist on a particular programming language, so I choose Java.
Aside from the implementation that you can find on wikipedia the real trick was testing this method

He asked me to test it, so I started with this:
-if the list is a parameter to the function (ie void add(DLinkedList l , int x) ) we can check it it is null or not.
- since we are adding integers, then we can use extreme values of ints, to see if it causes over or under flow (don't know how, but he agreed with me)
- we can add to an empty list
- add a previously added number (it should be added, he said it is okay to have duplicates)
- if the list adds objects not primitive types, we could check if it is null.

I guess that is it.

He said that they don't just test my skills, but they also try to see if I learn through the day from my interviews. So he added some test cases:

- add several items (maybe a million) and see the performance (is it linear as it should be )
- also see when adding that many items if the memory allocated increase linearly (as it should be) or not.

That is it.. and the time was up, and I got ready for the next interview, which I'll tell you all about next post isA. stay tuned.

2 comments:

  1. Could you post the implementation or the algorithm you used in the interview? - so I can check my own? .. thanks.

    ReplyDelete
  2. that was too long ago now, what you need to check against is this implementation found here in wikipedia: http://en.wikipedia.org/wiki/Doubly_linked_list
    I think I did something similar.

    ReplyDelete