Expedia Interview Question: Given a balance and marbles w... | Glassdoor

Interview Question

Software Development Engineer II Interview Bellevue, WA

Given a balance and marbles where one marble weighs more

  than the other, how many times do you have to use the balance to find the heaviest marble for 7 marbles. Then, extend that answer to how many marbles can you weigh with 4 tries.
Answer

Interview Answer

3 Answers

1

Q: how many times do you have to use the balance to find the heaviest marble for 7 marbles
Answer : Twice
Explanation:
1 . Put three marbles at the each side of balance leaving one.
           If both of the sides of balance are equal , then the one left is the heaviest.
           if not take the three marbles which weight more.
2. Among out of 3 from above collection , put one at each side of balance and leave the third one.
           If both side of balance is same then the marble left is heaviest.
           Or the marble which weigh more in the balance is the heaviest.

Puzzle Lover on Jan 27, 2013
0

Put any four marbles at the each side of the balance leaving three
    If both of the sides of balance are equal then
         select any 2 marbles out of the left 3 marbles and weight
                If both sides of balance are equal then the left one is heaviest
                Otherwise the marble which weight is more is the heaviest
    Otherwise weight the marbles that is on heaviest side and one of them is the heaviest one

Anonymous on Oct 13, 2014
0

1) 2 tries. 3 vs 3 first. If both are equal it means that the remaining marble is the odd one. If both aren't equal then do 1 vs 1 weigh.
2) 31 marbles. The max number of marbles you can differentiate between with 1 try is 3. For each subsequent try double the previous number and add 1.For 4 tries that would be 31.

anna on Mar 19, 2016

Add Answers or Comments

To comment on this, Sign In or Sign Up.