# Counting DSA Problems

> 174 Counting 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/counting
Last updated: 2026-11-28

174 counting problems for coding interviews and campus placements, with hints and company tags. Below are the first 100 of 174: 58 easy, 18 medium and 24 hard. Practise them free on InternHack and track what you have solved.

## Counting problems, easiest first

1. [Best Poker Hand](https://www.internhack.in/learn/dsa/problem/best-poker-hand) (Easy)
2. [Check if All Characters Have Equal Number of Occurrences](https://www.internhack.in/learn/dsa/problem/check-if-all-characters-have-equal-number-of-occurrences) (Easy)
3. [Check if Number Has Equal Digit Count and Digit Value](https://www.internhack.in/learn/dsa/problem/check-if-number-has-equal-digit-count-and-digit-value) (Easy)
4. [Check if One String Swap Can Make Strings Equal](https://www.internhack.in/learn/dsa/problem/check-if-one-string-swap-can-make-strings-equal) (Easy)
5. [Check Whether Two Strings are Almost Equivalent](https://www.internhack.in/learn/dsa/problem/check-whether-two-strings-are-almost-equivalent) (Easy)
6. [Count Common Words With One Occurrence](https://www.internhack.in/learn/dsa/problem/count-common-words-with-one-occurrence) (Easy)
7. [Count Elements With Maximum Frequency](https://www.internhack.in/learn/dsa/problem/count-elements-with-maximum-frequency) (Easy)
8. [Count Elements With Strictly Smaller and Greater Elements](https://www.internhack.in/learn/dsa/problem/count-elements-with-strictly-smaller-and-greater-elements) (Easy)
9. [Count Largest Group](https://www.internhack.in/learn/dsa/problem/count-largest-group) (Easy)
10. [Count Number of Pairs With Absolute Difference K](https://www.internhack.in/learn/dsa/problem/count-number-of-pairs-with-absolute-difference-k) (Easy)
11. [Count Pairs Of Similar Strings](https://www.internhack.in/learn/dsa/problem/count-pairs-of-similar-strings) (Easy)
12. [Count Pairs That Form a Complete Day I](https://www.internhack.in/learn/dsa/problem/count-pairs-that-form-a-complete-day-i) (Easy)
13. [Count Tested Devices After Test Operations](https://www.internhack.in/learn/dsa/problem/count-tested-devices-after-test-operations) (Easy)
14. [Count the Number of Consistent Strings](https://www.internhack.in/learn/dsa/problem/count-the-number-of-consistent-strings) (Easy)
15. [Count the Number of Vowel Strings in Range](https://www.internhack.in/learn/dsa/problem/count-the-number-of-vowel-strings-in-range) (Easy)
16. [Design Parking System](https://www.internhack.in/learn/dsa/problem/design-parking-system) (Easy)
17. [Determine if String Halves Are Alike](https://www.internhack.in/learn/dsa/problem/determine-if-string-halves-are-alike) (Easy)
18. [Divide Array Into Equal Pairs](https://www.internhack.in/learn/dsa/problem/divide-array-into-equal-pairs) (Easy)
19. [Filter Characters by Frequency](https://www.internhack.in/learn/dsa/problem/filter-characters-by-frequency) (Easy)
20. [Find Lucky Integer in an Array](https://www.internhack.in/learn/dsa/problem/find-lucky-integer-in-an-array) (Easy)
21. [Find Most Frequent Vowel and Consonant](https://www.internhack.in/learn/dsa/problem/find-most-frequent-vowel-and-consonant) (Easy)
22. [Find The Least Frequent Digit](https://www.internhack.in/learn/dsa/problem/find-the-least-frequent-digit) (Easy)
23. [Find the Number of Winning Players](https://www.internhack.in/learn/dsa/problem/find-the-number-of-winning-players) (Easy)
24. [Find Valid Pair of Adjacent Digits in String](https://www.internhack.in/learn/dsa/problem/find-valid-pair-of-adjacent-digits-in-string) (Easy)
25. [Find Words That Can Be Formed by Characters](https://www.internhack.in/learn/dsa/problem/find-words-that-can-be-formed-by-characters) (Easy)
26. [First Letter to Appear Twice](https://www.internhack.in/learn/dsa/problem/first-letter-to-appear-twice) (Easy)
27. [First Unique Character in a String](https://www.internhack.in/learn/dsa/problem/first-unique-character-in-a-string) (Easy)
28. [Furthest Point From Origin](https://www.internhack.in/learn/dsa/problem/furthest-point-from-origin) (Easy)
29. [Increasing Decreasing String](https://www.internhack.in/learn/dsa/problem/increasing-decreasing-string) (Easy)
30. [Intersection of Multiple Arrays](https://www.internhack.in/learn/dsa/problem/intersection-of-multiple-arrays) (Easy)
31. [Intersection of Three Sorted Arrays](https://www.internhack.in/learn/dsa/problem/intersection-of-three-sorted-arrays) (Easy)
32. [Kth Distinct String in an Array](https://www.internhack.in/learn/dsa/problem/kth-distinct-string-in-an-array) (Easy)
33. [Longest Harmonious Subsequence](https://www.internhack.in/learn/dsa/problem/longest-harmonious-subsequence) (Easy)
34. [Majority Element](https://www.internhack.in/learn/dsa/problem/majority-element) (Easy)
35. [Maximum Count of Positive Integer and Negative Integer](https://www.internhack.in/learn/dsa/problem/maximum-count-of-positive-integer-and-negative-integer) (Easy)
36. [Maximum Difference Between Even and Odd Frequency I](https://www.internhack.in/learn/dsa/problem/maximum-difference-between-even-and-odd-frequency-i) (Easy)
37. [Maximum Number of Balloons](https://www.internhack.in/learn/dsa/problem/maximum-number-of-balloons) (Easy)
38. [Maximum Number of Balls in a Box](https://www.internhack.in/learn/dsa/problem/maximum-number-of-balls-in-a-box) (Easy)
39. [Maximum Number of Pairs in Array](https://www.internhack.in/learn/dsa/problem/maximum-number-of-pairs-in-array) (Easy)
40. [Maximum Population Year](https://www.internhack.in/learn/dsa/problem/maximum-population-year) (Easy)
41. [Minimum Deletions for At Most K Distinct Characters](https://www.internhack.in/learn/dsa/problem/minimum-deletions-for-at-most-k-distinct-characters) (Easy)
42. [Most Common Word](https://www.internhack.in/learn/dsa/problem/most-common-word) (Easy)
43. [Most Frequent Even Element](https://www.internhack.in/learn/dsa/problem/most-frequent-even-element) (Easy)
44. [Most Frequent Number Following Key In an Array](https://www.internhack.in/learn/dsa/problem/most-frequent-number-following-key-in-an-array) (Easy)
45. [Number of Equivalent Domino Pairs](https://www.internhack.in/learn/dsa/problem/number-of-equivalent-domino-pairs) (Easy)
46. [Number of Good Pairs](https://www.internhack.in/learn/dsa/problem/number-of-good-pairs) (Easy)
47. [Ransom Note](https://www.internhack.in/learn/dsa/problem/ransom-note) (Easy)
48. [Rearrange Characters to Make Target String](https://www.internhack.in/learn/dsa/problem/rearrange-characters-to-make-target-string) (Easy)
49. [Redistribute Characters to Make All Strings Equal](https://www.internhack.in/learn/dsa/problem/redistribute-characters-to-make-all-strings-equal) (Easy)
50. [Remove Letter To Equalize Frequency](https://www.internhack.in/learn/dsa/problem/remove-letter-to-equalize-frequency) (Easy)
51. [Sort Integers by The Number of 1 Bits](https://www.internhack.in/learn/dsa/problem/sort-integers-by-the-number-of-1-bits) (Easy)
52. [Split a String in Balanced Strings](https://www.internhack.in/learn/dsa/problem/split-a-string-in-balanced-strings) (Easy)
53. [Split the Array](https://www.internhack.in/learn/dsa/problem/split-the-array) (Easy)
54. [Substrings of Size Three with Distinct Characters](https://www.internhack.in/learn/dsa/problem/substrings-of-size-three-with-distinct-characters) (Easy)
55. [Sum of Unique Elements](https://www.internhack.in/learn/dsa/problem/sum-of-unique-elements) (Easy)
56. [Transform Array by Parity](https://www.internhack.in/learn/dsa/problem/transform-array-by-parity) (Easy)
57. [Uncommon Words from Two Sentences](https://www.internhack.in/learn/dsa/problem/uncommon-words-from-two-sentences) (Easy)
58. [X of a Kind in a Deck of Cards](https://www.internhack.in/learn/dsa/problem/x-of-a-kind-in-a-deck-of-cards) (Easy)
59. [3Sum With Multiplicity](https://www.internhack.in/learn/dsa/problem/3sum-with-multiplicity) (Medium)
60. [Apply Operations to Make String Empty](https://www.internhack.in/learn/dsa/problem/apply-operations-to-make-string-empty) (Medium)
61. [Better Compression of String](https://www.internhack.in/learn/dsa/problem/better-compression-of-string) (Medium)
62. [Bulls and Cows](https://www.internhack.in/learn/dsa/problem/bulls-and-cows) (Medium)
63. [Change Minimum Characters to Satisfy One of Three Conditions](https://www.internhack.in/learn/dsa/problem/change-minimum-characters-to-satisfy-one-of-three-conditions) (Medium)
64. [Check If Array Pairs Are Divisible by k](https://www.internhack.in/learn/dsa/problem/check-if-array-pairs-are-divisible-by-k) (Medium)
65. [Check If Two Expression Trees are Equivalent](https://www.internhack.in/learn/dsa/problem/check-if-two-expression-trees-are-equivalent) (Medium)
66. [Construct K Palindrome Strings](https://www.internhack.in/learn/dsa/problem/construct-k-palindrome-strings) (Medium)
67. [Construct String With Repeat Limit](https://www.internhack.in/learn/dsa/problem/construct-string-with-repeat-limit) (Medium)
68. [Count Almost Equal Pairs I](https://www.internhack.in/learn/dsa/problem/count-almost-equal-pairs-i) (Medium)
69. [Count Caesar Cipher Pairs](https://www.internhack.in/learn/dsa/problem/count-caesar-cipher-pairs) (Medium)
70. [Count Nice Pairs in an Array](https://www.internhack.in/learn/dsa/problem/count-nice-pairs-in-an-array) (Medium)
71. [Count Number of Bad Pairs](https://www.internhack.in/learn/dsa/problem/count-number-of-bad-pairs) (Medium)
72. [Count Number of Distinct Integers After Reverse Operations](https://www.internhack.in/learn/dsa/problem/count-number-of-distinct-integers-after-reverse-operations) (Medium)
73. [Count Pairs That Form a Complete Day II](https://www.internhack.in/learn/dsa/problem/count-pairs-that-form-a-complete-day-ii) (Medium)
74. [Count Servers that Communicate](https://www.internhack.in/learn/dsa/problem/count-servers-that-communicate) (Medium)
75. [Count Special Triplets](https://www.internhack.in/learn/dsa/problem/count-special-triplets) (Medium)
76. [Count the Number of Good Subsequences](https://www.internhack.in/learn/dsa/problem/count-the-number-of-good-subsequences) (Medium)
77. [Count Anagrams](https://www.internhack.in/learn/dsa/problem/count-anagrams) (Hard)
78. [Count Array Pairs Divisible by K](https://www.internhack.in/learn/dsa/problem/count-array-pairs-divisible-by-k) (Hard)
79. [Count Pairs Of Nodes](https://www.internhack.in/learn/dsa/problem/count-pairs-of-nodes) (Hard)
80. [Distribute Repeating Integers](https://www.internhack.in/learn/dsa/problem/distribute-repeating-integers) (Hard)
81. [Divide Array Into Increasing Sequences](https://www.internhack.in/learn/dsa/problem/divide-array-into-increasing-sequences) (Hard)
82. [Largest Color Value in a Directed Graph](https://www.internhack.in/learn/dsa/problem/largest-color-value-in-a-directed-graph) (Hard)
83. [Longest Subsequence Repeated k Times](https://www.internhack.in/learn/dsa/problem/longest-subsequence-repeated-k-times) (Hard)
84. [Make the XOR of All Segments Equal to Zero](https://www.internhack.in/learn/dsa/problem/make-the-xor-of-all-segments-equal-to-zero) (Hard)
85. [Maximum Number of Ways to Partition an Array](https://www.internhack.in/learn/dsa/problem/maximum-number-of-ways-to-partition-an-array) (Hard)
86. [Maximum Score Words Formed by Letters](https://www.internhack.in/learn/dsa/problem/maximum-score-words-formed-by-letters) (Hard)
87. [Minimum Cost to Split an Array](https://www.internhack.in/learn/dsa/problem/minimum-cost-to-split-an-array) (Hard)
88. [Minimum Number of Operations to Make String Sorted](https://www.internhack.in/learn/dsa/problem/minimum-number-of-operations-to-make-string-sorted) (Hard)
89. [Minimum Operations to Make Character Frequencies Equal](https://www.internhack.in/learn/dsa/problem/minimum-operations-to-make-character-frequencies-equal) (Hard)
90. [Minimum Swaps to Avoid Forbidden Values](https://www.internhack.in/learn/dsa/problem/minimum-swaps-to-avoid-forbidden-values) (Hard)
91. [Minimum Total Cost to Make Arrays Unequal](https://www.internhack.in/learn/dsa/problem/minimum-total-cost-to-make-arrays-unequal) (Hard)
92. [Number of Different Subsequences GCDs](https://www.internhack.in/learn/dsa/problem/number-of-different-subsequences-gcds) (Hard)
93. [Rearrange String k Distance Apart](https://www.internhack.in/learn/dsa/problem/rearrange-string-k-distance-apart) (Hard)
94. [Sorted GCD Pair Queries](https://www.internhack.in/learn/dsa/problem/sorted-gcd-pair-queries) (Hard)
95. [Subarrays with K Different Integers](https://www.internhack.in/learn/dsa/problem/subarrays-with-k-different-integers) (Hard)
96. [Sum of Perfect Square Ancestors](https://www.internhack.in/learn/dsa/problem/sum-of-perfect-square-ancestors) (Hard)
97. [Sum of Prefix Scores of Strings](https://www.internhack.in/learn/dsa/problem/sum-of-prefix-scores-of-strings) (Hard)
98. [The Number of Good Subsets](https://www.internhack.in/learn/dsa/problem/the-number-of-good-subsets) (Hard)
99. [Threshold Majority Queries](https://www.internhack.in/learn/dsa/problem/threshold-majority-queries) (Hard)
100. [Total Characters in String After Transformations II](https://www.internhack.in/learn/dsa/problem/total-characters-in-string-after-transformations-ii) (Hard)

## Companies that ask counting problems

- [Google](https://www.internhack.in/learn/dsa/companies/google): 69 of these problems
- [Amazon](https://www.internhack.in/learn/dsa/companies/amazon): 47 of these problems
- [Meta](https://www.internhack.in/learn/dsa/companies/meta): 39 of these problems
- [Bloomberg](https://www.internhack.in/learn/dsa/companies/bloomberg): 25 of these problems
- [Microsoft](https://www.internhack.in/learn/dsa/companies/microsoft): 21 of these problems
- [Apple](https://www.internhack.in/learn/dsa/companies/apple): 7 of these problems
- [TCS](https://www.internhack.in/learn/dsa/companies/tcs): 7 of these problems
- [Uber](https://www.internhack.in/learn/dsa/companies/uber): 7 of these problems
- [Adobe](https://www.internhack.in/learn/dsa/companies/adobe): 6 of these problems
- [Oracle](https://www.internhack.in/learn/dsa/companies/oracle): 6 of these problems
- [Goldman Sachs](https://www.internhack.in/learn/dsa/companies/goldman-sachs): 5 of these problems
- [Infosys](https://www.internhack.in/learn/dsa/companies/infosys): 5 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)
- [Binary Tree](https://www.internhack.in/learn/dsa/binary-tree) (169)
- [Stack](https://www.internhack.in/learn/dsa/stack) (167)

## Related

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