Measure Forty-Five Minutes with Two Unevenly Burning Ropes
MetaSoftware Engineer · Technical ScreenLast updated
Measure exactly 45 minutes using two ropes that each burn for 60 minutes but at unpredictable rates. The reasoning must rely only on lighting rope ends and observing completion events, never on assuming that half a rope represents half the time.
Interview Prompt
You have two ropes. Each rope takes exactly 60 minutes to burn completely from one end, but neither burns at a uniform rate and the ropes need not behave alike. With only a lighter and no clock, describe a procedure that measures exactly 45 minutes.
Constraints & Assumptions
- Lighting one end of a rope does not imply half its length burns in 30 minutes.
- You may light either end of either rope at any observable event.
- The only timing signals are ropes finishing their burns.
Clarifying Questions to Ask
- Does each rope's total one-ended burn time remain exactly 60 minutes despite unevenness?
- Can both ends of a rope be lit simultaneously?
- Is the desired interval measured from the first ignition?
Follow-up questions
- Which other durations can the same two ropes measure exactly?
- Why is marking the physical midpoint invalid?
- What assumption would fail if lighting both ends changed the rope's chemistry?
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.