Skip to content

ONE QUESTION. YOUR REASONING.

Design nearby friends

Design nearby friends: people who opt in see which of their friends are close by, and the list updates as everyone moves.

System designMaps and locationSenior

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
Read: System design questions and who asks them

KEEP GOING

Your next question

Storage, files and linksDesign BitlyInfrastructure and platformDesign a rate limiterInfrastructure and platformDesign an A/B testing platformInfrastructure and platformDesign an ad click aggregator
Browse the collection
01

Pick a question

Read the brief and choose what you want to work on.

02

Talk it through

Explain your thinking. Respond to follow-ups. Draw when a design needs it.

03

Find your next improvement

Use the feedback from your interview to decide what to practise next.