Design APIs for nearby search (POIs, friends), geospatial queries, and geofenced notifications. Location writes are frequent; reads need fresh indexes.
Functional requirements
- Store and update user or device locations
- Query nearby entities within radius
- Define geofences and trigger entry/exit events
- Privacy controls and coarse location modes
Non-functional requirements
- High write throughput for location pings
- Low-latency spatial queries
- Efficient indexing (geohash, quadtree, S2)