Interview's MateSystem Design
Interview's Mate

System Design

Architecture & trade-offs

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
All topics/Geo-Spatial & Location Systems
RELIABILITY, SECURITY & CASE STUDIES · SUBTOPIC

Geohash, Quadtrees & Uber H3

Compare static grids, adaptive trees, and hexagonal spatial indexes.

AdvancedPart of Geo-Spatial & Location Systems
Practice in AI HLD
Subtopics in Geo-Spatial & Location Systems (2)
OverviewGeohash, Quadtree, H3Dispatch & ETA

In plain words

Geohash draws a fixed grid over the world map. A Quadtree splits busy downtown squares into tiny tiles while leaving empty oceans as one huge square. H3 uses hexagons so distance to every neighbor is equal.

Think of it like…

City map squares (Geohash), zooming deeper only in crowded downtown (Quadtree), or a honeycomb grid (H3).

Loading interactive diagram
Loading interactive exercise

Theory & how it works

Why Uber prefers H3 hexagons over squares

On a square grid, diagonal neighbors are √2 ≈ 1.41× farther away from the center than edge neighbors. Every neighbor of a hexagon is the exact same distance from the center - making surge-pricing and radius rings much smoother.

Key points & practical guide

Summary checklist

  • Always search center cell + 8 neighbors (or k-ring in H3) to avoid boundary misses
  • Use Redis GEO / in-memory index for moving vehicles (4s updates)
  • Use Quadtree / PostGIS R-Tree for static businesses

When to use it

  • Ride-hailing, food delivery, nearby friends/places

Watch out for

  • Writing every 4-second GPS ping straight to disk SQL - keep live driver locations in RAM/Redis with a short TTL

Quick check

Loading quiz
Parent topic
Geo-Spatial & Location Systems
Next subtopic
Driver Matching, Dispatch & Live ETA