Solve two logic brain teasers
Two Classic Logic and Optimization Puzzles
This interview question presents two distinct logic and optimization puzzles designed to assess problem-solving skills, systematic thinking, and the ability to justify solutions.
Puzzle 1: Heavier Ball with a Balance Scale
You are given 12 visually identical balls. Exactly one of these balls is heavier than the others; all remaining balls have an equal weight. You have access to a balance scale and are permitted to use it a maximum of three times.
Your task is to:
- Determine which specific ball is the heavier one.
- Provide a clear justification demonstrating that three weighings are both sufficient to find the ball and necessary, meaning it cannot be reliably found in fewer than three weighings.
Notes:
- A balance scale comparison can result in three distinct outcomes: the left side is heavier, the right side is heavier, or both sides balance.
- It is explicitly known that the anomalous ball is heavier, not lighter.
Puzzle 2: Bridge and Torch
Four individuals need to cross a bridge at night. They have only one torch. Their individual crossing times are 1 minute, 2 minutes, 7 minutes, and 10 minutes.
Constraints:
- At most two people can cross the bridge at any given time.
- The torch must be carried whenever anyone crosses the bridge.
- If two people cross together, they must travel at the pace of the slower person.
Your task is to find:
- The minimum total time required for all four people to cross the bridge.
- A detailed sequence of crossings that achieves this minimum time.
- A brief proof of optimality, explaining why no faster schedule is possible.
AI interview prep
Core dilemma
The central engineering conflict is the optimal allocation of limited resources (balance scale weighings, a single torch) and constrained actions (ternary outcomes, paired crossings) to achieve a specific goal (identify the heavier ball, minimize total crossing time) while rigorously proving the optimality and necessity of the solution.
3 tradeoffs and 3 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
Solve two logic brain teasers
Two Classic Logic and Optimization Puzzles
This interview question presents two distinct logic and optimization puzzles designed to assess problem-solving skills, systematic thinking, and the ability to justify solutions.
Puzzle 1: Heavier Ball with a Balance Scale
You are given 12 visually identical balls. Exactly one of these balls is heavier than the others; all remaining balls have an equal weight. You have access to a balance scale and are permitted to use it a maximum of three times.
Your task is to:
- Determine which specific ball is the heavier one.
- Provide a clear justification demonstrating that three weighings are both sufficient to find the ball and necessary, meaning it cannot be reliably found in fewer than three weighings.
Notes:
- A balance scale comparison can result in three distinct outcomes: the left side is heavier, the right side is heavier, or both sides balance.
- It is explicitly known that the anomalous ball is heavier, not lighter.
Puzzle 2: Bridge and Torch
Four individuals need to cross a bridge at night. They have only one torch. Their individual crossing times are 1 minute, 2 minutes, 7 minutes, and 10 minutes.
Constraints:
- At most two people can cross the bridge at any given time.
- The torch must be carried whenever anyone crosses the bridge.
- If two people cross together, they must travel at the pace of the slower person.
Your task is to find:
- The minimum total time required for all four people to cross the bridge.
- A detailed sequence of crossings that achieves this minimum time.
- A brief proof of optimality, explaining why no faster schedule is possible.