Bird
Raised Fist0

Which data model is most suitable to store a user's rating and textual review for a product?

easy🧠 Conceptual Q3 of Q15
LLD - Design — Food Delivery System
Which data model is most suitable to store a user's rating and textual review for a product?
AA list of product names only
BA boolean flag indicating if a product is reviewed
CA single integer representing total reviews
DA record with fields: user_id, product_id, rating, review_text, timestamp
Step-by-Step Solution
Solution:
  1. Step 1: Determine required data for each review

    Each review needs user ID, product ID, rating value, review text, and time.
  2. Step 2: Match data model to these fields

    A record with these fields stores all needed info clearly.
  3. Final Answer:

    A record with fields: user_id, product_id, rating, review_text, timestamp -> Option D
  4. Quick Check:

    Review data model = Detailed record [OK]
Quick Trick: Store all review details in one structured record [OK]
Common Mistakes:
MISTAKES
  • Using only product names without review data
  • Storing just total counts loses details
  • Using boolean flags cannot hold review text

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes