Layer 3 · Go deeper · 11 min
Go deeper
Size it, build it, then make the calls an interviewer will push you on.
Back of the envelope
Size it up
Tap through each step of the arithmetic.
How much does a naive nightly friends-of-friends job shuffle?
How many suggestion requests, and candidate scores, a second?
How many new connections, and nearline merges, a second?
Build-up · 5 steps
Build the high-level design
One functional requirement at a time, ending with a design that works for a small network before any scaling.
Step 1 of 5
See people you may know
The PYMK service asks the graph for your friends, then their friends, counts the paths to each person and returns the top 20 by mutual count. Most new friendships close a triangle.
6 interview moments
You’re the candidate
The interviewer pushes on the hard parts. Pick an approach and see how it holds up.
Deep dive 1 of 6
Interviewer
“Friends-of-friends is your best signal, but one active member already has 62,500 two-hop paths. How do you generate candidates?”
Your move. Pick an approach:
Deep dive 2 of 6
Interviewer
“Asha has about 3,000 candidates and room for 20. How do you score them?”
Your move. Pick an approach:
Deep dive 3 of 6
Interviewer
“The base list may be a day old, but a new connection must change both people’s suggestions within 5 minutes. Where do you compute?”
Your move. Pick an approach:
Deep dive 4 of 6
Interviewer
“The widget must answer within 200 ms at p99, and someone who blocked the viewer must never appear. How do you serve it?”
Your move. Pick an approach:
Deep dive 5 of 6
Interviewer
“A member signed up 30 seconds ago and has no connections. How do you fill their first suggestions?”
Your move. Pick an approach:
Deep dive 6 of 6
Interviewer
“Uploaded address books are a strong cold-start signal. How do you use them without exposing anyone?”
Your move. Pick an approach:
Build-up · 9 steps
Follow one request, then the updates
Everything heavy happens off the request path. A request reads a few hundred precomputed rows, filters them against live stores and spends its budget on ranking.
Step 1 of 9
Request
The widget or page calls the gateway, which authenticates the member and calls the PYMK service. The answer must land within 200 ms at p99.