Pattern · Hash Table

Hash Table interview questions

410 hash table problems tagged across recent interview reports. Drilled most heavily by google, amazon, and meta.

Founder's read

Hash tables power 410 interview problems across every major tech company. Google, Amazon, Meta, and Oracle drill them relentlessly because hash-based solutions separate candidates who think in O(1) lookups from those who don't. You'll see hash tables embedded in two-pass algorithms, frequency counting, caching, collision detection, and constraint satisfaction. If a hash table problem lands in your live OA and you blank on the approach, StealthCoder reads the problem and delivers the solution in seconds, invisible to the proctor.

Most-asked hash table problems

#ProblemDiff# Companies
01Copy List with Random PointerMEDIUM21
02Contains DuplicateEASY19
03Clone GraphMEDIUM14
04Construct Binary Tree from Preorder and Inorder TraversalMEDIUM12
05All Nodes Distance K in Binary TreeMEDIUM10
06Bus RoutesHARD9
07Contains Duplicate IIEASY9
08Accounts MergeMEDIUM8
09Amount of Time for Binary Tree to Be InfectedMEDIUM8
10All O`one Data StructureHARD5
11Analyze User Website Visit PatternMEDIUM4
12Binary Tree Vertical Order TraversalMEDIUM4
13Construct Binary Tree from Inorder and Postorder TraversalMEDIUM4
14Bulls and CowsMEDIUM3
15Check if Every Row and Column Contains All NumbersEASY3
16Check Whether Two Strings are Almost EquivalentEASY3
17Cinema Seat AllocationMEDIUM3
18Add Bold Tag in StringMEDIUM2
19Alert Using Same Key-Card Three or More Times in a One Hour PeriodMEDIUM2
20Basic Calculator IVHARD2
21Brick WallMEDIUM2
22Buddy StringsEASY2
23Check If Array Pairs Are Divisible by kMEDIUM2
24Check if Number Has Equal Digit Count and Digit ValueEASY2
25Check if the Sentence Is PangramEASY2
26Construct String With Repeat LimitMEDIUM2
27Continuous Subarray SumMEDIUM2
28Count Elements With Maximum FrequencyEASY2
29Count Good MealsMEDIUM2
30Count Largest GroupEASY2
313Sum With MultiplicityMEDIUM1
32Add Edges to Make Degrees of All Nodes EvenHARD1
33Apply Operations on Array to Maximize Sum of SquaresHARD1
34Apply Operations to Make String EmptyMEDIUM1
35Apply SubstitutionsMEDIUM1
36Avoid Flood in The CityMEDIUM1
37Better Compression of StringMEDIUM1
38Calculate Score After Performing InstructionsMEDIUM1
39Can Convert String in K MovesMEDIUM1
40Can Make Palindrome from SubstringMEDIUM1
41Check if All Characters Have Equal Number of OccurrencesEASY1
42Check if One String Swap Can Make Strings EqualEASY1
43Check if Strings Can be Made Equal With Operations IIMEDIUM1
44Closest Equal Element QueriesMEDIUM1
45Contiguous ArrayMEDIUM1
46Convert an Array Into a 2D Array With ConditionsMEDIUM1
47Count Almost Equal Pairs IMEDIUM1
48Count AnagramsHARD1
49Count Common Words With One OccurrenceEASY1
50Count Complete SubstringsHARD1

Showing top 50 of 410 hash table problems by # companies asking.

The hedge for the live OA

You can't drill every hash table variant before the assessment. StealthCoder runs invisibly during screen share and solves whichever variant they throw at you. No browser extension. No detection signature. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code.

Get StealthCoder
What this means

Hash table problems fall into four buckets: frequency/counting (group elements by occurrence), deduplication/membership (track what you've seen), collision/pairing (match or exclude based on stored state), and cache/LRU patterns. The tell is always the same: the problem asks you to look up or store data fast, or count overlaps across multiple passes. Recognition matters because a naive brute force often looks correct until test 15 fails on time. Start with frequency maps and two-pass problems like 3sum variants, move to account merging and graph collision detection, then tackle the hard tier (data structures with multiple hash layers). When a variant you didn't drill hits live, StealthCoder is your hedge.

Companies that hire most on hash table

The honest play

410 hash table problems. You won't drill them all. Pass anyway.

Hash Table is one of the patterns interviews actually filter on. Memorizing every variant in a week is a fantasy. StealthCoder is the hedge: an AI overlay invisible during screen share. It reads the problem and surfaces a working solution in under 2 seconds, no matter which hash table flavor lands in your live OA. Built by an Amazon engineer who realized the OA tests how well you memorized 200 problems, not how well you code. Works on HackerRank, CodeSignal, CoderPad, and Karat.

Hash Table interview FAQ

How many hash table problems should I drill before an OA?+

Aim for 30-40 focused problems across frequency, deduplication, and collision types. With 410 total problems tagged, you're sampling 10%. Prioritize problems from Google, Amazon, and Meta first since they weight hash tables heaviest in their assessments.

Is hash table the most important pattern I should learn?+

It's top three. Hash tables appear in 410 problems and are tested by Google (100 problems) and Amazon (93). But they're often combined with trees, arrays, or graphs. Master hash tables first, then learn how to nest them with other patterns.

How do I recognize a hash table problem in 30 seconds?+

Look for: counting or frequency queries, membership tests ("have I seen this?"), collision avoidance, or pairing constraints. If the problem says "find all", "count occurrences", or "group by property", hash table is likely the core tool.

Which company drills hash tables the hardest?+

Google leads with 100 problems tagged hash-table. Amazon follows at 93, Meta at 88. Oracle, Yandex, and Goldman Sachs also test heavily (88, 88, 84 respectively). Hash tables are non-negotiable for all of them.

What's the difference between a hash map and a hash set in interviews?+

Hash set stores unique keys for membership. Hash map stores key-value pairs for lookup and counting. Use a set to track "have I seen this?", use a map to track "how many times" or "what's associated with this?". Both are O(1) average case.

Problem and frequency data sourced from public community-maintained interview-report repos. Problems and trademarks © LeetCode.