# Combinatorics DSA Problems

> 48 Combinatorics coding problems for placements and interviews, sorted easiest first, with hints and company tags. Free practice on InternHack.

Canonical: https://www.internhack.in/learn/dsa/combinatorics
Last updated: 2026-11-28

48 combinatorics problems for coding interviews and campus placements, with hints and company tags. Below are all 48: 3 easy, 16 medium and 29 hard. Practise them free on InternHack and track what you have solved.

## Combinatorics problems, easiest first

1. [Check If Digits Are Equal in String After Operations I](https://www.internhack.in/learn/dsa/problem/check-if-digits-are-equal-in-string-after-operations-i) (Easy)
2. [Distribute Candies Among Children I](https://www.internhack.in/learn/dsa/problem/distribute-candies-among-children-i) (Easy)
3. [Sum of All Subset XOR Totals](https://www.internhack.in/learn/dsa/problem/sum-of-all-subset-xor-totals) (Easy)
4. [Count Sorted Vowel Strings](https://www.internhack.in/learn/dsa/problem/count-sorted-vowel-strings) (Medium)
5. [Count the Number of Computer Unlocking Permutations](https://www.internhack.in/learn/dsa/problem/count-the-number-of-computer-unlocking-permutations) (Medium)
6. [Count the Number of Good Subsequences](https://www.internhack.in/learn/dsa/problem/count-the-number-of-good-subsequences) (Medium)
7. [Count the Number of K-Free Subsets](https://www.internhack.in/learn/dsa/problem/count-the-number-of-k-free-subsets) (Medium)
8. [Distribute Candies Among Children II](https://www.internhack.in/learn/dsa/problem/distribute-candies-among-children-ii) (Medium)
9. [Find the Derangement of An Array](https://www.internhack.in/learn/dsa/problem/find-the-derangement-of-an-array) (Medium)
10. [Find the N-th Value After K Seconds](https://www.internhack.in/learn/dsa/problem/find-the-n-th-value-after-k-seconds) (Medium)
11. [Find Triangular Sum of an Array](https://www.internhack.in/learn/dsa/problem/find-triangular-sum-of-an-array) (Medium)
12. [Maximum and Minimum Sums of at Most Size K Subsequences](https://www.internhack.in/learn/dsa/problem/maximum-and-minimum-sums-of-at-most-size-k-subsequences) (Medium)
13. [Number of Sets of K Non-Overlapping Line Segments](https://www.internhack.in/learn/dsa/problem/number-of-sets-of-k-non-overlapping-line-segments) (Medium)
14. [Number of Strings Which Can Be Rearranged to Contain Substring](https://www.internhack.in/learn/dsa/problem/number-of-strings-which-can-be-rearranged-to-contain-substring) (Medium)
15. [Right Triangles](https://www.internhack.in/learn/dsa/problem/right-triangles) (Medium)
16. [The Number of Beautiful Subsets](https://www.internhack.in/learn/dsa/problem/the-number-of-beautiful-subsets) (Medium)
17. [Ugly Number III](https://www.internhack.in/learn/dsa/problem/ugly-number-iii) (Medium)
18. [Unique Paths](https://www.internhack.in/learn/dsa/problem/unique-paths) (Medium)
19. [Vowels of All Substrings](https://www.internhack.in/learn/dsa/problem/vowels-of-all-substrings) (Medium)
20. [Check If Digits Are Equal in String After Operations II](https://www.internhack.in/learn/dsa/problem/check-if-digits-are-equal-in-string-after-operations-ii) (Hard)
21. [Count All Valid Pickup and Delivery Options](https://www.internhack.in/learn/dsa/problem/count-all-valid-pickup-and-delivery-options) (Hard)
22. [Count Anagrams](https://www.internhack.in/learn/dsa/problem/count-anagrams) (Hard)
23. [Count K-Reducible Numbers Less Than N](https://www.internhack.in/learn/dsa/problem/count-k-reducible-numbers-less-than-n) (Hard)
24. [Count K-Subsequences of a String With Maximum Beauty](https://www.internhack.in/learn/dsa/problem/count-k-subsequences-of-a-string-with-maximum-beauty) (Hard)
25. [Count Number of Balanced Permutations](https://www.internhack.in/learn/dsa/problem/count-number-of-balanced-permutations) (Hard)
26. [Count the Number of Arrays with K Matching Adjacent Elements](https://www.internhack.in/learn/dsa/problem/count-the-number-of-arrays-with-k-matching-adjacent-elements) (Hard)
27. [Count the Number of Good Partitions](https://www.internhack.in/learn/dsa/problem/count-the-number-of-good-partitions) (Hard)
28. [Count the Number of Ideal Arrays](https://www.internhack.in/learn/dsa/problem/count-the-number-of-ideal-arrays) (Hard)
29. [Count the Number of Infection Sequences](https://www.internhack.in/learn/dsa/problem/count-the-number-of-infection-sequences) (Hard)
30. [Count Ways to Build Rooms in an Ant Colony](https://www.internhack.in/learn/dsa/problem/count-ways-to-build-rooms-in-an-ant-colony) (Hard)
31. [Count Ways to Make Array With Product](https://www.internhack.in/learn/dsa/problem/count-ways-to-make-array-with-product) (Hard)
32. [Distribute Candies Among Children III](https://www.internhack.in/learn/dsa/problem/distribute-candies-among-children-iii) (Hard)
33. [Find Nth Smallest Integer With K One Bits](https://www.internhack.in/learn/dsa/problem/find-nth-smallest-integer-with-k-one-bits) (Hard)
34. [Find Number of Ways to Reach the K-th Stair](https://www.internhack.in/learn/dsa/problem/find-number-of-ways-to-reach-the-k-th-stair) (Hard)
35. [Find Sum of Array Product of Magical Sequences](https://www.internhack.in/learn/dsa/problem/find-sum-of-array-product-of-magical-sequences) (Hard)
36. [Find the Count of Good Integers](https://www.internhack.in/learn/dsa/problem/find-the-count-of-good-integers) (Hard)
37. [Find the Count of Monotonic Pairs I](https://www.internhack.in/learn/dsa/problem/find-the-count-of-monotonic-pairs-i) (Hard)
38. [Find the Count of Monotonic Pairs II](https://www.internhack.in/learn/dsa/problem/find-the-count-of-monotonic-pairs-ii) (Hard)
39. [Find the Number of Possible Ways for an Event](https://www.internhack.in/learn/dsa/problem/find-the-number-of-possible-ways-for-an-event) (Hard)
40. [Kth Smallest Instructions](https://www.internhack.in/learn/dsa/problem/kth-smallest-instructions) (Hard)
41. [Manhattan Distances of All Arrangements of Pieces](https://www.internhack.in/learn/dsa/problem/manhattan-distances-of-all-arrangements-of-pieces) (Hard)
42. [Minimum Number of Operations to Make String Sorted](https://www.internhack.in/learn/dsa/problem/minimum-number-of-operations-to-make-string-sorted) (Hard)
43. [Number of Music Playlists](https://www.internhack.in/learn/dsa/problem/number-of-music-playlists) (Hard)
44. [Number of Ways to Reach Destination in the Grid](https://www.internhack.in/learn/dsa/problem/number-of-ways-to-reach-destination-in-the-grid) (Hard)
45. [Number of Ways to Rearrange Sticks With K Sticks Visible](https://www.internhack.in/learn/dsa/problem/number-of-ways-to-rearrange-sticks-with-k-sticks-visible) (Hard)
46. [Number of Ways to Reorder Array to Get Same BST](https://www.internhack.in/learn/dsa/problem/number-of-ways-to-reorder-array-to-get-same-bst) (Hard)
47. [Poor Pigs](https://www.internhack.in/learn/dsa/problem/poor-pigs) (Hard)
48. [Sorted GCD Pair Queries](https://www.internhack.in/learn/dsa/problem/sorted-gcd-pair-queries) (Hard)

## Companies that ask combinatorics problems

- [Google](https://www.internhack.in/learn/dsa/companies/google): 24 of these problems
- [Amazon](https://www.internhack.in/learn/dsa/companies/amazon): 20 of these problems
- [Meta](https://www.internhack.in/learn/dsa/companies/meta): 12 of these problems
- [Microsoft](https://www.internhack.in/learn/dsa/companies/microsoft): 6 of these problems
- [Bloomberg](https://www.internhack.in/learn/dsa/companies/bloomberg): 5 of these problems
- [Rubrik](https://www.internhack.in/learn/dsa/companies/rubrik): 4 of these problems
- [Adobe](https://www.internhack.in/learn/dsa/companies/adobe): 3 of these problems
- [Infosys](https://www.internhack.in/learn/dsa/companies/infosys): 3 of these problems
- [Oracle](https://www.internhack.in/learn/dsa/companies/oracle): 3 of these problems
- [DE Shaw](https://www.internhack.in/learn/dsa/companies/de-shaw): 3 of these problems
- [Phonepe](https://www.internhack.in/learn/dsa/companies/phonepe): 2 of these problems
- [Nvidia](https://www.internhack.in/learn/dsa/companies/nvidia): 2 of these problems

## Before your interview

Most resumes are filtered by software before a recruiter reads them. [Check your resume ATS score free](https://www.internhack.in/ats-score/try), no signup needed.

## Other DSA topics

- [Array](https://www.internhack.in/learn/dsa/array) (1869)
- [String](https://www.internhack.in/learn/dsa/string) (775)
- [Hash Table](https://www.internhack.in/learn/dsa/hash-table) (708)
- [Math](https://www.internhack.in/learn/dsa/math) (564)
- [Dynamic Programming](https://www.internhack.in/learn/dsa/dynamic-programming) (557)
- [Sorting](https://www.internhack.in/learn/dsa/sorting) (464)
- [Greedy](https://www.internhack.in/learn/dsa/greedy) (407)
- [Depth-First Search](https://www.internhack.in/learn/dsa/depth-first-search) (314)
- [Binary Search](https://www.internhack.in/learn/dsa/binary-search) (298)
- [Matrix](https://www.internhack.in/learn/dsa/matrix) (246)
- [Breadth-First Search](https://www.internhack.in/learn/dsa/breadth-first-search) (245)
- [Bit Manipulation](https://www.internhack.in/learn/dsa/bit-manipulation) (238)
- [Tree](https://www.internhack.in/learn/dsa/tree) (235)
- [Two Pointers](https://www.internhack.in/learn/dsa/two-pointers) (217)
- [Prefix Sum](https://www.internhack.in/learn/dsa/prefix-sum) (204)
- [Database](https://www.internhack.in/learn/dsa/database) (197)
- [Heap (Priority Queue)](https://www.internhack.in/learn/dsa/heap-priority-queue) (196)
- [Simulation](https://www.internhack.in/learn/dsa/simulation) (177)
- [Counting](https://www.internhack.in/learn/dsa/counting) (174)
- [Binary Tree](https://www.internhack.in/learn/dsa/binary-tree) (169)

## Related

- [Home](https://www.internhack.in/)
- [Learn](https://www.internhack.in/learn)
- [DSA](https://www.internhack.in/learn/dsa)
