Quant interview prep guides

Gambler's Ruin Interview Questions

Gambler's ruin interview prep for absorbing random walks, hitting probabilities, expected time, fair and biased transitions, and boundary checks.

Candidates practicing random walks with absorbing barriers in quant interviews.

Set up the walk

Gambler's ruin is a random walk with absorbing barriers. Define the current capital or state, the lower barrier, the upper barrier, and the move probabilities before solving.

Hitting probability

For a fair walk, hitting probabilities are linear between boundaries. If the walk starts closer to the upper boundary, the chance of hitting it first is higher. Biased walks need different coefficients.

Expected time

Expected time uses a recurrence with a +1 term for the next step. Boundary states have expected remaining time zero because the process has already stopped.

Concrete example

Starting at 2 with barriers at 0 and 5 in a fair walk, the probability of hitting 5 first is 2/5. The linear result follows from fair transitions and absorbing boundaries.

Decision framing

Despite the name, this is not gambling advice. In interviews, gambler ruin is a clean way to test state recursion, boundaries, and the difference between probability and expected time.

Common mistakes

Candidates often forget the absorbing boundary values or use the fair-walk shortcut for a biased walk. Always write transition probabilities explicitly.

Practice the pattern

Use the LeetQuidity curriculum and calibration to turn this topic into a focused practice plan.