Garmin Interview Question: Two people are walking down a... | Glassdoor

## Interview Question

Software Engineer Interview Olathe, KS

# Two people are walking down a tunnel, they are 1/3 of the

way through the tunnel when they hear a train behind them. One of the people runs back towards the entry where they started and exits the tunnel just as the train is entering. The second person runs towards the exit where they were heading and exits just as the train is exiting the tunnel. Relative to the people how fast is the train moving and how far away was the train when they heard it?

4

How fast:
We assume both people are running at the same speed the whole time, so when the first person exits the tunnel and the train enters the second person is roughly 2/3 of the way through the tunnel. Since the second person and the train exit at the same time we can say the train is moving three times the speed of the people since the train covered the full tunnel (3/3) in the time it took the second person to cover the last 1/3.

How far:
Knowing that the train travels a full tunnel length each time a person travels 1/3 of the tunnel we can say that the train must then start a tunnel's length away from the tunnel since it enters the tunnel at the same time the first person exits (who only covered 1/3 of the tunnel to escape)

Interview Candidate on Jan 18, 2013