LLD - Design — Food Delivery SystemWhich of the following is the correct way to add a new item to the Menu class in a typical object-oriented design?Amenu.addItem('Pizza', 12.99)BMenu.add('Pizza', 12.99)Cmenu.insertItem('Pizza', 12.99)DaddItem(menu, 'Pizza', 12.99)Check Answer
Step-by-Step SolutionSolution:Step 1: Identify instance method usageAdding an item to a Menu instance uses the instance method, so calling menu.addItem(...) is correct.Step 2: Eliminate incorrect syntaxMenu.add(...) suggests a static method which is unlikely; insertItem is not standard; addItem(menu, ...) is procedural, not OOP style.Final Answer:menu.addItem('Pizza', 12.99) -> Option AQuick Check:Instance method call = menu.addItem(...) [OK]Quick Trick: Use instance.method() to add items, not static or procedural calls [OK]Common Mistakes:Using static method call instead of instance methodConfusing method namesCalling functions outside class context
Master "Design — Food Delivery System" in LLD9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepArchTryChallengeDesignRecallScale
More LLD Quizzes Advanced LLD Concepts - Clean Architecture layers - Quiz 7medium Design — Chess Game - Piece movement rules (polymorphism) - Quiz 9hard Design — Chess Game - Move validation and check detection - Quiz 8hard Design — Chess Game - Observer pattern for UI updates - Quiz 11easy Design — Hotel Booking System - Search and filter design - Quiz 7medium Design — Hotel Booking System - Room type hierarchy - Quiz 7medium Design — Online Shopping Cart - Notification on state change - Quiz 1easy Design — Online Shopping Cart - Notification on state change - Quiz 14medium Design — Splitwise (Expense Sharing) - Balance calculation algorithm - Quiz 12easy Design — Splitwise (Expense Sharing) - Simplify debts algorithm - Quiz 15hard