DSAWiser

DSA question set · 180 questions

Hash Table DSA Practice Questions

Explore 180 DSA questions in Hash Table. Practice with DSAWiser’s code editor and visualizer.

Hash TableMathArraysGeometryStringsSortingSliding WindowDynamic ProgrammingPrefix SumMatrixGraphDesignTreeUnion FindTrie

What’s in this set

The Hash Table collection contains 180 problems: 50 basic, 50 easy, 35 medium, 25 hard, 20 very hard. Choose a question at your current level, or follow the collection’s order below.

Topics in this collection include Hash Table, Math, Arrays, Geometry, Strings. Each question shows its own topics and difficulty so you can decide where to begin.

Practice with the code visualizer

  1. Open a question in the editor and read the statement, inputs, and expected output. Predict the result for a small example before writing code.
  2. Write a solution and run the examples. If a result differs from your prediction, reduce the input until you can follow each step.
  3. Step through your code in the visualizer. Use a breakpoint to inspect the state at a specific line, then compare it with your reasoning.

Questions in this set

180 total

Open a question in the editor to read its statement and examples. Sign in to practice.

  1. Compute Hash Index (Division Method)Hash Table · MathBasic
  2. Direct Address Table PresenceHash Table · ArraysBasic
  3. Chaining Bucket IdentificationHash Table · Arrays · MathBasic
  4. Linear Probing Next Empty SlotHash Table · GeometryBasic
  5. Key-Value Pair LookupHash TableBasic
  6. String Hash by Character SumHash Table · StringsBasic
  7. Count Collisions in Table BucketsHash Table · Arrays · MathBasic
  8. Hash Set Size (Unique Element Count)Hash Table · ArraysBasic
  9. Single Character Frequency LookupHash Table · StringsBasic
  10. Check Key Existence (Contains Key)Hash Table · ArraysBasic
  11. Hash Table Load FactorHash Table · MathBasic
  12. Maximum Character FrequencyHash Table · StringsBasic
  13. Separate Chaining Bucket SizeHash Table · Arrays · MathBasic
  14. Quadratic Probing Next Empty SlotHash TableBasic
  15. Check for Duplicate ElementsHash Table · ArraysBasic
  16. First Repeating ElementHash Table · ArraysBasic
  17. Count Unique Characters in StringHash Table · StringsBasic
  18. Maximum Bucket Length (Longest Chain)Hash Table · Arrays · MathBasic
  19. Double Hashing Probe PositionsHash Table · MathBasic
  20. Frequency of an Integer QueryHash Table · ArraysBasic
  21. Count Empty BucketsHash Table · Arrays · MathBasic
  22. First Non-Repeating CharacterHash Table · StringsBasic
  23. Count Elements in A Not in BHash Table · ArraysBasic
  24. Multiplication Hash MethodHash Table · MathBasic
  25. Check Disjoint SetsHash Table · ArraysBasic
  26. Hash Set Intersection SizeHash Table · ArraysBasic
  27. Hash Set Union SizeHash Table · ArraysBasic
  28. Hash Table Rehashing SimulationHash Table · Arrays · MathBasic
  29. Count Elements with Given FrequencyHash Table · ArraysBasic
  30. Linear Probing Search Probe CountHash Table · Geometry · MathBasic
  31. Map Insert or OverwriteHash TableBasic
  32. Count Elements Appearing More Than OnceHash Table · ArraysBasic
  33. Sum of Unique ElementsHash Table · ArraysBasic
  34. Minimum Character FrequencyHash Table · StringsBasic
  35. Slot Status in Open Addressing (Tombstones)Hash TableBasic
  36. Check Subset RelationHash Table · ArraysBasic
  37. Flat Index Hash for 2D GridHash TableBasic
  38. Unique Character Frequencies CheckHash Table · StringsBasic
  39. Most Frequent Integer (Smallest on Tie)Hash Table · Arrays · SortingBasic
  40. Simulate Hash Set OperationsHash TableBasic
  41. Multiset Overlap CountHash Table · ArraysBasic
  42. Symmetric Pair Hash (XOR Modulo)Hash TableBasic
  43. Count Elements with Odd FrequenciesHash Table · ArraysBasic
  44. Hash Table Bucket Occupancy PercentageHash Table · Arrays · MathBasic
  45. Character Frequency Equality (Anagram Check)Hash TableBasic
  46. First Repeating CharacterHash Table · StringsBasic
  47. Keys with Values Exceeding ThresholdHash TableBasic
  48. Check Permutation of 1 to NHash Table · ArraysBasic
  49. Maximum Cluster Size in Open AddressingHash TableBasic
  50. Missing Number in Range 0 to NHash Table · ArraysBasic
  51. Two Sum (Target Pair Existence)Hash Table · ArraysEasy
  52. Jewels and StonesHash TableEasy
  53. Ransom Note ConstructionHash TableEasy
  54. Isomorphic StringsHash Table · StringsEasy
  55. Intersection of Two Arrays (Unique Elements)Hash Table · ArraysEasy
  56. Word PatternHash Table · StringsEasy
  57. Happy Number (Cycle Detection via Set)Hash TableEasy
  58. Index of First Unique CharacterHash Table · StringsEasy
  59. Majority Element (Frequency > N/2)Hash Table · ArraysEasy
  60. Contains Duplicate II (Within Window Distance K)Hash Table · Arrays · Sliding WindowEasy
  61. Longest Palindrome Length from CharactersHash Table · Strings · Dynamic ProgrammingEasy
  62. Find All DuplicatesHash Table · ArraysEasy
  63. Distribute CandiesHash Table · ArraysEasy
  64. Divide Array into Equal PairsHash Table · ArraysEasy
  65. Words on a Single Keyboard RowHash Table · StringsEasy
  66. Smallest Subarray with Same DegreeHash Table · Arrays · Prefix SumEasy
  67. Set Mismatch (Duplicate and Missing Number)Hash Table · ArraysEasy
  68. Common Characters Across All StringsHash Table · StringsEasy
  69. Sort Array by FrequencyHash Table · Arrays · SortingEasy
  70. Subarray with Zero Sum ExistenceHash Table · Arrays · Prefix SumEasy
  71. Total Length of Words Formable by CharactersHash Table · StringsEasy
  72. Count Pairs with Absolute Difference KHash Table · ArraysEasy
  73. Custom Sort String by Specified OrderHash Table · Strings · SortingEasy
  74. Number of Good Pairs (Equal Values)Hash Table · ArraysEasy
  75. Check PangramHash Table · StringsEasy
  76. K-th Distinct String in an ArrayHash Table · StringsEasy
  77. Intersection of Multiple ArraysHash Table · ArraysEasy
  78. Unique Number of OccurrencesHash Table · ArraysEasy
  79. Missing and Repeated Values in GridHash Table · MatrixEasy
  80. Destination CityHash TableEasy
  81. Find the Added CharacterHash Table · StringsEasy
  82. Most Frequent Even ElementHash Table · Arrays · SortingEasy
  83. Buddy Strings (Single Swap Equality)Hash Table · StringsEasy
  84. Maximum Pairs Formed and LeftoversHash Table · ArraysEasy
  85. Minimum Steps to Make Two Strings AnagramsHash Table · StringsEasy
  86. All Characters Minimum Frequency KHash Table · StringsEasy
  87. Target Pair Across Two ArraysHash Table · ArraysEasy
  88. Subarray with Given Sum ExistenceHash Table · Arrays · Prefix SumEasy
  89. Missing Numbers in Range [L, R]Hash Table · ArraysEasy
  90. Palindrome PermutationHash Table · Strings · Dynamic ProgrammingEasy
  91. Uncommon Words from Two SentencesHash Table · StringsEasy
  92. Array Pairs Divisible by KHash Table · ArraysEasy
  93. Tic-Tac-Toe Line TrackerHash Table · GeometryEasy
  94. Relative Sort ArrayHash Table · Arrays · SortingEasy
  95. Path Crossing DetectionHash Table · StringsEasy
  96. Divide Array into Sets of K Consecutive NumbersHash Table · ArraysEasy
  97. Find the Town JudgeHash Table · GraphEasy
  98. Check Valid Matrix Rows and ColumnsHash Table · MatrixEasy
  99. Roman Numeral to IntegerHash Table · StringsEasy
  100. Longest Harmonious SubsequenceHash Table · ArraysEasy
  101. Group AnagramsHash Table · StringsMedium
  102. Subarray Sum Equals KHash Table · Arrays · Prefix SumMedium
  103. Longest Consecutive SequenceHash Table · ArraysMedium
  104. Contiguous Array with Equal 0s and 1sHash Table · ArraysMedium
  105. 4Sum II (Count Tuples with Zero Sum)Hash Table · ArraysMedium
  106. Top K Frequent ElementsHash Table · Arrays · SortingMedium
  107. Subarray Sums Divisible by KHash Table · Arrays · Prefix SumMedium
  108. Group Shifted StringsHash Table · StringsMedium
  109. Find All Anagram Start IndicesHash Table · Strings · Sliding WindowMedium
  110. O(1) Collection with Swap-to-Last DeletionHash TableMedium
  111. Brick Wall (Least Crossed Bricks)Hash TableMedium
  112. Longest Subarray with Sum KHash Table · Arrays · Prefix SumMedium
  113. Continuous Subarray Sum Multiple of KHash Table · Arrays · Prefix SumMedium
  114. Pairs of Songs Divisible by 60Hash TableMedium
  115. Count Number of Bad PairsHash Table · ArraysMedium
  116. Subdomain Visit CountHash TableMedium
  117. Fraction to Recurring DecimalHash TableMedium
  118. Minimum Area of Axis-Aligned RectangleHash Table · GeometryMedium
  119. Maximum Points on a LineHash Table · GeometryMedium
  120. Time-Based Key-Value StoreHash TableMedium
  121. Least Recently Used (LRU) Cache SimulationHash Table · DesignMedium
  122. Longest Substring Without Repeating CharactersHash Table · Strings · Sliding WindowMedium
  123. Line Reflection of 2D PointsHash Table · GeometryMedium
  124. Number of BoomerangsHash Table · GeometryMedium
  125. Repeated DNA SequencesHash Table · StringsMedium
  126. Top K Frequent WordsHash Table · Strings · SortingMedium
  127. Recover Original Array from Doubled ArrayHash Table · ArraysMedium
  128. Authentication Manager (Token Expiry Tracker)Hash TableMedium
  129. Subarray Sum Divisible by Array LengthHash Table · Arrays · Prefix SumMedium
  130. Longest Subarray with Equal Evens and OddsHash Table · Arrays · Prefix SumMedium
  131. Group Duplicate Files by ContentHash TableMedium
  132. Minimum Deletions for Unique Character FrequenciesHash Table · StringsMedium
  133. All Binary Codes of Size K ExistenceHash Table · StringsMedium
  134. Longest Substring with At Most K Distinct CharactersHash Table · Strings · Sliding WindowMedium
  135. Longest Well-Performing IntervalHash TableMedium
  136. Least Frequently Used (LFU) CacheHash Table · Sorting · DesignHard
  137. Substring with Concatenation of All WordsHash Table · Strings · Sliding WindowHard
  138. Number of Submatrices That Sum to TargetHash Table · MatrixHard
  139. Frequency Bucket Map with Lexicographic ExtremesHash Table · Sorting · MathHard
  140. Minimum Area of Arbitrary / Rotated RectangleHash Table · GeometryHard
  141. O(1) Collection with Duplicates (Randomized Collection)Hash TableHard
  142. Longest Duplicate SubstringHash Table · Strings · Sliding WindowHard
  143. Distinct Echo SubstringsHash Table · Strings · Sliding WindowHard
  144. Count Subarrays with Median KHash Table · Arrays · Prefix Sum · Dynamic ProgrammingHard
  145. Longest Substring with Even Counts of All VowelsHash Table · Strings · Sliding WindowHard
  146. Subarrays with Exactly K Different IntegersHash Table · Arrays · Prefix SumHard
  147. Shortest Palindrome by Prepending CharactersHash Table · Strings · Dynamic ProgrammingHard
  148. Palindrome PairsHash Table · Strings · Dynamic ProgrammingHard
  149. Maximum Collinear Points with DuplicatesHash Table · GeometryHard
  150. Shortest Word Transformation Sequence CountHash Table · GraphHard
  151. Minimum Window SubstringHash Table · Strings · Sliding WindowHard
  152. Maximum Sum Rectangle No Larger Than KHash Table · Matrix · GeometryHard
  153. Longest Chunked Palindrome DecompositionHash Table · Strings · Dynamic ProgrammingHard
  154. Split Array with Equal Average (Meet-in-the-Middle)Hash Table · ArraysHard
  155. Total Count of Distinct SubstringsHash Table · Strings · Sliding WindowHard
  156. Maximum Frequency Stack (FreqStack)Hash Table · DesignHard
  157. Naming a Company (Distinct Prefix-Suffix Grouping)Hash Table · Strings · Prefix SumHard
  158. Word Pattern II (Bijection with Substrings)Hash Table · Strings · Sliding WindowHard
  159. Longest Common Subpath Across Multiple PathsHash TableHard
  160. Substrings Differing by Exactly One CharacterHash Table · Strings · Sliding WindowHard
  161. FKS Two-Level Perfect Hashing SimulationHash Table · Arrays · MathVery hard
  162. Cuckoo Hashing Simulation with Cycle DetectionHash Table · Arrays · MathVery hard
  163. 2D Matrix Pattern Matching via 2D Rolling HashHash Table · Strings · MatrixVery hard
  164. Subarray Multiset Equality via Zobrist HashingHash Table · Arrays · Prefix Sum · MathVery hard
  165. Tree Isomorphism via Merkle Subtree HashingHash Table · Graph · Tree · MathVery hard
  166. Count Subarrays with Even Frequencies (Exact Parity States)Hash Table · Arrays · Prefix Sum · Dynamic ProgrammingVery hard
  167. Longest Repeating Non-Overlapping SubstringHash Table · Strings · Sliding WindowVery hard
  168. Subtree Isomorphism CountingHash Table · Graph · TreeVery hard
  169. Alien Dictionary with Complete Cycle & Prefix VerificationHash Table · Strings · Prefix Sum · GraphVery hard
  170. Robin Hood Hashing with Backward Shift DeletionHash Table · MathVery hard
  171. Three-Palindrome Partitioning via Rolling HashHash Table · Strings · Dynamic ProgrammingVery hard
  172. Subarrays with Sum Divisible by Their Own LengthHash Table · Arrays · Prefix SumVery hard
  173. De Bruijn Sequence GenerationHash Table · GraphVery hard
  174. Path Sum on a Tree via Prefix Sum BacktrackingHash Table · Prefix Sum · Graph · TreeVery hard
  175. Substring Matching with At Most K MismatchesHash Table · Strings · Sliding WindowVery hard
  176. Maximum Prefix with Removable Element for Equal FrequenciesHash Table · Arrays · Prefix SumVery hard
  177. Count Good Paths in a Tree via Component Value MapsHash Table · Graph · Tree · Union FindVery hard
  178. Count Subarrays with XOR Less Than KHash Table · Arrays · Prefix Sum · TrieVery hard
  179. Distinct Subsequences of a String Modulo 10^9 + 7Hash Table · Strings · Dynamic ProgrammingVery hard
  180. Longest Palindromic Substring LengthHash Table · Strings · Sliding WindowVery hard