Build challenges · 4 steps · javascript · python
Hash Map
Construct a high-performance hash map with bucket arrays, modular hashing, collision chaining, and dynamic rehashing.
How do hash tables achieve average $O(1)$ lookups and insertions across millions of items?
In this build, you will construct a Hash Map from raw bucket arrays. You will:
- Implement bucket indexing and polynomial string hashing.
- Resolve hash collisions using separate chaining.
- Implement $O(1)$ key deletion and iteration.
- Add dynamic load-factor rehashing to prevent performance degradation as the table fills up.
The workspace
These files carry across every step. What you write in one step is what you start the next with.
- hash_map.js
- harness.jsread-only
Steps · 0 of 4 done
Start anywhere. Open step 3 first and you are handed the reference build of steps 1 and 2, so every step stands on its own. Nothing here is locked behind anything else.
This build applies Hash Maps, Arrays & Traversal and Caching. Read the lesson first if it is unfamiliar — a recommendation, not a prerequisite.