GATE / CS ARCHIVE

SUBJECT COLLECTION

Operating Systems · I/O & Disk Scheduling

27 questions, newest first

GATE CSE has asked 27 questions on I/O & Disk Scheduling (Operating Systems) from 1992 to 2020, in 18 of the 46 papers; the most recent is in GATE CSE 2020. In the last five years it carried 0 marks per 100-mark paper on average, against 0.6 since 2003. Since 2014 the questions have been 5 NAT and 1 MCQ. 3 groups of questions here are solved the same way; “One per method” keeps the newest of each.

Browse topics
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

2 marks · NAT
Report issue

SSTF movement and reversal costs

I/O & Disk Scheduling

Question 53, GATE 2018: Disk has 4 platters, 200 cylinders and 256 sectors/track. Requests [sector,cylinder,platter]: [120,72,2],[180,134,1],[60,20,0],[212,86,3],[56,116,2],[118,16,1]. Head starts sector 100,cylinder 80 moving upward. SSTF movement costs are stated as 20 mW per 100 cylinders plus 15 mW per reversal; rotation/platter costs ignored. Find the intended total.
Tap to enlarge
Answer & solution

Official answer: 85

Our answer: 85 under the stated additive-cost convention

Step through it (8 steps)

Method

SSTF chooses nearest pending cylinder, not the next request in the current direction. At 80 choose 86 (6 away), then 72 (14 away). From 72, 116 is 44 away versus 20 at 52; then 134 is nearest. The remaining requests are 20 and 16. Direction is up, down, up, up, down, down, so there are three reversals relative to the initially upward head. Sector and platter numbers do not affect the stipulated cost model.

Solution

SSTF chooses cylinders 80→86→72→116→134→20→16, with distances 6, 14, 44, 18, 114, 4 totaling 200. The head starts upward and reverses at 86, 72, 134, three times. Treating the supplied numbers as additive movement costs gives(200/100)*20+3*15=85, the official answer. Physical power in milliwatts cannot in general be added over sequential operations to obtain total consumption; energy or a time-based average would require durations and appropriate units. Thus85 is the intended numerical cost, not a dimensionally justified physical power calculation.

Original paper, page 22 · Answer key

2 marks · NAT
Report issue

I/O & Disk Scheduling

Question 48, GATE 2016: A disk has cylinders 0–199 and pending requests 47,38,121,191,87,11,92,10. Its head starts at 63 moving upward. Using C-LOOK, find the total cylinder movement to service all requests, including the wrap movement.
Tap to enlarge
Answer & solution

Official answer: 346.0 : 346.0

Our answer: 346

Step through it (10 steps)

C-LOOK services 87, 92,121,191 on the upward pass, wraps directly to 10, then services 11, 38, 47. Movement is(191−63)+(191−10)+(47−10)=128+181+37=346 cylinders. The wrap is physical head movement and counts; the head does not visit unrequested endpoints 0 or 199.

Sort upward requests as 87,92,121,191 and below-head requests as 10,11,38,47. C-LOOK wraps from the highest pending request directly to the lowest pending request and resumes upward service, unlike C-SCAN which visits physical endpoints. The individual moves are 24,5,29,70,181,1,27,9; their sum 346 matches the compact span calculation. The large jump services no intermediate request but is still physical head travel, so excluding it would undercount.

Original paper, page 18 · Answer key

2 marks · NAT
Report issue

I/O & Disk Scheduling

Question 50, GATE 2016: A disk-block cache has 1 ms hit latency and 10 ms disk-read latency; cache checking is negligible. Sizes are multiples of 10 MB. Graph points (size MB,miss %): (10,80),(20,60),(30,40),(40,35),(50,30),(60,25),(70,20),(80,15). Find the smallest size with average latency strictly below 6 ms.
Tap to enlarge
Answer & solution

Official answer: 30.0 : 30.0

Our answer: 30

With negligible lookup-check cost, average latency is(1−m)*1+m*10=1+9m milliseconds, requiring m<5/9. The graph gives miss rates 80% at 10MB, 60% at 20MB and 40% at 30MB. Thus20MB gives 6.4ms and 30MB gives 4.6ms; the smallest allowed size is 30MB.

At 10,20,30 MB the weighted delays are 8.2,6.4,4.6 ms. The target threshold is miss probability below 0.555…, not hit probability below that number. Since cache sizes are discrete multiples of 10 MB, interpolation to a value between 20 and 30 is not an allowed answer. The stipulated negligible lookup cost avoids charging a cache read again on each miss.

Original paper, page 41 · Answer key

