Bird
0
0

Which of the following is the correct order of servicing requests using the SCAN algorithm if the head starts at 50 and requests are at [10, 20, 35, 70, 90] with disk size 100?

easy🧠 Conceptual Q12 of 15
LLD - Design — Elevator System
Which of the following is the correct order of servicing requests using the SCAN algorithm if the head starts at 50 and requests are at [10, 20, 35, 70, 90] with disk size 100?
A50 -> 70 -> 90 -> 35 -> 20 -> 10
B50 -> 70 -> 90 -> 100 -> 35 -> 20 -> 10
C50 -> 35 -> 20 -> 10 -> 0 -> 70 -> 90
D50 -> 90 -> 70 -> 35 -> 20 -> 10
Step-by-Step Solution
Solution:
  1. Step 1: SCAN moves towards higher end first

    Starting at 50, SCAN moves up servicing 70 and 90, then reaches disk edge 100.
  2. Step 2: SCAN reverses direction

    After reaching 100, it moves down servicing 35, 20, and 10.
  3. Final Answer:

    50 -> 70 -> 90 -> 100 -> 35 -> 20 -> 10 -> Option B
  4. Quick Check:

    SCAN goes to edge 100 before reversing [OK]
Quick Trick: SCAN always goes to disk edge before reversing [OK]
Common Mistakes:
MISTAKES
  • Not including disk edge in the path
  • Reversing direction too early
  • Skipping requests on the way

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More LLD Quizzes