Algorithms from zero
Hashing: interview drill
You understand hashing. Interviews test whether you can reach for a hash map under a timer, cold, and explain the cost out loud.
Solve each problem before you reveal a hint, hit the target time, and narrate the time and space complexity as if an interviewer were listening. The hints exist for when you are genuinely stuck — they nudge you toward the pattern, never the full solution.
Six NeetCode-150 problems on the arrays-and-hashing pattern this unit teaches. Set a timer, solve each cold without looking at a hint, then say the time and space complexity out loud before you move on. Reveal a hint only when you are truly stuck — the hints nudge, they never hand you the answer.
0/6 solved
arrays hashing
Follow-up (aloud)
Narrate why this is O(n) time and O(n) space, and what changes if the array were already sorted.
Follow-up (aloud)
When is a fixed 26-length array strictly better than a hash map here, and how would Unicode input break that assumption?
Follow-up (aloud)
Compare the two key choices: sorting each word is O(k log k), the count signature is O(k). Why might you still prefer sorting?
Follow-up (aloud)
State the time complexity of the heap approach versus the bucket approach, and when the heap is actually the smarter choice.
Follow-up (aloud)
Why is this O(1) time and space for a fixed 9×9 board, and how would the bound read if the board were n×n?
Follow-up (aloud)
Defend the O(n) claim: the inner while loop looks nested, so why is the total work still linear?
Mark each problem solved once you finished it cold, inside the target time, and could state the complexity without hesitation. Come back in a few days and re-solve the ones you marked — spaced revisits are what turn a recognised pattern into a reflex.