YOUR BRIEF
What to work through
Work through nearby friends as a spoken system design interview. Start by clarifying the scope, sketch a working design and explain the trade-offs behind your choices.
- See friends within 5 miles (configurable), with their distance and when it was last updated
- The list refreshes every few seconds
- Friends inactive for 10 minutes drop off the list
- Location history is kept for analytics
BEFORE YOU START
Constraints to discuss
- About 334,000 location updates a second
- Low latency from a friend’s move to my screen
- An occasional lost update is fine
- Eventual consistency: replicas may lag a few seconds
- Highly available
Need a starting point?
Watch for these common gaps as you prepare:
- Sizing pub/sub by memory and missing that CPU needs at least 140 servers
- No TTL on cached locations, so inactive users never drop off
- Pulling every friend’s location from a database on each refresh
- Removing WebSocket servers without draining their connections