2 marks · NAT
Report issue

I/O & Disk Scheduling

Question 56, GATE 2015: Disk has 100 tracks. Pending sequence: 45,20,90,10,50,60,80,25,70. Initial head=50. Find extra travel by SSTF compared with SCAN, initially moving towards 100.
Tap to enlarge
Answer & solution

Official answer: 10

Our answer: Official10 uses LOOK; true SCAN difference is−10 with endpoint 100

SSTF repeatedly chooses the nearest pending track, producing total 130. In an upward sweep followed by reversal at the highest request, travel is 50→90→10, or 120; this is LOOK and yields the published +10. SCAN conventionally visits the physical end before reversing. Ending the accounting at the last served request 10 gives 140 if the upper end is 100, or 138 if tracks are 0–99. Therefore literal SSTF−SCAN is −10 or−8 under those conventions. The source's positive answer remains recorded but must not be presented as an unqualified SCAN derivation.

Solution: SSTF services 50, 45, 60, 70, 80, 90, 25, 20, 10, with movements 0+5+15+10+10+10+65+5+10=130. Reversing at the last pending upper request 90 gives(90−50)+(90−10)=120, so SSTF exceeds that LOOK distance by 10, the published answer. True SCAN continues to the disk endpoint before reversing: using endpoint 100 gives(100−50)+(100−10)=140 and SSTF−SCAN=−10. If100 tracks means 0..99, SCAN gives 138 and the difference is−8. The stated SCAN name/endpoints do not support the published positive 10 without a LOOK-style convention.

Original paper, page 21 · 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
Not in GATE 2027 syllabusReport issue

Random library loads and disk latency

I/O & Disk Scheduling

Question 44, GATE 2011: An application loads 100 libraries at startup. Each takes one disk access to a random location. Average seek time is 10 ms and rotational speed is 6000 rpm. Neglect data-transfer time once positioned at the block. What is the expected total load time?

(A) 0.50 s
(B) 1.50 s
(C) 1.25 s
(D) 1.00 s
Tap to enlarge
Your answer
Answer & solution

Official answer: B

At 6000 rpm the disk makes 100 revolutions per second, so one revolution lasts 10 ms. Random angular position gives an average rotational latency of 5 ms. Each library requires one access with 10 ms seek time plus 5 ms average rotational latency; transfer time is neglected. The total expected loading time is 100×15 ms=1500 ms=1.50 s, option B. The random-location wording calls for average rotational latency, not a full revolution per access.

Convert rpm to revolutions per second before computing time: 6000/60=100. Uniform random angular placement means the desired sector can be anywhere from just under the head to nearly a full revolution away, averaging half a turn. Seek and rotational wait occur for each of the 100 distinct accesses, so both contributions must be counted 100 times. The expected seek total is 1 second and expected rotation total is 0.5 second; ignoring either would select an incorrect smaller answer.

Original paper, page 11 · 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

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Convert cylinder-head-sector address

I/O & Disk Scheduling

Question 51, GATE 2009: Disk has 63 sectors/track, 10 platters with 2 surfaces each, 1000 cylinders. Zero-based address(c, h, s) orders sectors then surfaces then cylinders. Convert(400, 16, 29) to linear sector index: A 505035; B 505036; C 505037; D 505038.
Question 51, GATE 2009: Disk has 63 sectors/track, 10 platters with 2 surfaces each, 1000 cylinders. Zero-based address(c, h, s) orders sectors then surfaces then cylinders. Convert(400, 16, 29) to linear sector index: A 505035; B 505036; C 505037; D 505038.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

There are 10×2=20 recording surfaces, hence 20 tracks per cylinder. With 63 sectors per track and all indices starting at zero, linear sector index = ((c×20)+h)×63+s. For (400, 16, 29) this is (8000+16)×63+29=505008+29=505037, option C. No one-based correction applies because the shared statement explicitly labels the first sector (0, 0, 0) as sector 0.

There are 20 tracks per cylinder because each recording surface supplies one track at that radius. Convert cylinder and surface to track index 400·20+16=8016. Convert to sector index 8016·63+29=505037. Every multiplication moves one level down the address hierarchy. The explicit zero-based convention means no extra 1 is added at the end.

Original paper, page 11

2 marks · MCQ
Not in GATE 2027 syllabusReport issue

Convert sector number to disk address

I/O & Disk Scheduling

