Problem statement
Design the service that ranks comments under a post so the most relevant surface first as "Top comments," while still letting readers switch to newest-first or most-replied and page further down.
Operating context. A popular post can hold millions of comments and take thousands of new ones per minute. The default order is a quality score combining upvotes, reply count, author signal, and a recency/freshness decay. Reads massively outnumber writes. Ranking must update as new votes and comments arrive without recomputing the whole post from scratch, and pagination must stay stable for a reader even as scores shift underneath them.
Out of scope. The comment storage and threading data model itself (assume a comment store exists), toxicity moderation, the write path for posting a comment, and per-reader personalization. Assume other teams own those.
What to produce. A high-level design covering: how the ranking score is computed and maintained, the serving path for the top-N plus deeper pages, incremental score updates on new votes and comments, caching, and how the hottest posts are handled. Sketch the components and request flow; checkpoints will probe incremental score maintenance and pagination stability.
Requirements
This assessment is a Premium feature.
The statement above is free to read. The functional and non-functional requirements, and the graded canvas that scores your design against them, come with Premium.
Topics
- System Design HLD
- Ranking Scoring
- Scaling Read-Heavy
- Data Cache
- Social Comments