Single logo
  • Courses
  • Blog
  • About
Join free on SkoolJoin free on Skool

Learning path · 13 steps

Prepare for ML Engineer Interviews
  1. 1
    The ML Engineer Interview Loop: Five Rounds, What Each One Looks For, and a Simple Rubric
  2. 2
    The Answer Framework for Technical Interviews: Five Moves, Scored Out of 24
  3. 3
    From Symptom to Pattern: How to Answer "Which Pattern Would You Use?" in an Interview
  4. 4
    The ML System Design Framework: Eight Steps, in Order, on a Spam Filter
  5. 5
    ML System Design Interview: Fraud Detection for Card Payments, in Eight Steps with Numbers
  6. 6
    ML System Design Interview: A Recommendation Feed, From a Score to Beat to Online Guardrails
  7. 7
    ML System Design Interview: Ad Click Prediction, Sparse Features, Calibration and Late Clicks
  8. 8
    Interview Answer: How Do You Roll Out a New Model Safely When True Labels Come Weeks Later?
  9. 9
    Mock ML Engineer Interview, Scored: A Rollout Question Where the Labels Arrive Weeks Late
  10. 10
    The ML Coding Round: K-Means, Logistic Regression and a Top-k Metric From Scratch
  11. 11
    The ML Depth Round: Five Questions That Always Come, in Thirty Seconds Each
  12. 12
    Presenting Your Portfolio: A Six-Section README That Shows Evidence, Not Buzzwords
  13. 13
    Reading a Job Ad and Shaping Your CV: A Gap List and CV Lines You Can Stand Behind
  1. Blog
  2. /
  3. Machine Learning
  4. /
  5. ML Engineer Interviews

Learning path: Prepare for ML Engineer Interviews · Step 7 of 13

ML System Design Interview: Ad Click Prediction, Sparse Features, Calibration and Late Clicks

A design-only answer to "predict whether someone clicks an ad": the auction multiplies the predicted chance, so the number itself must be right. Sparse hashed features, calibration beyond AUC, late clicks and training on a stream.

Chaand Sheikh

·27 November 2026ML Engineer Interviews

What you will learn

  • Start the ad click design from how the number is used: chance of a click times the value of a click
  • Explain sparse features and the hashing trade-off between clashes and memory
  • Show why a ranking metric misses a model that runs high, and how to check calibration
  • Handle late clicks and training on a stream, with a check before each version ships

Before you start

  • The ML System Design Framework
  • Probability Calibration: Platt and Isotonic

The question: predict whether someone clicks on an ad. This is a system we haven't built in the course, so it's all design thinking, and every number here is for illustration. It's worth your time because four problems show up sharply: sparse features, calibration, late clicks and training on a stream.

Start from how the number gets used

An ad slot opens on a page, and we have to choose which ad to show. Think of an auctioneer in a hurry. Every time a slot opens, the guess has to come back in milliseconds, before the page finishes loading. Each bidder offers an amount per click, so the auctioneer multiplies:

score = chance of a click x value of a click

Ad A: 2% x 50 points = 1.0
Ad B: 1% x 80 points = 0.8   -> A wins   (for illustration)

Notice this. The predicted chance goes straight into a multiplication, so sorting the ads isn't enough. The number itself has to be right. Everything else in the answer follows from that.

Hard part 1: huge, sparse features

We know the user, the ad, the site, the device and the hour. Each of those has a huge number of possible values. Picture one switch per value: there could be millions of switches, and for any one request only a handful are on. That's what sparse means. The useful signal often sits in combinations too, like this kind of ad on this kind of site, and combining them multiplies the switches again.

To hold all that, we hash: each value drops into one of a fixed number of buckets, so the size stays under control. The cost is that two values can land in one bucket and share a weight. More buckets means fewer clashes and more memory. Say that trade-off out loud.

That's also why logistic regression over these switches is a sensible baseline: it's quick to score and easy to update.

Hard part 2: can we trust the number?

Calibrated means that when the model says 4%, about 4% really do click. We check it by grouping. Take a thousand times the model said about 4%: that predicts 40 clicks. Say only 20 came, so the model is running two times too high in that group.

Look what that does to the auction. Suppose ad B's true 1% gets reported as 3%. Then 3% x 80 = 2.4, so B now beats A's 1.0, even though A was the better choice.

Double every prediction: the order stays, AUC does not move Prediction Prediction, doubled 1st Ad A 4% 2nd Ad B 2% 3rd Ad C 1% 1st Ad A 8% 2nd Ad B 4% 3rd Ad C 2% Same order, so area under the curve does not move
For illustration. A ranking metric only looks at order, so it can't see a model that runs high.

Here's the trap. A ranking metric like area under the curve only looks at order. Double every prediction, the order stays the same, and that metric doesn't move (more in ROC and AUC). So you also report log loss and a calibration chart, predicted against actual. If it's off, add a small correction step after the model, fitted on recent rows the model didn't train on. That's exactly what Platt and isotonic calibration do.

Hard part 3: the click that comes late

We show an ad and write down a row: did they click? At that moment, nobody knows. A click can arrive seconds later or minutes later, so we have to wait before we call any row a "no".

Freezing the label too early 100 clicks happen in all (for illustration) 70 arrived before the cut 30 came later label frozen here The late 30 are counted as "no click": the learned rate is about 30% too low
A short wait gives fresh rows with some wrong labels; a long wait gives right labels on old rows.

Call it too soon, and late clicks get counted as no click. For illustration, if 70 of every 100 clicks have arrived when we freeze the label, the model learns a click rate about 30% too low. Wait longer? Then the data is older, and this model needs fresh data.

A common answer: pick a wait that catches most clicks, measure how many come after it, and correct for that share. And give your check data a longer wait, so you aren't grading with the same wrong labels. The same late-label thinking applies to fraud: When Labels Arrive Weeks Late.

Hard part 4: training on a stream

New ads appear all day, and a model trained last week has never heard of this morning's ads. So rows flow in, wait for their labels, and the model takes small updates, often.

But a stream can carry bad data too, so nothing goes straight from training to production. Each new version is checked on the most recent rows against the current model, and if it's worse it doesn't ship. You can always go back to the last good one (a quality gate does this job).

One more thing: the model only sees clicks on ads it chose to show, so it can't learn about the ones it kept out. That's a feedback loop. Give a small slice of traffic to trying other ads, especially new ones. It costs a little now, and it's how the model keeps learning.

Follow-ups and a rubric

  • How would you handle a brand new ad with no history?
  • How do you keep scoring inside a few milliseconds?
  • What would you do if clicks suddenly drop everywhere?
  • How do you know a new model is better? Give it a small share of traffic and compare it against the current one.

Mark yourself, one point each, out of 5:

RowYou get the point if you...
Usesaid how the number gets used
Featuresnamed sparse features and the cost of hashing
Calibrationsaid how you'd measure it
Timecovered late clicks and updates
Limitsaid where your design stops working

Recap

  • Ad click prediction feeds an auction, so the number itself has to be right.
  • The features are huge and sparse. Hashing keeps them small, at the cost of clashes.
  • Check calibration as well as order; a ranking metric won't catch a model that's running high.
  • Clicks come late and the world keeps moving: choose a label wait, take small updates, check each version, and keep trying a few other ads.

Try it yourself

Answer "design ad click prediction" out loud in five minutes, starting from how the number gets used.

Tried the exercise? Share your answer or ask a question.

The StudyEasy AI Community is free to join, with the lesson files, notebooks and code.

Join free on Skool

Keep going in the learning path Prepare for ML Engineer Interviews · step 7 of 13

Previous
ML System Design Interview: A Recommendation Feed, From a Score to Beat to Online Guardrails
Next post
Interview Answer: How Do You Roll Out a New Model Safely When True Labels Come Weeks Later?

Related course on Udemy

Machine Learning Engineer: From First Model to ML Engineer

Learn machine learning in Python, then ship it: data analysis, regression, classification, tuning, deployment and MLOps.View on Udemy ↗: Machine Learning Engineer: From First Model to ML Engineer (paid course, opens in a new tab)

Related posts

The ML Engineer Interview Loop: Five Rounds, What Each One Looks For, and a Simple Rubric

The rounds you go through for one ML engineer job: recruiter screen, coding, ML depth, ML system design and behavioural. What each round looks for, the follow-up it brings, and a four-check rubric for your own answers.

The Answer Framework for Technical Interviews: Five Moves, Scored Out of 24

Good interview answers share one shape: a 30-second answer, the mechanism, the trade-off, the metric and the failure test. Worked on one question about a batch job starving everyone else, with a 24-point example rubric.

From Symptom to Pattern: How to Answer "Which Pattern Would You Use?" in an Interview

Start from what you can see, not from the pattern you know. A four-step rule (symptom, cost, metric and failure test, ship first), a symptom table, one worked answer for 429s at peak, and the trap of using a prompt as a lock.

The ML System Design Framework: Eight Steps, in Order, on a Spam Filter

One repeatable route through any ML system design question: goal, metric, data, features, model, serving, monitoring and failure. Worked on an email spam filter, with the follow-ups and a three-check rubric.

On this page

  • Start from how the number gets used
  • Hard part 1: huge, sparse features
  • Hard part 2: can we trust the number?
  • Hard part 3: the click that comes late
  • Hard part 4: training on a stream
  • Follow-ups and a rubric
  • Recap
  • Try it yourself
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

Machine Learning Engineer: From First Model to ML Engineer

Learn machine learning in Python, then ship it: data analysis, regression, classification, tuning, deployment and MLOps.View on Udemy ↗: Machine Learning Engineer: From First Model to ML Engineer (paid course, opens in a new tab)

Single logo

Empowering Education, One Course at a Time

About
About usContact usFAQs
Legal
Terms of ServicePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.