What this gambler's ruin probability question tests
This is a medium-difficulty probability question that appears frequently in quant interview loops. It asks you to find the probability of reaching a goal state before absorption into a ruin state, using a random walk on a finite interval. The setup is classic: a drifting process with asymmetric step probabilities and absorbing barriers.
To solve it, candidates typically set up a recurrence relation for the survival probability at each position, then solve the resulting linear difference equation. The key insight is recognizing that the general solution depends on whether the walk is biased toward safety or ruin, and handling the boundary conditions carefully. Interviewers value clear problem formulation, correct algebra, and the ability to verify the answer makes intuitive sense (for instance, when p = q = 1/2, the answer should simplify to something linear in the position).
- Recurrence relations and difference equations
- Boundary conditions and absorbing states
- Biased vs. unbiased random walks
- Closed-form solutions to linear recursions