Microsoft

www.microsoft.com
Work in HR? Unlock Free Profile

# MicrosoftSoftware Development Engineer Interview Question (student candidate)

"I am given eight same size balls, one ball has less weight than others, how to find the ball in two step."

Part of a Software Development Engineer Interview Review - one of 3,351 Microsoft Interview Reviews

1
of 1
vote
Take two random balls out. Then divide the 6 remaining ones into 2 groups, 3 balls in each. Measure those two groups. This is your 1st step. If their weights are equal, that means that the lighter ball is among the two that we took out first. Measure their weights (this will be your 2nd step) and find it.
If the weights of the three-ball groups are not equal, take one random ball out of the lighter group and measure the remaining two balls (this is your second step). If their weights are equal, then the lighter ball is the one that you just took out. Otherwise, the answer is obvious.
- Alex on Jun 9, 2013
0
of 0
This is a simplified version of: 12 balls, without knowing the bad ball is heavier or lighter, but in 3 steps.
- Peter on Jul 20, 2013