Interview Brain Teasers Hard 3 min

A company has 100 employees. Exactly one employee is taller than every other employee. Without measuring heights, what type of comparison strategy minimizes the number of pairwise comparisons needed to identify the tallest employee?

Hint
A knockout tournament avoids comparing everyone with everyone.

Answer

Use a tournament-style elimination: compare employees in pairs and keep the taller person from each pair.

Explanation

Each comparison eliminates one candidate. Since 99 employees must be eliminated, at least 99 pairwise comparisons are necessary, and a tournament achieves this.

Step-by-Step Solution

Each comparison can eliminate at most one candidate.
99 candidates must be eliminated.
Therefore 99 comparisons are sufficient and necessary.
6 puzzles