LeetDesign
← All problems
Medium

Design a News Aggregator Front Page

Serve one ranked front page to a hundred-and-thirty-thousand-a-second morning rush. It looks exactly like a feed problem — until you notice that nobody's page is different.

Design the front page of a news aggregator — the ranked list of stories a large readership loads first thing in the morning. Readers fetch the front page and click through to stories; a far smaller crowd submits links and votes, and a ranking job folds those votes back into the page as scores shift.

The read volume is enormous — well over a hundred thousand front-page fetches a second at the morning rush, with a story click-stream behind it — and the write side is a rounding error against it. But look closely at what is being read. The page is ranked once, globally: every reader who loads the front page sees the same thirty stories in the same order, and a copy that lags the freshest vote by up to a minute is explicitly fine. Submissions and votes are the part that must not be casual — an acked submission is someone's contribution, and it has to survive a crash.

Twenty million stories fit in one modest database with room to spare. Count carefully what each tier actually has to carry before you buy it.