← Optiver Interview Insights

Optiver·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Quant interview at Optiver with a probability/stochastic processes question. Pretty classic setup but the execution is where things get tricky.

Questions Asked (1)

Q1

Consider a random walk on the interval [a, b]. What is the expected number of steps to reach either boundary?

Algorithms & Data StructuresTechnical Trade-offs
Author's notes

I knew the general shape of the answer from having seen gambler's ruin problems before, but the general [a, b] framing made me second-guess my setup.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the random walk model: simple symmetric random walk on integers with absorbing boundaries at a and b. Then, set up a recurrence for the expected hitting time and solve it using standard techniques (e.g., martingales or difference equations). Finally, present the closed-form solution and discuss its implications.

Pro tip: Mention that the expected hitting time scales quadratically with the interval length, which is a key insight for performance analysis in algorithms like randomized search. Also, be prepared to derive the result using martingale theory, as it demonstrates deeper probabilistic understanding.

1. Clarify the problem

Confirm the random walk model: simple symmetric random walk on integers, starting at position x in (a, b), with absorbing boundaries at a and b. Ask if the walk is symmetric and if steps are ±1 with equal probability.

2. Set up recurrence

Let E(x) be the expected number of steps to hit either boundary starting from x. Then E(x) = 1 + (E(x-1) + E(x+1))/2 for a < x < b, with boundary conditions E(a) = E(b) = 0.

3. Solve the recurrence

Recognize that the second difference of E is constant, so E is quadratic. Solve the difference equation to get E(x) = (x - a)(b - x).

4. Verify and interpret

Check boundary conditions and symmetry. Note that the maximum expected steps occur at the midpoint and equal ((b-a)^2)/4, showing quadratic scaling with interval length.

5. Discuss extensions

Mention how the result changes for biased random walks or continuous-time processes, and relate to algorithmic applications like randomized algorithms and hitting times in graphs.

Key Points to Mention

  • Definition of simple symmetric random walk and absorbing boundaries.
  • Recurrence relation for expected hitting time: E(x) = 1 + (E(x-1) + E(x+1))/2.
  • Solution E(x) = (x - a)(b - x), which is quadratic in the distance to boundaries.
  • Maximum expected steps at midpoint: ((b-a)^2)/4, illustrating quadratic scaling.
  • Alternative derivation using martingale theory (e.g., Wald's equation or optional stopping).
  • Relevance to algorithmic analysis: hitting times in randomized algorithms, graph traversal, and performance bounds.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.