Design a comment system
Add threaded comments to any web page, with replies, likes and moderation, like Disqus.
Functional requirements
- Post a comment or reply to one
- Load comments for a page, newest or top first
- Report and remove abusive comments
Non-functional requirements
- Comments load in under 200 ms
- The embed doesn’t slow host pages
- Spam is filtered before it shows
Scale
- 50K websites embed the widget
- 10M comments per day
- Popular pages have 100K comments
How you’ll be scored
9 checks covering your diagram and your notes, and any valid approach counts. Hints appear for anything you miss. Common mistakes, such as single points of failure or components you never explain, cost points. How grading works
What interviewers look for
- Clarify before you draw. State what is in and out of scope. For “Design a comment system”, that starts with: Post a comment or reply to one; Load comments for a page, newest or top first; Report and remove abusive comments. Interviewers notice candidates who pin the requirements down first.
- Turn the scale into numbers. The scale (50K websites embed the widget; 10M comments per day; Popular pages have 100K comments) should become requests per second, storage and bandwidth, and those figures should drive your choices. Estimates with units carry more weight than adjectives.
- Show how each quality is met. Your design should visibly deliver: Comments load in under 200 ms; The embed doesn’t slow host pages; Spam is filtered before it shows. Saying that it does isn’t enough; point to the part of the design that makes it true.
- Expect follow-ups on the hard parts. Interviewers usually probe threads, moderation and read-heavy here. This is an easy problem, so interviewers expect the fundamentals done cleanly: a clear request path, the right kind of data store, and a reason for each component.
- Explain failure and trade-offs. Say what happens when a component fails, where a single point of failure would hurt, and what you chose not to build. Naming a trade-off is a stronger answer than claiming there isn’t one.