Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
ExperiencesCoaching
New
Practice
Mock InterviewsTimed interview simulations with feedbackSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Get started

Design Nearby Friends Ranking

HardSystem Design00:00
Practice interviewer
In session
5 left
00:00

Whenever you're ready, walk me through how you'd approach this.

You need to log in / sign up to chat or submit.

Problem

Product Context

Meta wants to improve Nearby Friends on Facebook so users can discover which friends are physically close enough to meet, while respecting privacy settings and battery constraints. The feature is shown in the Facebook app and may also trigger lightweight notifications when a highly relevant nearby friend appears.

Scale

SignalValue
Facebook DAU eligible for location sharing120M
Concurrent mobile users with fresh location18M
Peak location update QPS900K updates/sec
Peak read QPS for Nearby Friends requests250K requests/sec
Average friend graph size350 friends/user
95th percentile friend graph size2,500 friends/user
Candidate pool before ranking10-500 friends/request
End-to-end p99 latency budget150ms

Task

Design an end-to-end ML system for Nearby Friends. Your design should address:

  1. How to define the product objective, labels, and success metrics for surfacing nearby friends or sending notifications
  2. How to size the system and design the online architecture from location ingestion to retrieval, ranking, and re-ranking
  3. What models you would use at each stage, and which features should be computed online vs batch
  4. How to handle privacy controls, cold start, sparse labels, and rapidly changing context like movement or venue changes
  5. How to evaluate the system offline and online, including guardrails for privacy, battery, and notification fatigue
  6. What failure modes you expect at Meta scale, and how you would detect and mitigate them

Constraints

  • Users must explicitly opt in to location sharing; privacy settings may restrict visibility to subsets of friends
  • Raw GPS traces have limited retention and must be minimized in training data
  • Location and movement features are highly dynamic; stale predictions are often worse than no prediction
  • Mobile battery and network usage are first-class constraints
  • The system should support both in-app ranking and optional notification triggering without spamming users