Design People You May Know Friend Recommendations

Last updated: November 29, 2026

Quick Overview

Design the ML system behind Facebook's People You May Know, which suggests accounts a user is likely to know and send a friend request to, with the request being accepted.

Meta
ML System Design
Machine Learning Engineer
Meta
November 29, 2026
Machine Learning Engineer
Onsite
ML System Design
Hard

0

0

0 solved


Design the ML system behind Facebook's People You May Know, which suggests accounts a user is likely to know and send a friend request to, with the request being accepted.

PYMK is one of Meta's oldest growth-critical ML systems, and the graph structure makes it different from content recommendation. Interviewers check graph-based candidate generation, the right label (accepted request, not just sent), and privacy and integrity guardrails.

What the Interviewer Expects
  • Define the objective as accepted connections, with negative signals
  • Use graph-based candidate generation (friends of friends) plus other sources
  • Propose features including mutual friend counts and shared contexts
  • Discuss scale of friends-of-friends computation
  • Address privacy, unwanted suggestions, and spam
Key Topics to Cover
Graph features
Candidate generation
Link prediction
Privacy
Two-stage ranking
How to Approach This
  1. Start by mapping the business objective to a concrete ML objective and metric.
  2. Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
  3. Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
  4. Address the serving latency budget and whether batch or real-time inference is needed.
  5. Think about the data flywheel: how user feedback improves the model over time.
Possible Follow-up Questions
  • How would you treat suggestions that reveal sensitive relationships?
  • How do you help a brand-new user with zero friends?
  • How would you measure long-term value of a connection, not just acceptance?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice ML System Design Problems
Sample Answer
Requirements

Goal: maximize meaningful accepted connections. Label: request sent and accepted within 14 days. Negatives: shown and not acted on, dismissed ("remove" is a strong negative). Constraints: sugg...

High-Level Design
  1. Candidate generation (offline daily plus online refresh): friends of friends, contact uploads (with consent), shared groups, schools and workplaces, co-tagged photos, graph embeddings nearest n...

Submit Your Answer
Markdown supported