Build your own Hash Table
An open-addressing hash table in C with insert, search, delete and resizing.
- Intro
- About 3–6 h
- 4 checkpoints
- 1 tutorial · C
Pick a tutorial, then check yourself at each checkpoint. Work in any language you like.
Choose a tutorialWhy build it
Hash tables power dictionaries, caches and indexes. Writing one shows where O(1) comes from and what collisions and load factors cost.
You will be able to
- Design a hash function and resolve collisions with open addressing.
- Delete entries with tombstones.
- Resize when the load factor crosses a threshold.
- Benchmark against a built-in map.
Skills it exercises
Recommended on Data Structures & Algorithms.
How you know you are there
Work in any language. Each checkpoint ends with something you can run or observe, so you can check it yourself.
- Checkpoint 1Self-check
Insert and search
Done when: Insert and lookup work for 10,000 random keys, checked against a reference map.
- Checkpoint 2Self-check
Collisions
Done when: Double hashing or linear probing handles collisions, and a test with deliberately colliding keys passes.
- Checkpoint 3Self-check
Delete
Done when: Deleted entries leave tombstones so that later lookups still succeed.
- Checkpoint 4Self-check
Resize
Done when: The table grows and shrinks with its load factor, and a benchmark shows lookup time staying flat as it grows.
Stretch goals
- Separate chaining, and a comparison with open addressing.
- Robin Hood hashing.
Step-by-step guides
Pick one in a language you know (tutorial languages: C). They open on the author’s site.
- C
Learn how to write a hash table in C(external site)
C: a complete open-addressing hash table in short chapters.
Practice builds are self-paced: Tech Atlas does not track them or count them as evidence. To show a skill, take its knowledge check from the skill page.
Tutorials come from codecrafters-io/build-your-own-x (CC0, snapshot of 2026-07-14, commit aa17439; links checked on 2026-10-19). Each tutorial belongs to its author and keeps its own licence; Tech Atlas links to it and does not host it. Briefs, checkpoints and the mapping to skills are Tech Atlas editorial drafts.