Geohashing
maang.io System Design Series
Geohashing interleaves the bits of latitude and longitude and base32-encodes them into a short string, so that points close together share a long common prefix. That single property turns "find nearby" into a cheap prefix query on an ordinary database index — which is how Redis GEO and countless proximity-search systems work under the hood.
This deep dive comes in three parts:
- Foundations & Core Concepts — bit interleaving, base32 encoding, and prefix-as-proximity.
- Internals — precision vs string length, the boundary problem and neighbour cells, with worked numbers.
- Interview — Staff/Principal Q&A: proximity search at scale and the trade-offs vs quadtrees.