Three eggs and a hundred floors
A building has 100 floors. There is a critical floor: eggs dropped from that floor or higher break, eggs dropped from below it survive (and can be reused). You have three identical eggs.
What is the smallest number of drops that guarantees you can identify the critical floor, whatever it is? Explain the reasoning and how it generalises from the two-egg case.
Show a hint
Ask how many floors you can handle with a given number of drops and a given number of eggs. With d drops and e eggs, your first drop splits the problem into "it broke" (d minus 1 drops, e minus 1 eggs, floors below) and "it survived" (d minus 1 drops, e eggs, floors above).
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.