🚀 Phases 1–5 are live — Days 1–17 cover the foundations and the algorithmic patterns. See the roadmap →
Day 8 - Hash Tables and Hash FunctionsPractice QuestionsOverview

Hash Map Practice Questions

Ten interview problems that all collapse to the same idea: “if I knew whether I’d seen this before, the answer would be one line.” The hash map is what makes “knowing” O(1).

Two related problems live in earlier chapters: Two Sum (which is the canonical example) and Top K Frequent Elements (which combines a counter with a heap). Same pattern, different angles.

Easy

ProblemPatternStatus
Contains DuplicateSeen-setAvailable
Valid AnagramFrequency comparisonAvailable
First Unique Character in a StringFrequency countAvailable
Intersection of Two ArraysSet intersectionAvailable
Happy NumberCycle detection via setAvailable

Medium

ProblemPatternStatus
Group AnagramsSignature → bucketAvailable
Longest Substring Without Repeating CharactersSliding window + last-seenAvailable
Subarray Sum Equals KPrefix-sum + count mapAvailable
Insert Delete GetRandom O(1)HashMap + array swap-and-popAvailable
LRU CacheHashMap + doubly linked listAvailable

More Practice (Coming Soon)

ProblemPatternStatus
Isomorphic StringsBijection via two mapsComing Soon
Word PatternBijection by characterComing Soon
Longest Consecutive SequenceHash set + smart startsComing Soon
Top K Frequent WordsCounter + heap + tie-breakComing Soon
Substring with Concatenation of All WordsSliding window + counterComing Soon
Find All Anagrams in a StringSliding-window counterComing Soon
Daily TemperaturesMonotonic stack + lookupComing Soon
Design TwitterHashMap + heap-of-listsComing Soon
LFU CacheHashMap + frequency bucketsComing Soon