Question 52, GATE 2009: For the same disk with 20 surfaces/cylinder and 63 sectors/track, convert zero-based linear sector 1039 to(c, h, s): A(0, 15, 31); B(0, 16, 30); C(0, 16, 31); D(0, 17, 31).
Question 52, GATE 2009: For the same disk with 20 surfaces/cylinder and 63 sectors/track, convert zero-based linear sector 1039 to(c, h, s): A(0, 15, 31); B(0, 16, 30); C(0, 16, 31); D(0, 17, 31).
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

Each cylinder contains 20×63=1260 sectors. Divide 1039 by 1260: cylinder c=0 with remainder 1039. Then 1039=16×63+31, giving surface h=16 and sector s=31. Thus the address is (0, 16, 31), option C. This uses the zero-based indexing explicitly defined in the common data on physical page 11.

Invert the mixed-radix calculation. One cylinder spans 1260 sectors, so 1039 lies in cylinder 0. Divide the remainder by 63: quotient 16 is the surface and remainder 31 is the sector. Check by recomposition:((0·20)+16)·63+31=1039. This is C; options differing by one reveal the common mistake of silently switching to one-based counting.

Original paper, page 12

2 marks · MCQ
Report issue

Synchronous versus asynchronous I/O

I/O & Disk Scheduling

Question 64, GATE 2008: Which statement about synchronous/asynchronous I/O is NOT true in the interrupt-driven model?

(A) An ISR is invoked on synchronous completion but not asynchronous completion
(B) Both synchronous and asynchronous I/O invoke an ISR after completion
(C) Synchronous callers wait for completion; asynchronous callers do not
(D) For synchronous I/O, the completion ISR wakes the waiting process
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

1. In the intended interrupt-driven I/O model, both synchronous and asynchronous operations can invoke an ISR on completion. Synchronous versus asynchronous describes whether the requesting process waits, not whether completion interrupts exist.
2. Hence A is the false statement; B, C and D describe the model. More generally I/O can be polled, so interrupt use is an assumed implementation detail rather than a universal consequence of synchronous/asynchronous semantics.

Original paper, page 13

1 mark · MCQ
Report issue

Protecting memory-mapped input output

I/O & Disk Scheduling

Question 20, GATE 2005: With memory-mapped I/O and no separate privileged I/O opcodes, what enforces device-access protection? A OS routines alone; B hardware trap; C system configuration alone; D protection impossible.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Map device registers into protected address ranges/pages and have the processor’s memory-protection hardware trap unauthorized user-mode loads or stores. Thus the immediate enforcement is a hardware trap, B, although the operating system configures the permissions and handles the exception. Ordinary unprivileged load/store opcodes do not bypass address protection.

Memory-mapped device registers occupy addresses just like memory. The OS configures access permissions, but hardware checks each user access and raises a protection exception if forbidden. This immediate trap prevents bypassing the OS merely by issuing a load/store instruction. A software routine alone cannot intercept an unchecked direct memory access, so B names enforcement, while configuration establishes policy.

Original paper, page 3

1 mark · MCQ
Report issue

Disk scheduling with one outstanding request

I/O & Disk Scheduling

Question 12, GATE 2004: An OS can load and execute one sequential user process at a time. FCFS disk scheduling is replaced by SSTF, advertised as giving 50% better benchmark performance. What improvement in user-program I/O performance is expected? The usual one-outstanding-request assumption is not explicitly stated.
Options:
(A) 50%
(B) 40%
(C) 25%
(D) 0%
Question 12, GATE 2004: An OS can load and execute one sequential user process at a time. FCFS disk scheduling is replaced by SSTF, advertised as giving 50% better benchmark performance. What improvement in user-program I/O performance is expected? The usual one-outstanding-request assumption is not explicitly stated.
Options:
(A) 50%
(B) 40%
(C) 25%
(D) 0%
Tap to enlarge
Your answer
Answer & solution

Answer: D under synchronous single-request I/O (no official key was published)

1. If the single sequential process blocks for each disk request, there is never a choice among queued requests. FCFS and SSTF therefore execute the same sequence, giving 0% improvement, D; a benchmark with concurrency does not transfer to this case.

2. The premise of one sequential process alone does not prohibit asynchronous I/O, readahead or background requests. Without the one-outstanding-request assumption, the improvement is not determined by the stated facts.

3. Teaching check: A seek scheduler can improve ordering only when it can choose between multiple pending requests. With exactly one pending request, both rules choose it. “50% better” on another workload is not evidence for this workload; asynchronous requests would require further information.

Original paper, page 2

1 mark · MCQ
Report issue

Which component requires a device driver

I/O & Disk Scheduling

