Skip to content
Official PYQ · 2026

GATE CS 2026 Set 2 Q43 — Memory Hierarchy: Cache, Main Memory and Secondary Storage

Explain with AI
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 1616 GB , block size is 22 KB , and block numbers used are 3232-bit long. A single pointer of size 44 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: 1K=2101 \mathrm{K}=2^{10} and 1G=2301 \mathrm{G}=2^{30}
View worked solution

Answer: 16417

To find the number of blocks required to hold the free disk block numbers, we calculate as follows:

Step 1: Calculate the total number of blocks on the disk

  • Disk size = 16 GB=16×230 bytes16 \text{ GB} = 16 \times 2^{30} \text{ bytes}
  • Block size = 2 KB=2×210 bytes=2048 bytes2 \text{ KB} = 2 \times 2^{10} \text{ bytes} = 2048 \text{ bytes}
  • Total number of blocks (NN) = 16×2302×210=8×220=8,388,608\frac{16 \times 2^{30}}{2 \times 2^{10}} = 8 \times 2^{20} = 8,388,608 blocks

Step 2: Calculate the capacity of a single index block

  • Each block in the list uses 44 bytes for a pointer to the next block.
  • Remaining space in each block for storing block numbers = 2048 bytes−4 bytes=2044 bytes2048 \text{ bytes} - 4 \text{ bytes} = 2044 \text{ bytes}.
  • Size of each block number = 32 bits=4 bytes32 \text{ bits} = 4 \text{ bytes}.
  • Number of block numbers stored per block = ⌊20444⌋=511\lfloor \frac{2044}{4} \rfloor = 511.

Step 3: Calculate the number of blocks required

To store the addresses of all 8,388,6088,388,608 blocks:

Number of blocks=⌈8,388,608511⌉=⌈16416.06⌉=16417\text{Number of blocks} = \left\lceil \frac{8,388,608}{511} \right\rceil = \lceil 16416.06 \rceil = 16417

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Memory Hierarchy: Cache, Main Memory and Secondary Storage questions