2007年6月3日星期日

Microsoft Interview Question Challenge 1

So I was reading through a guy’s blog of his Microsoft interview questions collection the other day. After reading all of them, I feel quite lucky that I’ve never been asked of such difficult questions by Siemens HR recruiter. Those questions just make you want to shoot the interviewer in no time..hehe..In fact, I have no clues about lots of questions but I am also be able to came up with my solutions to some of them. That guy doesn’t intend to post any answers on his website (it’s no fun for us to know the answer before thinking about it)and it’s mainly open for discussions. Below is my try. Welcome to comment and tell me about your solutions.

Question 1

If you had an infinite supply of water and a 5 quart and 3 quart pail, how would you measure exactly 4 quarts?

Answer

Step 1. Fill the 3 quart pail with 3 quart water.

Step 2. Pour the 3 quart water into the 5 quart pail.

Step 3. Refill the 3 quart pail with 3 quart water.

Step 4. Pour the 3 quart pail into the 5 quart pail to the full and leave 1 extra quart in the pail.

Step 5. Empty the 5 quart pail and pour the 1 quart water you already have in 3 quart pail into the 5 quart pail.

Step 6. Refill the 3 quart pail with 3 quart water and pour it into the 5 quart pail with 3 quart water already in it.

Here you go! You got exact 4 quart water in the 5 quart pail now!!!

没有评论: