Interview Brain Teasers
Hard
3 min
You have 10 bags of coins. One entire bag contains coins that are 1 gram heavier than normal. With one weighing on a precise digital scale, how can you identify the defective bag?
Hint
Take different numbers of coins from each bag.
Answer
Take 1 coin from bag 1, 2 from bag 2, ..., 10 from bag 10. The excess weight in grams identifies the bag.
Explanation
If bag n is defective, the total weight will be n grams more than the expected weight.
Step-by-Step Solution
Take 1+2+...+10 coins from the bags.
Calculate expected weight.
The excess number of grams equals the defective bag number.
Calculate expected weight.
The excess number of grams equals the defective bag number.