# Rolling Hash DSA Problems

> 29 Rolling Hash 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/rolling-hash
Last updated: 2026-11-28

29 rolling hash problems for coding interviews and campus placements, with hints and company tags. Below are all 29: 1 easy, 14 medium and 14 hard. Practise them free on InternHack and track what you have solved.

## Rolling Hash problems, easiest first

1. [Count Prefix and Suffix Pairs I](https://www.internhack.in/learn/dsa/problem/count-prefix-and-suffix-pairs-i) (Easy)
2. [Check If a String Contains All Binary Codes of Size K](https://www.internhack.in/learn/dsa/problem/check-if-a-string-contains-all-binary-codes-of-size-k) (Medium)
3. [Count Cells in Overlapping Horizontal and Vertical Substrings](https://www.internhack.in/learn/dsa/problem/count-cells-in-overlapping-horizontal-and-vertical-substrings) (Medium)
4. [Find Beautiful Indices in the Given Array I](https://www.internhack.in/learn/dsa/problem/find-beautiful-indices-in-the-given-array-i) (Medium)
5. [Find Pattern in Infinite Stream I](https://www.internhack.in/learn/dsa/problem/find-pattern-in-infinite-stream-i) (Medium)
6. [K Divisible Elements Subarrays](https://www.internhack.in/learn/dsa/problem/k-divisible-elements-subarrays) (Medium)
7. [Longest Repeating Substring](https://www.internhack.in/learn/dsa/problem/longest-repeating-substring) (Medium)
8. [Maximum Length of Repeated Subarray](https://www.internhack.in/learn/dsa/problem/maximum-length-of-repeated-subarray) (Medium)
9. [Minimum Number of Valid Strings to Form Target I](https://www.internhack.in/learn/dsa/problem/minimum-number-of-valid-strings-to-form-target-i) (Medium)
10. [Minimum Time to Revert Word to Initial State I](https://www.internhack.in/learn/dsa/problem/minimum-time-to-revert-word-to-initial-state-i) (Medium)
11. [Number of Distinct Substrings in a String](https://www.internhack.in/learn/dsa/problem/number-of-distinct-substrings-in-a-string) (Medium)
12. [Number of Subarrays That Match a Pattern I](https://www.internhack.in/learn/dsa/problem/number-of-subarrays-that-match-a-pattern-i) (Medium)
13. [Repeated DNA Sequences](https://www.internhack.in/learn/dsa/problem/repeated-dna-sequences) (Medium)
14. [Strings Differ by One Character](https://www.internhack.in/learn/dsa/problem/strings-differ-by-one-character) (Medium)
15. [Unique Substrings With Equal Digit Frequency](https://www.internhack.in/learn/dsa/problem/unique-substrings-with-equal-digit-frequency) (Medium)
16. [Count Prefix and Suffix Pairs II](https://www.internhack.in/learn/dsa/problem/count-prefix-and-suffix-pairs-ii) (Hard)
17. [Distinct Echo Substrings](https://www.internhack.in/learn/dsa/problem/distinct-echo-substrings) (Hard)
18. [Find Beautiful Indices in the Given Array II](https://www.internhack.in/learn/dsa/problem/find-beautiful-indices-in-the-given-array-ii) (Hard)
19. [Find Pattern in Infinite Stream II](https://www.internhack.in/learn/dsa/problem/find-pattern-in-infinite-stream-ii) (Hard)
20. [Find Substring With Given Hash Value](https://www.internhack.in/learn/dsa/problem/find-substring-with-given-hash-value) (Hard)
21. [Longest Chunked Palindrome Decomposition](https://www.internhack.in/learn/dsa/problem/longest-chunked-palindrome-decomposition) (Hard)
22. [Longest Common Subpath](https://www.internhack.in/learn/dsa/problem/longest-common-subpath) (Hard)
23. [Longest Duplicate Substring](https://www.internhack.in/learn/dsa/problem/longest-duplicate-substring) (Hard)
24. [Longest Happy Prefix](https://www.internhack.in/learn/dsa/problem/longest-happy-prefix) (Hard)
25. [Maximum Deletions on a String](https://www.internhack.in/learn/dsa/problem/maximum-deletions-on-a-string) (Hard)
26. [Minimum Time to Revert Word to Initial State II](https://www.internhack.in/learn/dsa/problem/minimum-time-to-revert-word-to-initial-state-ii) (Hard)
27. [Number of Subarrays That Match a Pattern II](https://www.internhack.in/learn/dsa/problem/number-of-subarrays-that-match-a-pattern-ii) (Hard)
28. [Shortest Palindrome](https://www.internhack.in/learn/dsa/problem/shortest-palindrome) (Hard)
29. [Sum of Scores of Built Strings](https://www.internhack.in/learn/dsa/problem/sum-of-scores-of-built-strings) (Hard)

## Companies that ask rolling hash problems

- [Google](https://www.internhack.in/learn/dsa/companies/google): 15 of these problems
- [Amazon](https://www.internhack.in/learn/dsa/companies/amazon): 10 of these problems
- [Bloomberg](https://www.internhack.in/learn/dsa/companies/bloomberg): 8 of these problems
- [Meta](https://www.internhack.in/learn/dsa/companies/meta): 7 of these problems
- [Uber](https://www.internhack.in/learn/dsa/companies/uber): 7 of these problems
- [Microsoft](https://www.internhack.in/learn/dsa/companies/microsoft): 6 of these problems
- [Autodesk](https://www.internhack.in/learn/dsa/companies/autodesk): 4 of these problems
- [Capital ONE](https://www.internhack.in/learn/dsa/companies/capital-one): 3 of these problems
- [Palantir Technologies](https://www.internhack.in/learn/dsa/companies/palantir-technologies): 3 of these problems
- [Coupang](https://www.internhack.in/learn/dsa/companies/coupang): 2 of these problems
- [Tiktok](https://www.internhack.in/learn/dsa/companies/tiktok): 2 of these problems
- [Sprinklr](https://www.internhack.in/learn/dsa/companies/sprinklr): 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)
