Recommendations
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 · 12 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 many feed requests a second at the evening peak?

      How much data do impressions, events and serve logs produce a day?

        How much RAM does the billion-vector index need, and how many copies?

          How many GPU servers does the heavy ranker need at peak?

            Build-up · 6 steps

            Build the high-level design

            One functional requirement at a time, ending with a feed that works, but not yet at full scale.

            Step 1 of 6

            Get a personalised feed

            Retrieval must consider everything, so each item can cost only nanoseconds: a two-tower search of precomputed item vectors returns 1,500. The ranker sees only those, so it can afford a deep multi-task model.

            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

              “Retrieval must find 1,500 good candidates among a billion 128-number item vectors, 100k times a second. How do you search them?”

              Your move. Pick an approach:

            2. Deep dive 2 of 6

              Interviewer

              “Retrieval returns about 1,500 candidates from six sources, and the heavy ranker is your most expensive step. Which candidates does it score?”

              Your move. Pick an approach:

            3. Deep dive 3 of 6

              Interviewer

              “The ranker needs thousands of features per candidate in milliseconds, and training needs the same features. Where do they come from?”

              Your move. Pick an approach:

            4. Deep dive 4 of 6

              Interviewer

              “A user skips three cricket clips in a row. How do you make the feed react within seconds instead of tomorrow?”

              Your move. Pick an approach:

            5. Deep dive 5 of 6

              Interviewer

              “A clip uploaded five minutes ago has a vector but no engagement, so the ranker scores it low. How does it get exposure?”

              Your move. Pick an approach:

            6. Deep dive 6 of 6

              Interviewer

              “The user reaches the eighth item and the app asks for page n + 1. How do you produce it?”

              Your move. Pick an approach:

            Build-up · 8 steps

            Follow one page through it

            The request path runs down the middle; the collector, Kafka, Flink and training form an asynchronous loop that can fall behind without failing a single page.

            Step 1 of 8

            Request

            The app asks for the next page with its cursor two items before it needs it, so the response is already waiting when the user swipes.