Code RoomGeofence breach detection
HardPrep Room Coding #3518

Geofence breach detection

System designDatabases & SQLSenior–Staff~50 min

Design a geofence breach-detection service for 10 million devices, each reporting location every few seconds, evaluated against up to 50 million user-defined geofences (circles and polygons) that can be created or deleted at any time. When a device crosses into or out of any fence it subscribes to, you must fire an enter/exit event within ~5 seconds, exactly once per real crossing — no duplicate alerts on jittery GPS. Describe the spatial indexing, how you evaluate a location against only the relevant fences, debouncing, and exactly-once event semantics.

What a strong answer looks like

Clarify scale and constraints first. Propose a clean component breakdown, then go deep on the hard parts (data model, bottlenecks, consistency, failure modes) and name the trade-offs you are making.

Clarify5:30 left
Estimate5:30 planned
Design16:30 planned
Deep dive13:30 planned
Failure9:00 planned
0:00
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.