PYMK
0-day streakReview

Your progress

Level 1

0 XP100 XP to level 2
0day streak
0best streak
0topics started
0cards reviewed
    Review cards

    Progress is stored only in this browser. No account is required.

    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 big is the graph, and how many machines hold it?

      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.

            1. 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:

            2. 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:

            3. 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:

            4. 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:

            5. 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:

            6. 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.