Question 1.22, GATE 2001: Which component normally requires a device driver: a CPU register, cache, main memory, or disk?
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step 1: A device driver translates OS requests into device-controller operations, handles completion/error reporting, and coordinates the peripheral’s interface. A disk has such an interface and requires a storage driver.

Step 2: CPU registers and ordinary cache are accessed or managed by processor mechanisms, while normal main-memory access is part of the memory architecture rather than a disk-style peripheral protocol.

Thus D is the intended distinction. Memory management software exists, but that does not make it the device driver meant in this question.

Original paper, page 3

Descriptive
Report issue

Compute elevator seek time

I/O & Disk Scheduling

Question 20(a), GATE 2001: Disk has tracks 0–99, rotates at 3000 rpm, has 100 sectors per track and takes 0.2 ms to move one track. Requests are tracks 32,7,45,5,10; head starts at 25 moving upward.
Question 20(a), GATE 2001: Disk has tracks 0–99, rotates at 3000 rpm, has 100 sectors per track and takes 0.2 ms to move one track. Requests are tracks 32,7,45,5,10; head starts at 25 moving upward.
Question 20(a), GATE 2001: Disk has tracks 0–99, rotates at 3000 rpm, has 100 sectors per track and takes 0.2 ms to move one track. Requests are tracks 32,7,45,5,10; head starts at 25 moving upward.
Tap to enlarge
Answer & solution

Answer: SCAN: 33.6 ms; LOOK interpretation: 12 ms. (no official key was published)

Under strict SCAN, continue toward the physical end 99 before reversing. Requests are served in order 32,45,10,7,5, with traversal 25→32→45→99→10→7→5. Distance is (99−25)+(99−5)=74+94=168 tracks. Multiply by 0.2 ms/track to get 33.6 ms. Stop measuring once the final request at 5 is served; there is no need to continue to 0.

Some textbooks use “elevator” for LOOK, which reverses at the last pending request, 45, rather than at track 99. That traversal covers (45−25)+(45−5)=20+40=60 tracks, giving 12 ms. The source does not explicitly distinguish these conventions, so both are reported with their policies. Rotation rate and sector count do not enter a seek-time-only answer.

Original paper, page 10

Descriptive
Report issue

Bound completion time for disk requests

I/O & Disk Scheduling

Question 20(b), GATE 2001: Disk has tracks 0–99, rotates at 3000 rpm, has 100 sectors per track and takes 0.2 ms to move one track. Initially 100 arbitrary requests, no new arrivals, head starts at track 0; determine worst-case completion time under elevator scheduling.
Question 20(b), GATE 2001: Disk has tracks 0–99, rotates at 3000 rpm, has 100 sectors per track and takes 0.2 ms to move one track. Initially 100 arbitrary requests, no new arrivals, head starts at track 0; determine worst-case completion time under elevator scheduling.
Question 20(b), GATE 2001: Disk has tracks 0–99, rotates at 3000 rpm, has 100 sectors per track and takes 0.2 ms to move one track. Initially 100 arbitrary requests, no new arrivals, head starts at track 0; determine worst-case completion time under elevator scheduling.
Tap to enlarge
Answer & solution

Answer: Seek-only maximum 19.8 ms. Under a conventional one-sector/request bound, total ≤2039.8 ms (see assumptions). (no official key was published)

Starting at the lowest track, all requests can be served in one upward sweep. The maximum head travel is 99 tracks, so seek time is at most 99×0.2=19.8 ms, attained if a request is at track 99. A revolution takes 60/3000 seconds=20 ms, and a single sector transfer takes 20/100=0.2 ms.

If each request reads one sector and one charges a separate worst-case rotational wait of up to one full revolution to every request, an additive bound is 19.8+100×(20+0.2)=2039.8 ms. A uniform-random-phase average latency would be 10 ms, yielding a different, average-model value 1039.8 ms; it is not a worst-case answer. If a convention counts a complete revolution as covering both wait and the requested sector transfer, the bound is instead 19.8+100×20=2019.8 ms.

The printed request description does not specify bytes/sectors per request, sector ordering at one track, or a rotational-latency convention. Therefore it does not determine a unique exact total completion time. The 19.8 ms seek bound is unambiguous; any fuller time must state its service assumptions. Independent per-request latency maxima are a conservative additive bound, not a proof that a single finite queue attains every maximum simultaneously.

Original paper, page 10

1 mark · MCQ
Not in GATE 2027 syllabusReport issue

Seek-based disk throughput

I/O & Disk Scheduling

Question 1.10, GATE 1999: Which is likely to provide best throughput: farthest cylinder next, nearest cylinder next, FCFS, or elevator?
Tap to enlarge
Your answer
Answer & solution

