GATE CSE 2022 Q63: Disk accesses to insert a block mid-file: contiguous vs linked
- Operating System
- 2 marks
- NAT
- No negative marking
Question
Consider two files systems and , that use contiguous allocation and linked allocation, respectively. A file of size 100 blocks is already stored in A and also in B. Now, consider inserting a new block in the middle of the file (between 50th and 51st block), whose data is already available in the memory. Assume that there are enough free blocks at the end of the file and that the file control blocks are already in memory. Let the number of disk accesses required to insert a block in the middle of the file in and are and , respectively, then the value of is_________.
Try it: numerical answer: type the value
Show answer and explanation
Answer: 153 (official GATE 2022 final answer key)
Concept used: Contiguous allocation must shift the later blocks; linked allocation must walk the list and fix one pointer.
First step: In A, blocks 51–100 are each read and written one place later, then the new block is written; in B, read blocks 1–50, write the new block, and rewrite block 50's pointer.
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2022 CS question paper and final answer key, organised by IIT Kharagpur. Question paper · Answer key
More Operating System PYQs
- 2026 Session 1 · Q29False statements about deadlocks
- 2026 Session 1 · Q35Minimum resource instances for deadlock freedom (5 processes, max 2)
- 2026 Session 1 · Q59Disk transfer time for random sectors on tracks 5, 12, 7
- 2026 Session 1 · Q63Number of printf calls with fork, continue and break
- 2026 Session 1 · Q64Average FCFS waiting time for alternating A and C processes
- 2026 Session 2 · Q23CPU scheduling algorithm that cannot be preemptive