Bird
0
0
LLDsystem_design~20 mins

Scheduling algorithm (SCAN, LOOK) in LLD - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Scheduling Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
How does the SCAN disk scheduling algorithm work?

Imagine a disk head moving over tracks numbered 0 to 199. The head is currently at track 50 and moving towards higher track numbers. The pending requests are at tracks 55, 58, 39, 18, and 90.

Which sequence of servicing requests correctly represents the SCAN algorithm's order?

A39, 18, 55, 58, 90
B55, 58, 90, 39, 18
C90, 58, 55, 39, 18
D55, 58, 90, 199 (end), 39, 18
Attempts:
2 left
💡 Hint

Think of the disk head moving in one direction servicing requests until it reaches the end, then reversing.

Architecture
intermediate
2:00remaining
Choosing between SCAN and LOOK for disk scheduling

You are designing a disk scheduling module for a system with frequent requests clustered near the middle tracks. Which algorithm between SCAN and LOOK is better to reduce unnecessary head movement and why?

ALOOK, because it only goes as far as the last request in each direction, avoiding unnecessary travel to disk ends.
BSCAN, because it always goes to the disk ends, ensuring fairness.
CLOOK, because it randomly jumps to requests to reduce wait time.
DSCAN, because it ignores requests near the middle to speed up processing.
Attempts:
2 left
💡 Hint

Consider how far the head moves in each algorithm.

scaling
advanced
2:00remaining
Scaling disk scheduling with high request volume

A disk scheduling system using SCAN is experiencing high request volume with requests spread across all tracks. What is a key architectural change to maintain low latency and throughput?

AImplement request queues partitioned by track ranges to parallelize scheduling and reduce head movement.
BSwitch to FIFO scheduling to simplify processing under load.
CIncrease disk rotation speed to reduce seek time without changing scheduling.
DUse random scheduling to distribute load evenly.
Attempts:
2 left
💡 Hint

Think about dividing work to handle many requests efficiently.

tradeoff
advanced
2:00remaining
Tradeoffs between SCAN and LOOK in real-time systems

In a real-time system requiring predictable maximum wait times, which disk scheduling algorithm is preferable and why?

ALOOK, because it prioritizes requests randomly for fairness.
BSCAN, because it always scans to the disk ends, providing a predictable maximum wait time.
CLOOK, because it skips empty tracks, reducing maximum wait time unpredictably.
DSCAN, because it ignores some requests to speed up processing.
Attempts:
2 left
💡 Hint

Consider which algorithm guarantees a maximum travel distance.

estimation
expert
3:00remaining
Estimating average seek time with LOOK scheduling

A disk has 200 tracks (0-199). Requests arrive uniformly at random. The disk head is currently at track 100. Using LOOK scheduling, estimate the average seek distance per request assuming a large number of requests.

AApproximately 0 tracks, because LOOK minimizes movement completely.
BApproximately 100 tracks, because the head always moves from one end to the other.
CApproximately 50 tracks, because LOOK moves only between the furthest requests, averaging half the disk range.
DApproximately 25 tracks, because requests cluster near the current head position.
Attempts:
2 left
💡 Hint

Think about the average distance between random points on a line segment.