Answer: B under the usual seek-dominated comparison (no official key was published)

Nearest-cylinder-next, or SSTF, chooses the pending request needing the least immediate head movement. Shorter seeks usually reduce service time and allow more requests per unit time, motivating B. FCFS ignores position; farthest-next deliberately increases movement. Elevator scheduling trades some local seek economy for orderly service and better fairness. The question says likely, not universally optimal: arrivals, rotational latency and starvation can change observed performance, so this is a conventional workload judgment rather than a theorem for every request sequence.

Original paper, page 2

1 mark · MCQ
Report issue

A spooled device

I/O & Disk Scheduling

Question 1.29, GATE 1998: Which is a spooled device: interactive input terminal, printer serving multiple jobs, virtual-memory backing storage, or swap area?
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Spooling first records output in a queue, usually on disk, and a service process feeds one job at a time to a device. A printer shared by many jobs is the standard example, B: jobs can finish producing output without holding the printer throughout. Paging and swapping also use disk, but their purpose is memory management rather than queued job output. Interactive terminal input is not the listed spooling example.

Original paper, page 3

5 marks · Descriptive
Report issue

Floppy read-time assumptions

I/O & Disk Scheduling

Question 17, GATE 1998: Read 35 sectors on a soft-sectored, two-sided floppy, 8 sectors/track, 8 ms track step, 300 rpm, starting sector 3 of track 10 with head initially on track 10. Controller has one-sector buffer. Find total time.
Tap to enlarge
Answer & solution

Answer: 875 ms transfer time; a unique total needs rotational phase, layout/skew and servicing assumptions. (no official key was published)

One revolution takes 60/300=0.2 s=200 ms, so a sector takes 200/8=25 ms. Reading the 35 payload sectors therefore needs 35×25=875 ms of on-media transfer. Starting at sector 3, the track portions contain 6,8,8,8,5 sectors, so five surface-tracks are visited and four surface-track boundaries crossed.

A two-sided disk does not necessarily seek at all four boundaries. With cylinder-major allocation starting on side 0, the order is cylinder 10 side 0, cylinder 10 side 1, cylinder 11 side 0, cylinder 11 side 1, cylinder 12 side 0. Ignoring head-switch time, this requires two radial steps, totaling 16 ms. A simplified additive estimate with no initial or boundary rotational waiting is then 891 ms. If 'track' instead means successive tracks of one surface requiring four steps, the corresponding estimate is 907 ms.

Neither estimate is an unconditional exact answer. The initial angular position is not specified. Without track skew, an 8 ms seek after sector 8 can miss the start of sector 1, requiring a wait for its next revolution. Under the cylinder-major example, zero initial wait, aligned sector numbering and instantaneous head switches, each of the two step boundaries costs an entire 200 ms including seek plus rotational wait, giving 875+400=1275 ms. A suitably skewed layout changes that boundary cost.

Finally, a one-sector buffer does not specify how quickly the host drains it. Missing the next sector while transferring a buffer can add whole rotations. A defensible expression is 875 ms + initial rotational wait + radial-step time + head-switch time + boundary/buffer waiting. The supplied facts fix only some terms, so report assumptions rather than invent an exact total.

Original paper, page 7

Descriptive
Report issue

Contiguous file disk address

I/O & Disk Scheduling

Question 25(b), GATE 1998: A disk has C cylinders,t tracks/cylinder,s sectors/track, sector length sl. A contiguous file begins at (cL,tL,sL), with record length rl=sl. Derive cylinder,track,sector of logical record n.
Question 25(b), GATE 1998: A disk has C cylinders,t tracks/cylinder,s sectors/track, sector length sl. A contiguous file begins at (cL,tL,sL), with record length rl=sl. Derive cylinder,track,sector of logical record n.
Tap to enlarge
Answer & solution

Answer: For zero-based disk coordinates and one-based n, j=((cL*t+tL)*s+sL)+(n−1); decode j by division. (no official key was published)

Assume disk coordinates cL,tL,sL are zero-based, records are numbered from 1, and the file starts at a sector boundary. Since each record equals one sector, record n is n−1 sectors beyond the initial address. Linearize the starting location as j0=(cL*t+tL)*s+sL and set j=j0+n−1.

Then cylinder=floor(j/(t*s)); within-cylinder remainder r=j mod(t*s); track=floor(r/s); sector=r mod s. These divisions automatically carry across track and cylinder boundaries. For n=1, quotient/remainder reconstruction returns exactly the starting triple. Crossing a sector boundary from s−1 adds one track; crossing track t−1 adds one cylinder.

