Random Walks in Quant Interviews

The random walk is the atom of quant probability — price models, ruin problems, and half the stochastic-process round reduce to it.

A simple random walk steps +1 or −1 each round. It is the discrete skeleton of Brownian motion, the model behind gambler's ruin, and the setting for a large share of stochastic-process interview questions. Four facts plus one trick cover most of what gets asked.

The four facts

  • Hitting probabilities. From $a$, the chance of hitting $N$ before 0 is $a/N$ (fair) — see gambler's ruin for the biased version.
  • Exit times. Expected time to leave $[0, N]$ from $a$ is $a(N-a)$. A walk on an interval of width $w$ takes on the order of $w^2$ steps to cross it — the square-root scaling that underlies all diffusion intuition.
  • Recurrence. The symmetric walk returns to 0 with probability 1 in 1D and 2D, but NOT in 3D ("a drunk man finds his way home; a drunk bird may be lost forever") — a classic conceptual question. But the expected return time is infinite even in 1D — the standard follow-up.
  • Position distribution. After $n$ steps, position is a shifted binomial: mean 0, variance $n$, standard deviation $\sqrt{n}$. "Where is the walk after 100 steps, roughly?" — within about ±10 with two-thirds probability.

The trick: the reflection principle

To count paths that touch a barrier, reflect the path after the first touch. It converts "paths from A to B that hit level $m$" into "all paths from A' (the reflection) to B" — giving the ballot problem, the distribution of the maximum, and first-passage counts in one move. If you state "reflect at the first touch" cleanly, most interviewers consider the question answered.

Worked micro-example

Fair walk from 0; probability it reaches +1 within 3 steps? Paths of length 3: the walk reaches +1 immediately with the first up-step ($1/2$); if it steps down first (prob $1/2$), it needs two up-steps to be back at 0... enumerate: sequences starting D that touch +1 by step 3: DUU only reaches 0 at step 3 — never +1. So the answer is the probability of U on step 1 = ... plus DU? D then U reaches 0, then U reaches +1 at step 3: DUU ends at +1! So P = P(U) + P(DUU) = 1/2 + 1/8 = 5/8. Enumerating carefully beats waving at formulas — interviewers watch for that discipline on small cases.

Practice with solutions

More topic guides

Frequently asked questions

Is a simple random walk recurrent?

In 1D and 2D the symmetric walk returns to the origin with probability 1; in 3D and higher it doesn't. Standard follow-up: even in 1D the expected return time is infinite.

What is the reflection principle?

A path-counting trick: reflect a path across the barrier after its first touch. It bijects barrier-touching paths with unconstrained paths from a reflected start, yielding the ballot problem, maximum distributions, and first-passage probabilities.

How far does a random walk travel in n steps?

Position after n steps has mean 0 and standard deviation √n — the square-root scaling behind diffusion: to cross an interval of width w takes on the order of w² steps.

How do random walks connect to finance?

They are the discrete skeleton of Brownian motion and the random-walk model of prices; hitting-time questions map to barrier options and stop-loss levels, and ruin problems to bankroll management.

Practice the real thing

QuantVault has 2,800+ quant interview problems with full solutions, intuition, and hints, firm-by-firm interview funnels, and an auto-graded coding judge. Start free.