Classic design · Senior
People You May Know
Classic interview design. Key points: link prediction, GNN, friends of friends, batch precomputation, and fairness.
Short answer
Classic interview design. Key points: link prediction, GNN, friends of friends, batch precomputation, and fairness. The goal of PYMK is to help members connect with people who may be relevant additions to their professional network. The feature is old on the platform and is driven by some of the company's earliest ML algorithms.
01 · CONTEXT
Suggesting people worth connecting with
The goal of PYMK is to help members connect with people who may be relevant additions to their professional network. The feature is old on the platform and is driven by some of the company's earliest ML algorithms.
A connection only forms after the invitation is accepted. That is why the source says you must ensure both members benefit from the connection, not just the one who sends the invitation.
02 · SCORING
Scoring pairs and sorting by P(connect)
PYMK extracts attributes from the Economic Graph and from interactions on the platform and uses ML algorithms to generate recommendations. The model combines linear and nonlinear approaches to estimate the propensity to connect between two members.
The diagram starts with the member and the recommendation service they query.
The model estimates the connection propensity between two members, with attributes extracted from the Economic Graph and from interactions on the platform.
The propensity becomes a P(connect) score, and the list of new connections follows the order of that score.
03 · POPULAR RECIPIENTS
When the recommended person receives too many invitations
Some members, such as influencers, executives, and recruiters at large companies, receive many connection requests. A member flooded with invitations may miss relevant networking opportunities.
The fix was to add a re-ranker on top of the P(connect) score that discounts the score of recipients with too many invitations. The more invitations a recipient receives, the higher the original score must be for them to appear in the results.
The re-ranker sits on top of the P(connect) score and discounts the score of recipients with too many invitations.
The new score is the score times a decay factor df in the range [0,1].
In production, the factor comes from a piecewise linear function applied to the number of invitations received.
In the source's example, the discount applies to anyone who received more than 10 invitations in the previous week.
04 · MEASUREMENT
Measuring the effect on both sides of the invitation
In A/B tests, members are randomly assigned to treatment groups and see recommendations from different models. If a model recommends better, members send more invitations, and this sender-side effect comes straight out of the test.
The diagram starts with the sender, who receives suggestions from the recommendation service.
Each member is randomly assigned to a treatment group and sees recommendations from different models.
The sender-side effect, more invitations sent, comes straight out of the A/B test result.
The recipient-side effect is harder to measure, because a recipient may receive invitations from several senders.
The attribution framework links recipients' sessions to the correct senders.
Traditional metrics such as invitations sent were expected to fall, but there was a net engagement gain. The table summarizes what the source reports for the discount by invitations received.
| Metric | Reported result |
|---|---|
| Overloaded recipients | 50% reduction |
| Connection requests sent | 1% drop |
| Recipient-side sessions | 1% increase |
| Sender-side sessions | Neutral impact |
05 · FAIRNESS
The cycle that favors those already active
Frequent members tend to be more represented in the training data than infrequent members. They are recommended to others at a higher rate and thus make even more connections and gain even more representation in the training data.
The source argues, intuitively, that a member with few connections may get more incremental utility from adding a connection than a member with hundreds or thousands.
The diagram starts with the two groups of members and the service that returns the suggestion list.
Frequent members are recommended to others at a higher rate, make even more connections, and gain even more representation in the training data.
A fairness re-ranker reorders the suggestions according to equality of opportunity and equalized odds, giving equal representation to qualified members of both groups.
The reported result is a 5.44% increase in invitations sent to infrequent members and a 4.8% increase in connections made by them, with neutral metrics for frequent members.
06 · TO PRACTICE
What a complete design still needs to decide
This case focuses on scoring, re-ranking, and measurement. A complete interview design still needs an earlier step that generates the candidates, and a split between what is computed before the request and what is computed on the spot.
Frequently asked questions
What is People You May Know?
Classic interview design. Key points: link prediction, GNN, friends of friends, batch precomputation, and fairness.
What does the People You May Know design cover?
It is organized in these sections: Suggesting people worth connecting with, Scoring pairs and sorting by P(connect), When the recommended person receives too many invitations, Measuring the effect on both sides of the invitation, The cycle that favors those already active, and What a complete design still needs to decide.
How long is People You May Know and what level is it?
It takes about 16 minutes to read and is rated Senior level.
Now design it yourself
Run this case as an interview in the System Design school: you make the decisions, the tutor challenges them and you see how your design scores.