Wednesday, April 18, 2012

The phone Interview (A Microsoft Interview)

related posts:
the technical interview

My first technical interview was a phone interview by Microsoft.
It was a half an hour interview and about 5-7 minutes of them were non interview related.. mostly about the phone connection, as I wanted to be contacted on the land line, but my interviewer couldn't call my land line so she called me on my cell phone.

I had to take the whole interview in the balcony as there is no good signal in the house (nor in the balcony, but we managed).

The funny thing was that I was wearing a suit with no shirt :D. ( it was for my self confidence), I realized after the interview that it is hard to write code or anything (for me anyway) while wearing a suit.
So for all interviews that I've been to, I never wore a suit.

The first set of questions were about some personal information..etc, then we started the real technical interview.

I don't really remember the questions very well, nor the order of them, but I'll try to do my best :)

Before the interview started, I had my browsers tabs open on several answers to some of the questions that repeatedly appear on blogs of people who had such interviews (they would've been helpful if I could take the interview on front of my computer)

One question was: what is a stack??
I answered: a stack is a data structure, and is used for storing data in a first come last served order... it supports operations like push, pop and peek..
She interrupted me, like she got what she wanted, and it seemed that I know what I'm talking about.

She Asked: what is dead code??
I said: what is what..? dead code? I never heard that term before ..!
She Asked again: what i good code?
I answered: oohh... good code, i thought you said dead code :) .. (one of my tabs could have been helpful at that moment)..... GOOD CODE.. hmmm It seems like a well written (you don't say), well documented, well designed ... objects and variables are named with meaningful names.

She Asked another questions about a project that I did in collage with friends of mine.. what it was for, and how we implemented it..
I talked to her about the project (it solves and simulates the solutions of complex equations using several numerical methods such as the bisection method and Newton Raphson method ... etc)

One other questions she asked a testing question.... it was simple but there are several test cases that needed to be handled.

The question was: given a program that was created by a bad programmer... this program contains 3 text fields and a button. The program is intended to be used by children to learn about triangles.
The child/user would enter 3 integers in the 3 text fields and presses the button, then the program draws a triangle with the 3 sides of lengths equal to the 3 integers... how would you test that??

This is a fairly simple question, but it has several corner cases which I'll talk about ...
I answered: we can first start by entering valid values in the text fields to see if it is functioning correctly with valid input, then we can change numbers we enter... we can permute them in all text fields... we can test for invalid cases like entering floating point numbers, entering negative numbers, entering numbers that do not fit in an integer (llike 99999999999999999999999999999999999999999999)
entering non numeric characters, leaving the text fields empty, leaving some text fields empty and others not... etc.
I even used some numbers as examples at some point while answering that question.. but for my unfortunate luck I used 1,2 and 3 :(  which you cannot use to create a triangle... which gets me to one case that I forgot to test for ..... which is triangle inequality... but I remembered it 15 minutes after the interview ..... yay lucky me.

So anyway.. this is the whole this as I remember (it was a year ago).

stay tuned for more interviews in the next set of posts.......


  1. I have a small question ebso , I've known the stack for about 5 years now , so I am ashamed now while asking what is the peek operation :( ?

    by the way, really gr8 posts , keep up the good work ;) and Gazak ALLAH 5ayran.

  2. Thanks man..
    the peek operation is the operation that lets you see the value (or get a reference) of the top of the stack without removing it from the stack.
    The pop operation removes it and returns it.

  3. Whats the result of the interview? you went to the second round or not ?



  4. the same questions wr asked to me,,and hope did good,,and waiting for results

  5. I also just had this interview (Sept 28) - almost exactly the same questions. gana_edi, have you found out your results yet?

  6. I would like to thank you for all the posts. I've had a phone interview a few days before and it was something like that:)