# Mountain Man

Source: https://www.techinterview.org/post/521419748/mountain-man/
Updated: 2026-07-03 · techinterview.org

**TL;DR —** Confirmed — it's the classic mountain-climber puzzle (up on day one, down on day two, same 6 a.m.–6 p.m. window), and the answer is that he must occupy the same spot at the same time, probability 100%. Here's the answer box:

Yes — the hiker is guaranteed to pass one point on the trail at the exact same time of day on both the climb and the descent, so the probability is 100%. Overlay the two trips onto a single day: one version of him walking up and one walking down the same path must cross somewhere, and that crossing point sits at the same clock time on both days. It holds for any pace and any number of rest stops, because two people moving toward each other along a single path always meet.

At 6 a.m. a man starts hiking a path up a mountain. he walks at a variable pace, resting occasionally, but never actually reversing his direction. at 6 p.m. he reaches the top. he camps out overnight. the next morning he wakes up at 6 a.m. and starts his descent down the mountain. again he walks down the path at a variable pace, resting occassionally, but always going downhill. at 6 p.m. he reaches the bottom. what is the probability that at some time during the second day, he is in the exact same spot he was in on the first day?

### Solution

The probability is 100%. the easiest way to see it is, consider that on the second day when the man is going down the mountain, a ghost follows his original pace up the mountain. so even if he varies his pace as he goes down the mountain, at some point in time, he will be in the same spot as the ghost, and therefore, the same spot he was in the day before.

## 2026 Update: Navigation and Coordinate Puzzles

Navigation-based brain teasers test spatial reasoning and systematic thinking. They connect directly to robotics, autonomous vehicle path planning, and GPS coordinate systems — all hot hiring areas in 2026.

**Modern version asked in [2026 interviews](/ai-era-interview-guide/):** "A robot starts at (0,0) facing North. It receives commands: L (turn left 90°), R (turn right 90°), F N (move N steps forward). Where does it end up?" Structurally identical but asked in a [coding context](/problem-index/).


```
def robot_position(commands):
    x, y = 0, 0
    # Directions: N=0, E=1, S=2, W=3 mapped to (dx, dy)
    dx = [0, 1, 0, -1]
    dy = [1, 0, -1, 0]
    facing = 0  # North

    for cmd in commands:
        if cmd == "L":
            facing = (facing - 1) % 4
        elif cmd == "R":
            facing = (facing + 1) % 4
        elif cmd.startswith("F"):
            steps = int(cmd.split()[1])
            x += dx[facing] * steps
            y += dy[facing] * steps

    return x, y
```


**What interviewers want:** Clear enumeration of state (position + direction), systematic simulation, awareness of modular arithmetic for direction tracking. These are the same primitives used in any state-machine simulation.