Require 0≤j<C*t*s so the record fits on the disk. If sector labels are one-based, replace the starting sL by sL−1 before linearization and add 1 to the final sector result. If all three disk labels are one-based, first subtract 1 from each and then add 1 to each output. If records themselves are numbered from zero, use n rather than n−1. Without these conventions an off-by-one ambiguity remains; the physical addressing rule is otherwise the same.

Original paper, page 8

1 mark · MCQ
Report issue

Input redirection

I/O & Disk Scheduling

Question 3.7, GATE 1997: Does I/O redirection rename files, allow an existing file to supply program input, necessarily connect two programs by a pipe, or none?
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

Redirection changes where a program’s input/output stream is connected. For example, connecting standard input to an existing file lets a program read that file using its usual input operations, which is B. The file need not be renamed. A pipe connects streams between processes and is related but distinct; redirection to a regular file does not require a second program. Therefore C is not a necessary description.

Original paper, page 3

1 mark · Descriptive
Report issue

Sequential record time without buffering

I/O & Disk Scheduling

Question 74(a), GATE 1997: A program processes 1000 consecutive records of a sequential file on a device, without file-system facilities. Each record is 3200 bytes. Device access time is 10 ms per read; transfer rate is 800×10^3 bytes/s; CPU processing time is 3 ms per record. Copying a record from a buffer to a local variable takes negligible CPU time. Ignore additional overhead, and include startup and final processing time. Records are unblocked and the program uses no buffering. Find elapsed time.
Question 74(a), GATE 1997: A program processes 1000 consecutive records of a sequential file on a device, without file-system facilities. Each record is 3200 bytes. Device access time is 10 ms per read; transfer rate is 800×10^3 bytes/s; CPU processing time is 3 ms per record. Copying a record from a buffer to a local variable takes negligible CPU time. Ignore additional overhead, and include startup and final processing time. Records are unblocked and the program uses no buffering. Find elapsed time.
Question 74(a), GATE 1997: A program processes 1000 consecutive records of a sequential file on a device, without file-system facilities. Each record is 3200 bytes. Device access time is 10 ms per read; transfer rate is 800×10^3 bytes/s; CPU processing time is 3 ms per record. Copying a record from a buffer to a local variable takes negligible CPU time. Ignore additional overhead, and include startup and final processing time. Records are unblocked and the program uses no buffering. Find elapsed time.
Tap to enlarge
Answer & solution

Answer: 17,000 ms = 17 s. (no official key was published)

One record's transfer time is its byte count divided by the byte rate:
3200/(800×103) seconds = 0.004 seconds = 4 ms.
The 10 ms access time is a separate per-read cost, so reading one unblocked record takes 10+4=14 ms. With no buffering, the program reads a record, waits for that read to finish, processes it for 3 ms, and only then starts the next record's read.

The per-record serial schedule is therefore [10 ms access][4 ms transfer][3 ms processing], lasting 17 ms. Repeating it for 1000 records gives 1000×17=17,000 ms=17 seconds. The first record's access and the last record's processing are already included, so no extra startup or drain term should be appended.

The word consecutive does not by itself remove the explicitly supplied access cost. The usual model of this question charges one access for each unblocked read; a continuous streaming device model that pays access only once would be a different assumption. Likewise, the rate is in bytes per second, so no factor of eight belongs in the calculation. The result uses the decimal rate 800×103 exactly as printed.

Without read-ahead storage there is no valid overlap between reading the next record and processing the current one in this model. Using max(14,3) per record would silently introduce buffering, which is the separate next part of the question.

Original paper, page 11

2 marks · Descriptive
Report issue

One-record read-ahead overlap

I/O & Disk Scheduling

Question 74(b), GATE 1997: A program processes 1000 consecutive records of a sequential file on a device, without file-system facilities. Each record is 3200 bytes. Device access time is 10 ms per read; transfer rate is 800×10^3 bytes/s; CPU processing time is 3 ms per record. Copying a record from a buffer to a local variable takes negligible CPU time. Ignore additional overhead, and include startup and final processing time. Records are unblocked and the program uses one buffer, always reading ahead into it. Find elapsed time.
Question 74(b), GATE 1997: A program processes 1000 consecutive records of a sequential file on a device, without file-system facilities. Each record is 3200 bytes. Device access time is 10 ms per read; transfer rate is 800×10^3 bytes/s; CPU processing time is 3 ms per record. Copying a record from a buffer to a local variable takes negligible CPU time. Ignore additional overhead, and include startup and final processing time. Records are unblocked and the program uses one buffer, always reading ahead into it. Find elapsed time.
Question 74(b), GATE 1997: A program processes 1000 consecutive records of a sequential file on a device, without file-system facilities. Each record is 3200 bytes. Device access time is 10 ms per read; transfer rate is 800×10^3 bytes/s; CPU processing time is 3 ms per record. Copying a record from a buffer to a local variable takes negligible CPU time. Ignore additional overhead, and include startup and final processing time. Records are unblocked and the program uses one buffer, always reading ahead into it. Find elapsed time.
Tap to enlarge
Answer & solution

