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
November 29, 20260
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
How to Approach This
- Start by mapping the business objective to a concrete ML objective and metric.
- Cover the full pipeline: data collection, feature engineering, model selection, training, serving.
- Discuss online vs offline evaluation. Plan an A/B test to validate real-world impact.
- Address the serving latency budget and whether batch or real-time inference is needed.
- 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 ProblemsSample 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
- 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...