When should you stop, and how long will it take? Random walks, gambler's ruin and the secretary problem show up in interviews because they reward clean reasoning with recursion and symmetry. These puzzles cover the classics and a few twists, each checked by simulation.
What these puzzles practice
Random walks and gambler's ruin
Optimal stopping and the 1/e rule
Recursion and first-step analysis
10 puzzles, easiest first
First to flip heads· Coin game · difficulty 2 of 5Two players take turns flipping a coin that lands heads with probability 0.5. The first player to flip heads wins. What is the probability…
How long the series runs· Playoffs · difficulty 3 of 5Two teams play a playoff series that ends as soon as one of them has 4 wins, so it lasts at most 7 games. Team A wins each game with…
How long until it's over· Coin-flip betting · difficulty 3 of 5You have $3. You bet $1 at a time on flips of a fair coin: heads you win $1, tails you lose $1. You stop as soon as you have $10 or you go…
Keep or reroll· Dice game · difficulty 3 of 5You roll a fair 6-sided die and are paid its face value. After each roll you may keep it, or roll again, up to 1 rerolls in total; you…
One step from the edge· Random walk · difficulty 3 of 5A walker stands one step from the edge of a cliff. Each step, independently, they move one step away from the edge with probability 2/3…
Will you land on it?· Board games · difficulty 3 of 5In a board game, your token starts on square 0. You roll a fair six-sided die over and over, each time moving forward by the number…
A small edge, a big gap· Betting · difficulty 4 of 5You start with 5 chips. Each round you bet one chip on a game you win with probability 0.45: win and you gain a chip, lose and you lose…
Lost on the subway· Subway · difficulty 4 of 5A lost tourist starts at the first station of a subway line with 11 stations in a row. At every station they board a train in a random…
Pick your pattern second· Coin game · difficulty 4 of 5Alice and Bob play a coin game. Alice picks the pattern HHT and Bob picks THH (H is heads, T is tails). A fair coin is flipped again and…
Hire on the spot· Startup hiring · difficulty 5 of 5You interview 10 candidates in random order and must decide on each one on the spot. Your rule: skip the first 3, then hire the first…