LLD - Design — Elevator SystemWhich of the following is a valid data structure to store the list of floors an elevator must visit?AStackBQueueCSetDDictionaryCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand elevator floor visit orderElevators typically visit floors in the order requests are received, so a queue (FIFO) fits well.Step 2: Analyze other data structuresStack (LIFO) reverses order, set has no order, dictionary is key-value and not suitable for ordered visits.Final Answer:Queue -> Option BQuick Check:Floor list = Queue [OK]Quick Trick: Use queue for ordered floor visits [OK]Common Mistakes:MISTAKESUsing stack reverses orderUsing set loses orderDictionary not for ordered lists
Master "Design — Elevator System" in LLD9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepArchTryChallengeDesignRecallScale
More LLD Quizzes Behavioral Design Patterns — Part 1 - Iterator pattern - Quiz 6medium Behavioral Design Patterns — Part 1 - Chain of Responsibility pattern - Quiz 5medium Design — Library Management System - Class design (Book, Member, Librarian, Loan) - Quiz 5medium Design — Library Management System - Class design (Book, Member, Librarian, Loan) - Quiz 11easy Design — Library Management System - Notification system - Quiz 4medium Design — Library Management System - Search functionality design - Quiz 13medium Design — Library Management System - Reservation and hold system - Quiz 15hard Design — Parking Lot System - Enum usage (VehicleType, SpotType) - Quiz 12easy Design — Parking Lot System - Enum usage (VehicleType, SpotType) - Quiz 10hard Design — Tic-Tac-Toe Game - Move validation - Quiz 2easy