GATE / CS ARCHIVE

SIMILAR QUESTIONS / OPERATING SYSTEMS

Trace shortest seek time first requests

3 questions solved the same way, newest first. Back to Operating Systems

How these are solved

Repeatedly choose the pending cylinder closest to the current head. 2009 derives total movement and seek time, 2014 counts requests before a target, and 2020 checks relative order/direction.

2 marks · MCQ
Report issue

I/O & Disk Scheduling

Question 35, GATE 2020: SSTF disk scheduling begins at cylinder 100 with requests P:155,Q:85,R:110,S:30,T:115. Which is false? A T before P; B Q after S but before T; C direction reverses between service of Q and P; D R before P.
Question 35, GATE 2020: SSTF disk scheduling begins at cylinder 100 with requests P:155,Q:85,R:110,S:30,T:115. Which is false? A T before P; B Q after S but before T; C direction reverses between service of Q and P; D R before P.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Worked explanation

Recompute the nearest remaining request after every move. From 100, distances to P,Q,R,S,T are 55,15,10,70,15, so R wins. From 110, T is 5 away; from 115, Q is 30 away versus P at 40 and S at 85, so Q wins. From 85, S is 55 away versus P at 70, so S wins, leaving P. The path is 100→110→115→85→30→155. T and R both precede P, and movement changes from decreasing to increasing at S between Q and P. B reverses the actual relation of Q to both S and T.

Derivation and answer

From100, nearest requests are R110 thenT115 thenQ85 thenS30 thenP155. The head distances for these choices are 10, 5, 30, 55, 125. Thus Q is before S and after T, making B false. The other assertions hold, including reversal at S between servicing Q andP.

Original paper, page 12 · Answer key

1 mark · NAT
Report issue

I/O & Disk Scheduling

Question 19, GATE 2014: A disk has cylinders 0 through 200. The arm is at 100, with pending requests 30,85,90,100,105,110,135,145. Under shortest-seek-time-first scheduling, how many requests are serviced before request 90?
Tap to enlarge
Answer & solution

Official answer: 3

1. Method and setup. At each step recompute distances from the current head position; SSTF is not a one-time sort by distance from 100. The request already at the head is a request serviced before any movement. Once at 110, compare the distances to 90 and 135 rather than continuing upward automatically.

2. Work through the result and its assumptions. SSTF first services the zero-distance request 100, then 105, then 110. From110, 90 is 20 cylinders away, closer than 135 at 25. Thus90 is serviced after 3 requests.

Original paper, page 12 · Answer key

2 marks · MCQ
Report issue

SSTF total disk movement

I/O & Disk Scheduling

Question 31, GATE 2009: A disk has 100 cylinders, head initially 50, all requests pending in listed order 4, 34, 10, 7, 19, 73, 2, 15, 6, 20. SSTF costs 1 ms per cylinder moved. Total seek time? A 95; B 119; C 233; D 276 ms.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Step through it (12 steps)

With all listed requests pending, SSTF visits 50→34→20→19→15→10→7→6→4→2→73. The decreasing leg costs 48 cylinders and the final increasing leg 71, totaling 119. At 1 ms per adjacent cylinder the seek time is 119 ms, B, excluding unspecified transfer/rotation costs.

At 50, the nearest pending request is 34 (distance 16), not 73 (distance 23). From 34 choose 20, then 19, 15, 10, 7, 6, 4, 2, always the nearest remaining cylinder. This monotone descent costs 50−2=48 in total. Only 73 then remains, costing 73−2=71. Total movement 119 times 1 ms gives 119 ms. Initial request order is irrelevant after all are pending under SSTF; FCFS would follow that order and produce a different answer.

Original paper, page 7