LLD - Design — Elevator SystemIn a LOOK algorithm implementation, the head moves towards higher positions but never reverses direction. What is the likely issue?AThe algorithm is servicing requests randomlyBThe algorithm correctly services all requests in one direction onlyCThe algorithm is implementing SCAN, not LOOKDThe algorithm is stuck and does not reverse after last request, causing starvationCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand LOOK reversal behaviorLOOK must reverse direction after servicing last request in current direction.Step 2: Identify problem if no reversalIf head never reverses, requests in opposite direction starve and are never serviced.Final Answer:The algorithm is stuck and does not reverse after last request, causing starvation -> Option DQuick Check:LOOK must reverse direction after last request [OK]Quick Trick: LOOK must reverse after last request to avoid starvation [OK]Common Mistakes:MISTAKESForgetting to reverse directionConfusing LOOK with SCAN behaviorAssuming one-direction servicing is enough
Master "Design — Elevator System" in LLD9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepArchTryChallengeDesignRecallScale
More LLD Quizzes Behavioral Design Patterns — Part 1 - State pattern - Quiz 8hard Behavioral Design Patterns — Part 1 - Why behavioral patterns define object interaction - Quiz 4medium Behavioral Design Patterns — Part 2 - When to use which behavioral pattern - Quiz 11easy Behavioral Design Patterns — Part 2 - Mediator pattern - Quiz 12easy Design — Elevator System - Why elevator design tests state machines - Quiz 15hard Design — Elevator System - Multiple elevator coordination - Quiz 4medium Design — Library Management System - Requirements and use cases - Quiz 11easy Design — Library Management System - Class design (Book, Member, Librarian, Loan) - Quiz 11easy Design — Tic-Tac-Toe Game - Win condition checking - Quiz 3easy Design — Tic-Tac-Toe Game - Extensibility (NxN board, multiple players) - Quiz 1easy