Design Problems/Nearby Friends

Nearby Friends

Hard
Real-timeWebSocketGeospatialPub/Sub

High-Level Architecture

Rendering diagram...

Design a real-time feature that shows users which of their friends are currently nearby. The system must continuously track opted-in users' locations and notify them when friends come within a configurable radius, showing the friend's approximate distance and last update time.