Consider a disk with the following specifications: rotation speed of 6000 RPM, average seek time of 5 milliseconds, 500 sectors/track, 512-byte sectors. A file has content stored in 3000 sectors located randomly on the disk. Assuming average rotational latency, the total time (in seconds, rounded off to 2 decimal places) to read the entire file from the disk is ________
GATE 2024 CS2 Q.53: solution and answer
Answer and solution
ANSWER
The total time to read the entire file is seconds.
Official answer: 29.50 to 30.50Source: Official answer key, GATE 2024 CS2 (IISc Bengaluru)
Rotation speed = 6000 RPM = 100 revolutions/second, so time for one full rotation = .
Average rotational latency = time for half a rotation = .
In one rotation, all 500 sectors of a track pass under the head, so transfer time per sector = .
The 3000 sectors of the file are located randomly on the disk, so consecutive sectors cannot be assumed adjacent — each sector access is an independent disk access requiring its own seek, its own rotational latency, and its own transfer time.
Time for one sector access = seek time + rotational latency + transfer time = .
Total time for the file = .
KEY IDEA
When the sectors of a file are scattered randomly across the disk (not contiguous), the disk cannot amortize a single seek and a single rotational delay over the whole transfer. Every sector must be treated as an independent access: its own seek, its own average rotational latency, and its own transfer time — and these per-sector times are simply summed over all sectors in the file.
WATCH OUT FOR
Treating the 3000 sectors as one contiguous read: charging a single seek and a single rotational latency for the whole file and then adding only the total transfer time (3000 × 0.02 ms). That undercounts massively (a few seconds instead of ~30 s) because it ignores that "randomly located" sectors each require their own seek and rotational delay.
From the GATE 2024 CS2 paper. Every question of this paper · Download the full paper · All 22 Memory & cache questions, with notes
More Memory & cache questions
- GATE 2023 CS Q.64 · NAT · 2 marksAn 8-way set associative cache of size 64 KB (1 KB = 1024 bytes) is used in a system with 32-bit address.
- GATE 2022 CS Q.24 · MSQ · 1 markLet WB and WT be two set associative cache organizations that use LRU algorithm for cache block replacement.
- GATE 2022 CS Q.33 · NAT · 1 markA cache memory that has a hit rate of 0.8 has an access latency 10 ns and miss penalty 100 ns.
- GATE 2022 CS Q.54 · MSQ · 2 marksConsider a system with 2 KB direct mapped data cache with a block size of 64 bytes.
