Geofencing service

DesignHard45 minUber style

Your task

Design a geofencing service that evaluates 2M device location updates per second against 10M active geofences (arbitrary polygons, some overlapping) and emits enter/exit/dwell events with under 1s latency. Geofences are created/deleted dynamically by tenants. Walk through the spatial index, the enter/exit state machine, and how you keep per-device fence membership consistent.

It covers

  • Polygon search
  • Events
  • Real time