Design a Food-Item Review System
Company: DoorDash
Role: Software Engineer
Category: System Design
Difficulty: hard
Interview Round: Onsite
# Design a Food-Item Review System
Design a system where customers can submit and read reviews for individual food items. Explain the product contract, write and read paths, aggregate ratings, moderation boundaries, and scaling choices.
### Constraints & Assumptions
- A review belongs to a specific food item and author identity.
- Edits and deletions must not silently corrupt displayed aggregates.
- The design should separate confirmed requirements from assumptions about ordering, anonymity, and moderation.
### Clarifying Questions to Ask
- Can one author review an item more than once?
- Must reviews be tied to a completed order?
- How fresh must the displayed average and count be after an edit?
```hint Separate source and projection
Treat individual reviews as the record of truth and the displayed rating summary as a derived projection.
```
### What a Strong Answer Covers
- Core APIs and data model for items, reviews, authorship, and aggregate summaries.
- Consistency choices for create, edit, delete, and rating recomputation.
- Pagination, sorting, caching, abuse controls, and moderation or audit history.
- Failure handling, observability, and a path to rebuild derived aggregates.
### Follow-up Questions
1. How would verified-purchase labels change the model?
2. How would you rank reviews without making the aggregate rating unstable?
Quick Answer: Explore the data model, consistency, moderation, aggregation, and scale trade-offs behind a food-item review platform.