01Where do the posts competing for a slot come from?
Candidates come from the social graph — friends’ and follows’ posts, groups, and pages the user joined — merged into one pool of a few thousand recent posts per load.
Premium preview
Design the ranking system for a social news feed like Instagram or Facebook.
The requirements are open as a taste. From the numbers onward, the full guide opens in the app.
Do not only state requirements. Ask for them. Each card pairs the design constraint with a clarification question you can say out loud before drawing the architecture.
01Where do the posts competing for a slot come from?
Candidates come from the social graph — friends’ and follows’ posts, groups, and pages the user joined — merged into one pool of a few thousand recent posts per load.
02Ranked by what — recency, or something predicted?
A multi-task model predicts P(like), P(comment), P(share), and P(hide) per post, combined into a weighted value score so the business can retune the blend without retraining the model.
03Does tapping hide actually change anything?
Yes: hide and "see fewer like this" carry a heavy negative weight in the value score AND suppress that author or topic for this user on the very next load, not at the next training run.
04A friend posts 30 times today — show all 30?
No: per-author diversity caps limit how many posts from one account appear on a page, applied as a re-rank pass after scoring because the model scores posts one at a time and never sees page composition.
05A minute-old post versus yesterday’s best post — who wins?
Both compete: a freshness boost decays with age and a brand-new post is eligible within seconds of publish — a social feed that surfaces stale content teaches users to stop checking it.
06Clickbait that people demonstrably click — allowed to win?
No: integrity classifiers score every candidate for clickbait, engagement bait, and borderline content, and demotions multiply the final score down after ranking — quality constraints outrank predicted engagement.
Out of scopePost creation, media storage, and the fan-out/timeline delivery infrastructure · Ads ranking and the auction (separate system with its own objective) · Training the integrity classifiers themselves (we consume their scores)
01How much time does ranking get per feed load?
Ranking gets roughly 200 ms of a ~500 ms feed budget — candidate fetch, feature fetch, two model passes, and re-rank all live inside it, which is what forces the funnel shape.
02What scale are we engineering for?
About 185K feed loads per second at peak for 1B daily active users, each fanning out to hundreds of scored candidates — per-item cost is the number to engineer, not per-request cost.
03How stale may the signals the ranker sees be?
Engagement counters update within seconds through streaming, layered over daily batch features — a post going viral right now must be visible to the ranker in minutes, not at the next pipeline run.
04Offline metrics look great, online tanks — what prevents that?
Features are logged at serving time and training reads those exact logged values (point-in-time), so the model trains on what it will actually see — no silent training/serving skew.
05How does a new model earn live traffic?
Every candidate model passes offline gates — replay on logged impressions scored on normalized entropy (how far the click predictions beat always-guessing-the-average), calibration, and NDCG (whether the best items land at the top) — before it earns an online A/B slot, because live experiments are the slowest and costliest filter.
Real interviews probe far more than a tidy list. These are the scope questions that separate candidates who interrogate the problem from those who recite it.
Numbers, architecture diagram, API and data model, deep dives, expected topics, self-check, whiteboard starter, and common mistakes unlock inside the app.
Locked in the app
Locked in the app
Locked in the app
Locked in the app