Microsoft Interview Questions




Ever wondered what it’s like to sit in the interviewers chair at Microsoft? I for one wouldn’t want to find myself there, but the interview questions are fun and sometimes funny and typically are broken down into a riddle, questions about algorithms, applications, and thinker type questions. Some of my favorites:

Riddles:

1. Imagine you are standing in front of a mirror, facing it. Raise your left hand. Raise your right hand. Look at your reflection. When you raise your left hand your reflection raises what appears to be his right hand. But when you tilt your head up, your reflection does too, and does not appear to tilt his/her head down. Why is it that the mirror appears to reverse left and right, but not up and down?

2. One train leaves Los Angeles at 15mph heading for New York. Another train leaves from New York at 20mph heading for Los Angeles on the same track. If a bird, flying at 25mph, leaves from Los Angeles at the same time as the train and flies back and forth between the two trains until they collide, how far will the bird have traveled?

3. If you have two buckets, one with red paint and the other with blue paint, and you take one cup from the blue bucket and poor it into the red bucket. Then you take one cup from the red bucket and poor it into the blue bucket. Which bucket has the highest ratio between red and blue? Prove it mathematically.

4. How many manhole covers are there in the USA?

Algorithms (If you can answer these, kudos to you, I couldn’t! :) )

1. Suppose you have an array of 1001 integers. The integers are in random order, but you know each of the integers is between 1 and 1000 (inclusive). In addition, each number appears only once in the array, except for one number, which occurs twice. Assume that you can access each element of the array only once. Describe an algorithm to find the repeated number. If you used auxiliary storage in your algorithm, can you find an algorithm that does not require it?

2. Implement an algorithm that takes two strings as input, and returns the intersection of the two, with each letter represented at most once. Now speed it up. Now test it.

3. How would you print out the data in a binary tree, level by level, starting at the top?

4. Imagine this scenario:
I/O completion ports are communication ports which take handles to files, sockets, or any other I/O. When a Read or Write is submitted to them, they cache the data (if necessary), and attempt to take the request to completion. Upon error or completion, they call a user-supplied function to let the users application know that that particular request has completed. They work asynchronously, and can process an unlimited number of simultaneous requests.
Design the implementation and thread models for I/O completion ports. Remember to take into account multi-processor machines.

Applications:

1.  How can computer technology be integrated in an elevator system for a hundred story office building? How do you optimize for availability? How would variation of traffic over a typical work week or floor or time of day affect this?

2.  Define a user interface for indenting selected text in a Word document. Consider selections ranging from a single sentence up through selections of several pages. Consider selections not currently visible or only partially visible. What are the states of the new UI controls? How will the user know what the controls are for and when to use them?

3.  How would you design a coffee-machine for an automobile.

4. How would you go about building a keyboard for 1-handed users?

Thinkers:

1.  How would you explain how to use Microsoft Excel to your grandma?

2. Suppose you go home, enter your house/apartment, hit the light switch, and nothing happens – no light floods the room. What exactly, in order, are the steps you would take in determining what the problem was?

3. How are M&Ms made?

4. You have been assigned to design Bill Gates bathroom. Naturally, cost is not a consideration. You may not speak to Bill.

News Source: Sells Brothers