Bird
Raised Fist0

In a LOOK algorithm implementation, the head moves towards higher positions but never reverses direction. What is the likely issue?

medium📝 Analysis Q7 of Q15
LLD - Design — Elevator System
In a LOOK algorithm implementation, the head moves towards higher positions but never reverses direction. What is the likely issue?
AThe algorithm is servicing requests randomly
BThe algorithm correctly services all requests in one direction only
CThe algorithm is implementing SCAN, not LOOK
DThe algorithm is stuck and does not reverse after last request, causing starvation
Step-by-Step Solution
Solution:
  1. Step 1: Understand LOOK reversal behavior

    LOOK must reverse direction after servicing last request in current direction.
  2. Step 2: Identify problem if no reversal

    If head never reverses, requests in opposite direction starve and are never serviced.
  3. Final Answer:

    The algorithm is stuck and does not reverse after last request, causing starvation -> Option D
  4. Quick Check:

    LOOK must reverse direction after last request [OK]
Quick Trick: LOOK must reverse after last request to avoid starvation [OK]
Common Mistakes:
MISTAKES
  • Forgetting to reverse direction
  • Confusing LOOK with SCAN behavior
  • Assuming one-direction servicing is enough

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes