ML System DesignExpert20 min read5 questions

Search, Ranking & Feed Design Case Studies

Four more worked designs covering the surfaces most companies actually build: search, feeds, ads and moderation — each with the trap the interviewer is waiting for.

Covers: Learning to rank, search architecture, feed ranking, ads CTR prediction, content moderation at scale

Recommendation is the classic ML system design question, but search ranking, feed ranking, ads and moderation come up just as often — and each has a distinctive trap. This lesson works through those traps so you recognise them under time pressure.

Filter
0/5 mastered
Expertsearchlearning-to-ranksystem-designAsked at Amazon, Etsy

30-second answer

Query understanding (spell correction, intent, attribute extraction), retrieval (inverted index for lexical + vector index for semantic, fused), then learning-to-rank over the candidates using query, product, query-product and behavioural features. Optimise NDCG offline but the real objective is conversion, and the key trap is position bias in the click logs used for training.

Expertfeedrankingsystem-designAsked at Meta, LinkedIn

30-second answer

There is no query, so intent must be inferred from context and history; recency matters enormously; the objective is multi-dimensional (engagement, satisfaction, creator ecosystem health, integrity); and the feedback loop is severe because the feed shapes the behaviour you learn from. Architecture is still a funnel — candidate sources, a multi-task ranker, then a re-ranking layer applying diversity, integrity and pacing rules.

ExpertadsctrcalibrationAsked at Google Ads, Meta Ads

30-second answer

Predict calibrated P(click) for every eligible ad, then rank by expected value — bid × pCTR (× pConversion for conversion campaigns) — inside a second-price-style auction. The defining constraints are extreme scale (millions of QPS, billions of sparse features), a hard sub-50 ms budget, and an absolute requirement for calibrated probabilities because those probabilities directly determine what advertisers pay.

Expertmoderationsafetysystem-designAsked at Meta, TikTok

30-second answer

A tiered pipeline: hash matching for known violating content (instant, exact), fast multimodal classifiers on everything, escalation of uncertain or high-reach content to stronger models, and human review for the ambiguous and appealable tail. The defining constraints are asymmetric error costs that differ per policy, adversarial evasion, cultural and linguistic context, and a legally required appeals path.

Advancedscalesystem-designarchitectureAsked at Google, Meta

30-second answer

Identify what actually breaks first rather than saying 'add more machines'. Walk through each component and state whether it scales horizontally, vertically or not at all: stateless serving scales trivially, the feature store becomes the bottleneck, the vector index may no longer fit in memory, training data volume forces sampling, and the human-in-the-loop components hit a hard staffing ceiling. Then propose the specific change for the first thing to break.

Showing 5 of 5 questions for ml-system-design-search-and-ranking.

Check your understanding

5 questions · no sign-up, nothing stored

0/5 answered
Question 1

1.In search ranking, including position as a feature and serving it causes:

Question 2

2.In a feed value model, why are negative signals like 'hide' and 'report' weighted so heavily?

Question 3

3.Calibration matters more in ads CTR prediction than in most ranking problems because:

Question 4

4.In content moderation, why should CSAM use a much lower auto-action threshold than hate speech?

Question 5

5.At 100× scale, the component that most often breaks first is:

Hands-on challenge

Build it — this is what you talk about in a deep-dive round.

Design review: critique and improve a real system

Take a public architecture write-up (YouTube recommendations, Pinterest search, Meta feed ranking) and analyse it as though you were on the design review.

Requirements

  • Summarise the design in the 8-step framework and identify which constraint dominates.
  • Identify at least three decisions you would question, with the trade-off each involves.
  • Do the back-of-envelope arithmetic for their stated scale and check whether the design is consistent.
  • Propose one concrete improvement and describe how you would A/B test it.

Stretch goals

  • Write the position-bias correction for their ranking stage and explain how you would validate it.
  • Design the exploration policy that would keep their offline evaluation unbiased.