Intermediate Combinatorics Problems for Coding Interviews
35 intermediate Combinatorics problems from real coding interviews, each with test cases you can run online. By difficulty they split into 0 basic, 35 intermediate and 0 advanced. The companies that ask them most often are Amazon, Google, Microsoft, 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
- Pascal Triangle Value (Intermediate)
- Permutation Inside a String (Intermediate)
- Coin Change Ways (Intermediate)
- Next Permutation (Intermediate)
- Minimum Operations to Sort by Reversals (Intermediate)
- Combination Sum IV (Intermediate)
- Count Vowel Permutations (Intermediate)
- Validate Stack Sequences (Intermediate)
- Permutations of Distinct Values (Intermediate)
- Combination Sum (Intermediate)
- Combination Sum II (Intermediate)
- Combination Sum III (Intermediate)
- Letter Combinations of a Phone Number (Intermediate)
- Beautiful Arrangement (Intermediate)
- Combinations (Intermediate)
- Stirling Numbers of the Second Kind (Intermediate)
- Largest Combination With Positive AND (Intermediate)
- Binomial Coefficient Queries (Intermediate)
- Expected Cycles in Random Permutation (Intermediate)
- Next Lexicographic Permutation of String (Intermediate)
- Stack Sortable Permutation Check (Intermediate)
- Unsigned Stirling Number of the First Kind (Intermediate)
- Involution Count Modulo (Intermediate)
- Count Subarrays That Are Permutations (Intermediate)
- Lehmer Code of Permutation (Intermediate)
- Permutation From Lehmer Code (Intermediate)
- Inversion Table of Permutation (Intermediate)
- Order of a Permutation (Intermediate)
- Permutation Raised to Power K (Intermediate)
- Fixed Points After K Applications (Intermediate)
- Binomial Expansion Coefficient (Intermediate)
- Catalan Number Modulo (Intermediate)
- Derangement Count Modulo (Intermediate)
- Stirling Number of the Second Kind Modulo (Intermediate)
- Unsigned Stirling Cycle Number Modulo (Intermediate)
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.