Answer: 14,003 ms = 14.003 s, under the stated ideal one-buffer read-ahead model. (no official key was published)

A record read takes 10 ms access plus 3200/(800×103) seconds transfer, or 14 ms total. The first read fills the buffer at t=14 ms. Copy record 1 into the program's local record variable at negligible cost, freeing the buffer immediately. The device can now read record 2 while the CPU processes record 1.

The timeline begins:
0–14 ms: read record 1; CPU has no record yet.
14–17 ms: process local record 1; read record 2 during 14–28 ms.
28–31 ms: process local record 2; read record 3 during 28–42 ms.

Because each read lasts 14 ms and each computation only 3 ms, the CPU finishes before the next record arrives. Record k is available at 14k ms. The final record, number 1000, arrives at 14,000 ms and must still be processed for 3 ms. Total elapsed time is 14,000+3=14,003 ms.

Equivalently, for N records, read time I and compute time C, this ideal single-record-buffer/local-variable pipeline takes I+(N−1)max(I,C)+C. Here it becomes 14+999×14+3. This formula includes the initial fill and final drain. The common shortcut N×max(I,C) would miss the last 3 ms.

One buffer is enough because the current record is moved out of that buffer before processing; CPU work uses the local copy while the device writes the next record to the buffer. This is not the same as processing in place in the sole buffer, which would prevent safe read-ahead. The source's negligible-copy assumption is what permits the overlap.

Original paper, page 11

2 marks · Descriptive
Report issue

Single-buffer timing

I/O & Disk Scheduling

Question 74(c), GATE 1997: A program processes 1000 consecutive records of a sequential file on a device, without file-system facilities. Each record is 3200 bytes. Device access time is 10 ms per read; transfer rate is 800×10^3 bytes/s; CPU processing time is 3 ms per record. Copying a record from a buffer to a local variable takes negligible CPU time. Ignore additional overhead, and include startup and final processing time. The file uses blocking factor 2: each device block contains two records. The program uses one buffer. Find elapsed time, explicitly stating when the next read may begin and whether the program can retain a whole block outside the buffer.
Question 74(c), GATE 1997: A program processes 1000 consecutive records of a sequential file on a device, without file-system facilities. Each record is 3200 bytes. Device access time is 10 ms per read; transfer rate is 800×10^3 bytes/s; CPU processing time is 3 ms per record. Copying a record from a buffer to a local variable takes negligible CPU time. Ignore additional overhead, and include startup and final processing time. The file uses blocking factor 2: each device block contains two records. The program uses one buffer. Find elapsed time, explicitly stating when the next read may begin and whether the program can retain a whole block outside the buffer.
Question 74(c), GATE 1997: A program processes 1000 consecutive records of a sequential file on a device, without file-system facilities. Each record is 3200 bytes. Device access time is 10 ms per read; transfer rate is 800×10^3 bytes/s; CPU processing time is 3 ms per record. Copying a record from a buffer to a local variable takes negligible CPU time. Ignore additional overhead, and include startup and final processing time. The file uses blocking factor 2: each device block contains two records. The program uses one buffer. Find elapsed time, explicitly stating when the next read may begin and whether the program can retain a whole block outside the buffer.
Tap to enlarge
Answer & solution

Answer: 10.503 s with one-record local storage and reads starting only after the whole buffer is free; 9.006 s with whole-block staging or early overlap (no official key was published)

There are 1000/2=500 blocks. Each block holds 6400 bytes, so its transfer takes 6400/(800×103)=0.008 s=8 ms. Including the 10 ms access, one block read takes I=18 ms. Processing its two records takes 6 ms total. The words one buffer do not alone determine how the unread second record is protected while another read is started.

Model 1: one block buffer, one-record local variable, and a new block-read operation starts only after the buffer is entirely free. The first block arrives at t=18 ms. Copy record 1 locally and process it during 18–21. Record 2 must remain in the buffer during that computation. At 21, copy record 2 locally; the buffer is now free, so start the second block read during 21–39 while processing record 2 during 21–24. Thus each block arrival is 21 ms after the preceding one, not 18 ms: three CPU milliseconds are needed before the unread second record can leave the buffer.

