How it works
Hashing and collisions
A hash function maps keys to buckets; collisions are resolved by chaining or probing.
Complexity
Average operations are O(1), but a bad hash or heavy collisions can degrade to O(n).
Interview uses
Hash maps power frequency counts, lookups, deduplication, and caching patterns.