Question
To keep track of free blocks in a file system, one of the two approaches is generally used - using bitmaps (bit vectors) or using linked lists. Consider that the linked list approach is used to keep track of free blocks in a file system. Assume that the disk size is 16 GB, block size is 2 KB, and block numbers used are 32-bit long. A single pointer of size 4 bytes is used in each block of the list to point to the next block of the list. The number of blocks required to hold the free disk block numbers is ____________. (answer in integer)
Note: and
Official answer and solution
- Official answer
- 16417
- From
- Official GATE 2026 answer key
Solution
Calculate the total number of disk blocks and divide by the number of free-block addresses stored per 2 KB index block.
Total number of blocks on the disk:
Each block in the linked list uses bytes for the pointer to the next list block, leaving bytes to store 32-bit (-byte) free block numbers:
Therefore, the number of blocks required to hold all block numbers is:
16417
Dividing by 512 instead of 511 (forgetting the 4-byte next-block pointer in each block).
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2026 Computer Science and Information Technology - Session 2 (CS2)
- Question
- 53 of 65
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.