Hash Function DSA Problems

38 hash function problems for coding interviews and campus placements, with hints and company tags. Below are all 38: 4 easy, 17 medium and 17 hard. Practise them free on InternHack and track what you have solved.

Hash Function problems, easiest first

  1. Count Prefix and Suffix Pairs I (Easy)
  2. Design HashMap (Easy)
  3. Design HashSet (Easy)
  4. Subtree of Another Tree (Easy)
  5. Check If a String Contains All Binary Codes of Size K (Medium)
  6. Count Cells in Overlapping Horizontal and Vertical Substrings (Medium)
  7. Encode and Decode TinyURL (Medium)
  8. Equalize Strings by Adding or Removing Characters at Ends (Medium)
  9. Find Beautiful Indices in the Given Array I (Medium)
  10. Find Pattern in Infinite Stream I (Medium)
  11. K Divisible Elements Subarrays (Medium)
  12. Longest Repeating Substring (Medium)
  13. Maximum Length of Repeated Subarray (Medium)
  14. Minimum Number of Valid Strings to Form Target I (Medium)
  15. Minimum Time to Revert Word to Initial State I (Medium)
  16. Number of Distinct Islands (Medium)
  17. Number of Distinct Substrings in a String (Medium)
  18. Number of Subarrays That Match a Pattern I (Medium)
  19. Repeated DNA Sequences (Medium)
  20. Strings Differ by One Character (Medium)
  21. Unique Substrings With Equal Digit Frequency (Medium)
  22. Check if DFS Strings Are Palindromes (Hard)
  23. Count Prefix and Suffix Pairs II (Hard)
  24. Delete Duplicate Folders in System (Hard)
  25. Distinct Echo Substrings (Hard)
  26. Find Beautiful Indices in the Given Array II (Hard)
  27. Find Pattern in Infinite Stream II (Hard)
  28. Find Substring With Given Hash Value (Hard)
  29. Longest Chunked Palindrome Decomposition (Hard)
  30. Longest Common Subpath (Hard)
  31. Longest Duplicate Substring (Hard)
  32. Longest Happy Prefix (Hard)
  33. Maximum Deletions on a String (Hard)
  34. Minimum Time to Revert Word to Initial State II (Hard)
  35. Number of Distinct Islands II (Hard)
  36. Number of Subarrays That Match a Pattern II (Hard)
  37. Shortest Palindrome (Hard)
  38. Sum of Scores of Built Strings (Hard)

Companies that ask hash function problems

Before your interview

Most resumes are filtered by software before a recruiter reads them. Check your resume ATS score free, no signup needed.

Other DSA topics