Bird
Raised Fist0

Which class should primarily hold the list of available food items and their prices in a restaurant system?

easy🧠 Conceptual Q11 of Q15
LLD - Design — Food Delivery System
Which class should primarily hold the list of available food items and their prices in a restaurant system?
ARestaurant
BMenu
COrder
DCustomer
Step-by-Step Solution
Solution:
  1. Step 1: Understand the role of Menu class

    The Menu class is designed to store food items and their prices, acting as the restaurant's catalog.
  2. Step 2: Differentiate from other classes

    Order tracks customer requests, Restaurant manages overall operations, Customer represents the diner. Only Menu holds items and prices.
  3. Final Answer:

    Menu -> Option B
  4. Quick Check:

    Menu = items and prices [OK]
Quick Trick: Menu holds items and prices, not orders or customers [OK]
Common Mistakes:
MISTAKES
  • Confusing Order with Menu
  • Thinking Restaurant holds item prices
  • Assuming Customer stores menu data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes