Bird
Raised Fist0

Which class is responsible for storing the details like product ID, name, and price?

easy🧠 Conceptual Q11 of Q15
LLD - Design — Online Shopping Cart
Which class is responsible for storing the details like product ID, name, and price?
AProduct class
BCart class
COrder class
DUser class
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of Product class

    The Product class stores item details such as ID, name, and price.
  2. Step 2: Compare with other classes

    The Cart class holds selected products and quantities, and Order class records purchased items and status, not product details.
  3. Final Answer:

    Product class -> Option A
  4. Quick Check:

    Product details = Product class [OK]
Quick Trick: Product details belong to Product class only [OK]
Common Mistakes:
MISTAKES
  • Confusing Cart with Product class
  • Thinking Order stores product details
  • Assuming User class stores product info

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes