0
0
Operating Systemsknowledge~20 mins

SCAN (elevator algorithm) in Operating Systems - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
SCAN Algorithm Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does the SCAN (elevator) algorithm decide the direction of disk head movement?

The SCAN algorithm moves the disk head in one direction servicing requests until it reaches the end, then reverses direction. What determines the initial direction of the disk head movement?

AIt starts moving in the direction of the closest pending request from the current head position.
BIt always starts moving towards the lowest track number first.
CIt moves randomly either towards the highest or lowest track number.
DIt always starts moving towards the highest track number first.
Attempts:
2 left
💡 Hint

Think about how the algorithm minimizes seek time by choosing the nearest request direction.

🚀 Application
intermediate
2:00remaining
Calculate total head movement using SCAN algorithm

Given a disk with 200 tracks (0-199), the disk head is currently at track 50, and the pending requests are at tracks 20, 90, 150, and 180. If the head moves towards the higher track numbers first, what is the total head movement (in tracks) to service all requests using the SCAN algorithm?

A280 tracks
B230 tracks
C260 tracks
D290 tracks
Attempts:
2 left
💡 Hint

Remember the head moves up to the highest request or end, then reverses to service remaining requests.

🔍 Analysis
advanced
2:00remaining
Compare SCAN and LOOK algorithms in disk scheduling

Which of the following statements correctly describes a key difference between the SCAN and LOOK disk scheduling algorithms?

ALOOK moves the head to the end of the disk regardless of requests, while SCAN only moves as far as the last request in each direction.
BBoth SCAN and LOOK always move the head to the end of the disk before reversing direction.
CSCAN moves the head to the end of the disk regardless of requests, while LOOK only moves as far as the last request in each direction.
DNeither SCAN nor LOOK reverses direction; they both move in a circular pattern.
Attempts:
2 left
💡 Hint

Consider how far the head travels in each algorithm relative to pending requests.

Reasoning
advanced
2:00remaining
Why does SCAN algorithm reduce starvation compared to SSTF?

Starvation happens when some requests wait indefinitely. Why does the SCAN algorithm reduce starvation compared to the Shortest Seek Time First (SSTF) algorithm?

ABecause SCAN always picks the closest request next, like SSTF, so starvation is the same.
BBecause SCAN services requests in a fixed direction order, ensuring all requests are eventually reached.
CBecause SCAN ignores requests at the ends of the disk, focusing only on the middle tracks.
DBecause SCAN randomly selects requests to service, preventing starvation.
Attempts:
2 left
💡 Hint

Think about how SCAN moves the head systematically across the disk.

📋 Factual
expert
2:00remaining
Identify the output of SCAN algorithm with given requests and head position

Consider a disk with tracks numbered 0 to 199. The disk head is at track 100. Pending requests are at tracks 95, 180, 34, 119, and 11. The SCAN algorithm moves towards the lower track numbers first. What is the order in which the requests will be serviced?

A95, 34, 11, 119, 180
B95, 34, 11, 180, 119
C11, 34, 95, 119, 180
D180, 119, 95, 34, 11
Attempts:
2 left
💡 Hint

Remember SCAN moves in one direction servicing requests, then reverses.