LLD - Design — Food Delivery SystemWhich of the following is the correct way to represent a Menu item in a class?Aclass MenuItem { String name; double price; }Bclass Menu { List<String> items; }Cclass Order { int quantity; }Dclass Restaurant { String address; }Check Answer
Step-by-Step SolutionSolution:Step 1: Identify the class representing a single menu itemA MenuItem class should have properties like name and price.Step 2: Check the optionsclass MenuItem { String name; double price; } correctly defines a MenuItem with name and price fields.Final Answer:class MenuItem { String name; double price; } -> Option AQuick Check:Menu item = name and price fields [OK]Quick Trick: MenuItem class holds name and price, not the whole menu [OK]Common Mistakes:MISTAKESUsing Menu class for single itemConfusing Order with MenuItemMissing price field in MenuItem
Master "Design — Food Delivery System" in LLD9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepArchTryChallengeDesignRecallScale
More LLD Quizzes Advanced LLD Concepts - Domain-Driven Design basics - Quiz 9hard Design — Chess Game - Special moves (castling, en passant) - Quiz 1easy Design — Chess Game - Move validation and check detection - Quiz 4medium Design — Chess Game - Move validation and check detection - Quiz 10hard Design — Chess Game - Special moves (castling, en passant) - Quiz 7medium Design — Hotel Booking System - Availability checking - Quiz 11easy Design — Hotel Booking System - Hotel, Room, Booking classes - Quiz 6medium Design — Online Shopping Cart - Product, Cart, Order classes - Quiz 7medium Design — Splitwise (Expense Sharing) - Balance calculation algorithm - Quiz 5medium Design — Splitwise (Expense Sharing) - Transaction history - Quiz 14medium