Microsoft Interview Question
Software Engineer / Developerscase1. If they have two black balls, the third will immediately know.
case2. they have picked one black and two white.
person1 sees one black and one white, he wont be sure and he will pass. the second one would come to know that the first has seen either both white or one white and one black. If he sees the third has black, he will come to know he has white. but if he sees white, he won't be sure of his color. And he will pass. Now the third one will know that the second has passed, means he has not seen black on my me. So he will be sure he has white.
case3. they picked all white
The first will not be sure and will pass. passing again means the first has seen either two white or one black. The second again can see two whites, so will not be sure if he has black or white. If he has seen any black, he would have sure he has white one. Again third one will be sure that he has not black, else the second would have known his color. So he will come to know his color
Possible View of Advisor 1, to make him pass the turn.
3 2 1
Case 1: W W
Case 2: W B
Case 3: B W
Possible View of Advisor 2, to make him pass the turn.
Case 3: 2 could easily find that he has W, that make 1 to pass the turn. This case is not possible.
Now 2 knows either it is B or W? Still Ambiguous.
3 2 1
Case 1: W W
Case 2: W B
Once, 1 and 2 pass, 3 is sure to have W from Case 1 and Case 2 above.
Let guys be 1,2,3.
- Anonymous August 23, 2009If 1 sees two black, he can guess.
If 1 passes, then if 2 sees 3 has black, he know he must have white.
So if 2 passes also, 3 knows that he has white.