The kth block arrives at 18+(k−1)×21 ms. For block 500 this is 10,497 ms. After it arrives, both final records still require 6 ms, giving 18+499×21+6=10,503 ms=10.503 s. Only the last record of each nonfinal block overlaps the following read. This schedule never overwrites a record that has not been copied out.

Model 2: copy the whole two-record block into separate local staging at negligible cost, releasing the input buffer immediately. Then all 6 ms of computation can overlap the following 18 ms read. The pipeline time is 18+499×max(18,6)+6=9006 ms=9.006 s. This model needs enough staging for two records, not just the single local record explicitly used in Model 1.

A second way to attain 9.006 s is to allow the next device access phase to begin before the buffer is free, while delaying actual writes until it is safe. Start the next 10 ms access immediately when the prior block arrives. The buffer's remaining record is copied out after 3 ms, well before the subsequent 8 ms transfer begins. Block arrivals can then remain 18 ms apart even with one-record local storage. That requires an I/O interface/scheduler that supports this early access, which the question does not explicitly describe.

Accordingly 9.006 s is the conventional whole-block-pipeline result, and 10.503 s is the stricter one-record/cannot-start-until-free result. Neither should be presented as unconditionally forced by the supplied wording. The distinction is about storage and I/O scheduling, not the arithmetic of the 18 ms block read.

Original paper, page 11

1 mark · MCQ
Report issue

A spooled output device

I/O & Disk Scheduling

Question 1.20, GATE 1996: Which listed device is naturally served by spooling?
Tap to enlarge
Your answer
Answer & solution

Answer: A: line printer (no official key was published)

A printer consumes output serially and relatively slowly. Spooling first stores each job in a disk-backed queue, allowing producing processes to continue while a spooler feeds complete jobs to the device in order. This avoids intermixing different jobs and decouples application execution from printing speed. A line printer is therefore the standard example. Spooling is not merely a CPU cache or an arbitrary buffer: its key role here is queued management of an exclusive sequential output device.

Original paper, page 3

5 marks · Descriptive
Report issue

Comparing FCFS and SSTF head travel

I/O & Disk Scheduling

Question 20, GATE 1995: A disk has tracks 0–99. Its head is at track 55, and the pending FIFO queue is 10,70,75,23,65. Calculate total head movement for FCFS and SSTF and say which is smaller.
Tap to enlarge
Answer & solution

Answer: FCFS:204 tracks. SSTF:85 tracks. SSTF saves 119 tracks. (no official key was published)

Step through it (2 schedules)

Head movement is the sum of absolute differences between consecutive serviced track numbers, including the initial position. FCFS must preserve arrival order: 55→10→70→75→23→65. Its successive movements are 45,60,5,52,42, totaling 204 tracks.

SSTF repeatedly chooses the nearest pending request from the current position, not the request nearest the original position. From55 the distances to 10,70,75,23,65 are 45,15,20,32,10, so choose 65. From65 choose 70 (distance 5), then 75 (distance 5). Of the remaining tracks 23 and 10, track 23 is 52 away and 10 is 65 away, so service 23 then 10. Thus the route is 55→65→70→75→23→10, and the total is 10+5+5+52+13=85. There are no distance ties in this instance.

SSTF therefore requires 119 fewer track movements, assuming seek effort is being compared by track distance. Neither algorithm requires a sweep to track 0 or 99; that would be a different scheduling policy. No return to the starting track is requested. The conclusion concerns this finite queue, not a claim that SSTF prevents starvation or always optimizes every possible workload.

Original paper, page 8

Report issue

A spooled device

I/O & Disk Scheduling

Question 2(xii), GATE 1992: Which is a spooled-device example: interactive input terminal, virtual-memory backing store, line printer serving jobs, or none?
Question 2(xii), GATE 1992: Which is a spooled-device example: interactive input terminal, virtual-memory backing store, line printer serving jobs, or none?
Tap to enlarge
Select all that apply
Answer & solution

Answer: C: line printer (no official key was published)

Spooling places jobs in a queue, usually on disk, and lets a dedicated service feed an exclusive sequential device at its own speed. A printer serving several jobs is the standard example: applications finish depositing their output without waiting for physical printing, and each job can be kept separate. A terminal’s interactive input and demand paging have different purposes, even though they may involve buffers or secondary storage. The presence of a buffer alone does not make an operation spooling.

Original paper, page 3