ML Engineer MasterClass (April) | 6 seats left

Gambler's Ruin

Gambler's Ruin

Problem Statement

The Question

Interview question: Player A starts with $k and Player B starts with $\$(n-k)$, for a combined total of $n$ dollars. Each round, A wins $1 from B with probability $p$, and loses $1 to B with probability $q = 1-p$. They keep playing until one player is broke. What is the probability that Player A is ruined?

This problem shows up at virtually every top quant firm, Jan...

Unlock the full lesson

Created by interviewers from Google and Meta. Master every concept you need to land your dream role.

All courses — Data, ML/AI & Quant
Unlimited coding submissions
Hands-on projects with real datasets
Detailed solutions in text & video
Monthly content updates
Join Premium