~/problems
Problems
Basics first, then the classics, then company-style assessments. Every problem has tests you run right here; multi-level ones unlock as you go. See the roadmap.
Quant & trading
Probability
Expected value, sampling, randomized algorithms.
18 problems
Quant & trading
Probability Expected value, sampling, randomized algorithms.
Probability and expected value
- Basics: distribution of a dice sum basics easy
- Surprise scoops: expected flavours tried easy
- Uniform 1..10 from a 1..7 die medium
- New 21 Game py · c++ · java medium
- Knight stays on the board py · c++ · java medium
- Restart strategies for a random solve time 3 levels OpenAI hard
- Optimal execution with a broker backstop Optiver py · c++ · java hard
- Coupon collector: rolls until every face appears easy
- Expected coin flips until a pattern appears medium
- Expected maximum of k dice easy
- Gambler's ruin: chance to reach the target easy
Randomized algorithms
- Basics: weighted random pick basics easy
- Plant swap: nobody keeps their own cutting easy
- Random node of a linked list medium
- Shuffle an array easy
- Random index of a target value easy
- Random pick avoiding a blacklist medium
- Uniform sample of k items from a stream medium