GATE CSE 2021 Set 1 Q25: Directory operations needing a full scan of a linear list
- Operating System
- 1 mark
- MSQ
- No negative marking
Question
Consider a linear list based directory implementation in a file system. Each directory is a list of nodes, where each node contains the file name along with the file metadata, such as the list of pointers to the data blocks. Consider a given directory foo.
Which of the following operations will necessarily require a full scan of foo for successful completion?
Try it: multiple select: one or more correct options
Show answer and explanation
Answer: A, C (official GATE 2021 final answer key)
Concept used: An operation must scan the whole list when it has to prove that a name is not already present.
First step: Creation and renaming must check the new name for duplicates; deletion and opening can stop once the file is found.
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 2021 Set 1 CS question paper and final answer key, organised by IIT Bombay. 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