Minimax Problems for Coding Interviews
29 Minimax problems from real coding interviews, each with test cases you can run online. By difficulty they split into 5 basic, 11 intermediate and 13 advanced. The companies that ask them most often are Google, Meta, Amazon, Microsoft.
Solve a few problems of each level, name the pattern after each one and revisit the ones that needed a hint a week later. Practise stating the time and space complexity and the edge cases before you code.
Coding problems
- Stone Game Score Difference (Intermediate)
- Stone Game II (Intermediate)
- Stone Game III (Intermediate)
- Can I Win (Advanced)
- Stone Game IV (Intermediate)
- Stone Game V (Advanced)
- Stone Game VII (Intermediate)
- Cat and Mouse (Advanced)
- Stone Game VI (Intermediate)
- Stone Game VIII (Advanced)
- Nim Sum Winner (Basic)
- Misere Nim Winner (Intermediate)
- Staircase Nim Winner (Intermediate)
- Subtraction Game Winner (Basic)
- Fibonacci Nim Winner (Advanced)
- Wythoff Game Winner (Advanced)
- Kayles Game Winner (Advanced)
- Multi-Pile Subtraction Game Winner (Advanced)
- Euclid Subtraction Game Winner (Advanced)
- Chocolate Break Game Winner (Basic)
- Dominoes on a Strip Game Winner (Advanced)
- Power of Two Moves Game Winner (Basic)
- Green Hackenbush Tree Winner (Advanced)
- DAG Token Game Winner (Intermediate)
- Digit Removal Game Winner (Intermediate)
- Grundy's Game Winner (Advanced)
- Bounded Take Game Winner (Basic)
- King to Corner Game Winner (Intermediate)
- Knight Corner Game Winner (Advanced)
Related
- Intermediate Minimax problems
- Advanced Minimax problems
- Practice coding problems online
- All interview guides
Frequently asked questions
How do I get good at minimax problems?
Practise by level, name the pattern after you solve each problem and review the ones you needed hints for. The list is ordered so you can start with the basic ones.
Can I run minimax problems online here?
Yes. Each problem opens in an editor that runs your code against test cases in Java, Python, C++, Go, JavaScript and more.