Coding & Algorithms (DSA)
Hashing
6 practice questions. Free questions open a full answer guide; the rest unlock with Pro.
- When would you reach for a hash set or hash map to solve an array problem, and what does it buy you over scanning?
- Why does using a hash map turn the two-sum problem from O(n^2) into O(n), and what does that cost you?Go Pro
- A hash map is often described as O(1) for lookups. Is that always true, and what's actually happening under the hood?Go Pro
- When you're designing a hash map keyed on a custom object, what properties does the key's hash and equality need to satisfy for correctness, and what goes wrong if a key is mutated after insertion?Go Pro
- Two engineers debate whether to use a hash-based set/map or a tree-based (sorted) one for a hot lookup path. How would you decide between them, and when is the 'obvious' O(1) hash choice the wrong one?Go Pro
- How would you group a large list of words into sets of anagrams efficiently, and what makes a good hash key for that?Go Pro
Want questions matched to your role? Paste a job title, job description, or CV for a personalized set, or go Pro to unlock the full bank.