System Design · interactive
Bloom filters
A Bloom filter answers “have I seen this?” using a few bits per item instead of storing the items. It can say “no” for sure, and “probably yes” with a small chance of being wrong. 24 bits, 3 hash functions.
24 bits · 13 set
- 10
- 11
- 02
- 03
- 14
- 05
- 06
- 17
- 18
- 09
- 110
- 011
- 012
- 013
- 114
- 115
- 016
- 117
- 118
- 019
- 120
- 121
- 022
- 123
- alice → 20, 7, 10
- bob → 15, 4, 21
- carol → 17, 18, 23
- dave → 14, 15, 8
- erin → 0, 1, 14
check("zoe") → bits 14, 9, 0: 1, 0, 1
Definitely not added
Definitely not added
Check a name
Names added
Expected false-positive rate with 5: 10.0%
1 2 Hash the item the same way and look at those bits.
bits 14, 9, 0
3 4
In production
Tools and technologies
Bloom filters sit in front of slow lookups in databases, caches and browsers.
Not tied to one language — use these names when you search docs or design a system.