Nearby Friends System

Design a Nearby Friends Feature

Design a real-time system for a social media application that allows users to see their friends on a map when they are within a certain proximity (e.g., 5 miles). The system must handle 10 million daily active users, support frequent location updates, and maintain strict privacy boundaries ensuring only mutual friends can see each other. Focus on how you would manage high-write throughput of GPS data and the spatial querying logic required to match friends efficiently at scale.
RedisPostgreSQLWebSocketsGeohashPubSubAPI GatewayKubernetes
10
Read

Nearby Friends System

Design a real-time 'Nearby Friends' feature for a social media application with 10M DAU. The system must allow users to see their friends' locations on a map within a configurable radius (e.g., 5km) and update their own location every 30 seconds. Key constraints include high write throughput for location updates, low latency for proximity queries, strict mutual-friendship privacy, and battery efficiency for mobile clients. Address how to scale the spatial indexing and handle the intersection of location data with social graph data.
RedisPostgreSQLKafkaGeohashWebSocketsAPI Gateway
10
Read

Nearby Friends System

Design a real-time 'Nearby Friends' feature for a major social media platform with 100M DAU. The system should allow users to see their mutual friends within a 5km radius and receive updates as friends move. Focus on handling the high-frequency location updates (300k+ QPS), minimizing mobile battery consumption, and ensuring privacy. Detail the trade-offs between polling and push mechanisms, and explain how you would handle geospatial data at scale.
RedisWebSocketsGeohashingPostgreSQLPub/Sub
01
Read
1
InterviewGPT

AI-powered tools to help you succeed in tech interviews — from resume to offer.

Products

  • Interview Solver
  • Question Bank
  • Golden Blogs
  • Intervipedia
  • Application Tools

Company

  • Pricing
  • FAQ
  • About

Legal

  • Privacy Policy
  • Terms of Service

© 2026 InterviewGPT Inc. All rights reserved.

All systems operationalUS-East

Made with ♥ for developers