Microsoft interview question

Behavioural questions

Interview Answer

Anonymous

May 23, 2015

Split the marbles into 3 groups of 3 each. The first measurement with the scale will reveal which set of 3 contains the heavier marble: we choose to put 2 of the 3 sets on the scale; if the scale balances, the heavy marble is in the 3rd set. If it doesn't, the marble is in the heavier of the 2 measured. Having determined the set which contains the marble, we make one more measurement with 2 of the 3 remaining marbles, choosing them arbitrarily. In a similar way, if the scale balances, the heavy marble is the one we didn't put on the scale. If not, it should be obvious which of the other 2 it is.