You are asked a “knowledge check” about hash maps (hash tables).
Discuss how a typical in-memory hash map works and how you would reason about these edge cases:
-
Collision handling strategies and their trade-offs.
-
Load factor, resizing/rehashing, and amortized complexity.
-
Handling deletions (especially in open addressing).
-
Worst-case behavior and how to mitigate it.
-
Iteration order and how it can change.
-
Concurrency concerns (reads/writes) and common approaches to thread safety.
Assume a general-purpose language runtime hash map (e.g., Java/C++-like), not a distributed store.