Section 1: It's an Auction With a Stopwatch - Problem Understanding & Clarifications
Executive Summary: The prompt says "ads" and "ranking", and those two words pull candidates toward a recommender system or an hour of model architecture. This section shows the first ten minutes of a better interview. Eight clarifying questions reveal what the prompt is really asking for: an internal front door that must answer within 80 ms at p99, a funnel from 50 million live ads to 3 winners, an auction where a model's prediction multiplies real money, budgets that must hold across six regions, and a billing loop that counts every click once. The section ends with written assumptions and the running example the rest of the lesson follows.
The interviewer reads the prompt aloud:
"Design the ads front door and the ranking pipeline behind it for a large social app. When a user's feed loads, the feed service asks for three ads. You have to pick the best ones out of fifty million live ads, run retrieval, feature lookup, ML inference and an auction, respect every advertiser's budget, and answer inside 80 milliseconds at p99, at over a million requests a second at peak."
Here's the trap. Candidates who hear "ads" draw a recommender: user embedding, item embedding, a ranking model, done. Candidates who hear "ranking" spend forty minutes on towers, attention layers and loss functions. Both miss the problem. A recommender that is 50 ms late shows a slightly worse feed. An ads system that is 50 ms late shows no ads, and an ads system with a miscalibrated model charges advertisers the wrong price. You're designing a pipeline that has a deadline and moves money; the model is one stage inside it.
Key Insight: Two phrases in the prompt change the design: "inside 80 milliseconds" and "respect every advertiser's budget". The first means every stage gets a fixed slice of time and the system needs a plan for when a stage runs out of it. The second means the request path is connected to a ledger.
What the Prompt Hides
Before asking anything, name the five problems inside that paragraph.
Notice the cycle at the bottom. Spend from the clicks of ten seconds ago changes who is allowed to compete in the next auction.
Sign in to continue reading
The rest of this lesson is available with a free account. Signing in with Google or Microsoft is free.
Sign in to read the full lesson