Bird
0
0

Why is it important to separate the Menu and Order classes in a restaurant system design?

hard📝 Conceptual Q10 of 15
LLD - Design — Food Delivery System
Why is it important to separate the Menu and Order classes in a restaurant system design?
ATo combine all data in one class for simplicity
BTo keep menu data independent from customer orders
CTo store orders inside the Menu class
DTo avoid using multiple classes
Step-by-Step Solution
Solution:
  1. Step 1: Understand responsibilities

    Menu holds static data about dishes; Order holds dynamic customer selections.
  2. Step 2: Importance of separation

    Separating keeps data organized, easier to maintain and extend.
  3. Final Answer:

    To keep menu data independent from customer orders -> Option B
  4. Quick Check:

    Separation of concerns improves design [OK]
Quick Trick: Separate static menu from dynamic orders for clarity [OK]
Common Mistakes:
  • Combining menu and orders
  • Storing orders in menu
  • Avoiding multiple classes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes