Advanced Combinatorics Problems for Coding Interviews
15 advanced Combinatorics problems from real coding interviews, each with test cases you can run online. By difficulty they split into 0 basic, 0 intermediate and 15 advanced. The companies that ask them most often are Google, Microsoft, Amazon, Bloomberg.
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
- Max Chunks to Make Sorted (Advanced)
- Ways to Reorder Array to Get Same BST (Advanced)
- Permutation Rank (Advanced)
- Couples Holding Hands (Advanced)
- K Inverse Pairs Array (Advanced)
- Count Increasing Quadruplets (Advanced)
- DI String Valid Permutations (Advanced)
- Decode XORed Permutation (Advanced)
- Binomial Modulo Small Prime (Advanced)
- Eulerian Number Modulo (Advanced)
- Count 132-Avoiding Permutations (Advanced)
- Permutations With Exactly K Fixed Points (Advanced)
- Kendall Tau Distance Between Permutations (Advanced)
- Centralizer Size of Permutation (Advanced)
- Lexicographic Rank of a Word (Advanced)
Related
Frequently asked questions
How do I get good at combinatorics 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 combinatorics 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.