Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Marketplace Product Review System

Let verified buyers rate and review products, moderate what becomes public, and serve fast rating summaries and review pages for a large catalog.

Problem statement

For this exercise, assume an online marketplace sells tens of millions of products. A signed-in customer who has received a delivered order containing a product may publish one review for that product: a 1 to 5 star rating, an optional title, and text. The author can edit or delete their own review.

Every new or edited review version passes an automated moderation check before other customers can see it; until then the author sees their latest version marked as pending, and a moderator can later hide a visible review.

A product page shows the average star rating, the number of visible ratings, a one-to-five star histogram, and paginated visible reviews ordered by most recent or most helpful. A signed-in reader may mark a visible review as helpful once and may withdraw that mark.

Only currently visible review versions count toward the summary, the histogram, and helpful ordering. Design review submission and editing, purchase-eligibility checks, moderation visibility, rating summaries, review browsing, and helpful marks.

Seller replies, photos and videos, keyword search over reviews, personalized ranking, fraud-model training, and incentive policy are outside scope.

What to build

  1. A customer with a delivered order for a product creates, edits, or deletes their single review for that product; a retried submission never creates a second review.
  2. Each new or edited review version becomes visible to others only after it passes moderation, a moderator can hide a visible review, and the author always sees their latest version and its status.
  3. A product page shows the average rating, visible-rating count, and one-to-five star histogram computed only from currently visible reviews.
  4. Readers page through visible reviews by most recent or most helpful with stable cursors, and each signed-in reader can mark or unmark a review as helpful once.

At scale

  • Assume 50 million products and 1 billion stored reviews, with about 2 million review creates or edits per day and peaks of 500 per second during sales events.
  • Product pages read rating summaries at up to 150,000 requests per second and review pages at up to 40,000 requests per second; target p99 latency below 200 milliseconds for both.
  • During a launch, one popular product may receive 2,000 summary reads per second, 50 new reviews per minute, and 200 helpful marks per second.
  • Once a submission is acknowledged it must not be lost; after a moderation decision, the summary, histogram, and review pages should reflect it within 60 seconds.