The bridge with the sleepy guard
A footbridge takes eight minutes to walk across, at a fixed pace. In a hut at the middle of the bridge sits a guard. He sleeps, but wakes every five minutes, looks out, and sends anyone he sees back to the side they came from; there is no arguing with him. You watch him fall asleep and then start walking from one end.
How do you get to the other side?
Show a hint
The guard does not know where you came from; he judges by the direction you are walking.
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
Sign in to join the discussion · reading is open to everyone
💡 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.
Related questions
The blind man and the four pillsThe bookworm and the ten volumesBorn on the same day, same parents, not twinsEscaping a fire on a long thin islandAdd the milk now or just before drinking?Trains every ten minutes, yet nine visits to one
All questions →