
You are designing a proximity-based people discovery system for a social app, similar to a nearby friends surface. When a user opens the map or nearby tab, the system should surface a ranked list of relevant people who are physically close, while respecting privacy settings, safety constraints, and user intent. The product is valuable only if results are fresh, accurate, and personalized, since stale or irrelevant suggestions quickly erode trust. The system should support both explicit friend discovery and lightweight social serendipity.
| Signal | Value |
|---|---|
| DAU using nearby surface | 45M |
| Peak QPS | 350K |
| Concurrent location updates/sec | 2.5M |
| Users sharing live location at peak | 120M |
| Candidate users within coarse radius | 500-5,000 per request |
| Per-request latency budget (p99) | 150ms |
How would you design this end-to-end ML system so it can retrieve, rank, and serve nearby people in real time at this scale while balancing relevance, freshness, privacy, and reliability?