Two Eggs, d Drops: Maximum Floors

Reported in interviews at Balyasny Asset Management Two Sigma Virtu Financial

Problem statement

With two identical eggs and at most $d$ drops, what is the largest number of floors $n$ for which you can always find the highest safe floor? Give a formula in $d$ and the value for $d=10$.

The highest safe floor can be anywhere from $0$ to $n$. An egg breaks on every floor above that threshold and survives on every floor at or below it. A surviving egg can be reused; a broken egg is lost.

Show hint

If the first egg breaks, what search are you stuck with for the floors below, and how many drops do you have for it?

Relevant roles: Data Scientist, Applied Scientist, Research Scientist and ML Engineer.

Related free problems