Microsoft

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

Microsoft Software 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."
Add Tags [?]
Answer

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

Answers & Comments

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
votes
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

To comment on this question, Sign In with Facebook or Sign Up

Tags are like keywords that help categorize interview questions that have something in common.