GateAI
File Systems

GATE CSE 2025 Set 1 · Q51

NAT2 marksMedium

Time

A disk of size 512M bytes is divided into blocks of 64K bytes. A file is stored in the disk using linked allocation. In linked allocation, each data block reserves 4 bytes to store the pointer to the next data block. The link part of the last data block contains a NULLNULL pointer (also of 4 bytes). Suppose a file of 1M bytes needs to be stored in the disk. Assume, 1K = 2102^{10} and 1M = 2202^{20}. The amount of space in bytes that will be wasted due to internal fragmentation is _______. (Answer in integer)

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 65468

File Systems

To determine the internal fragmentation, we calculate the number of blocks required and the unused space in the last block:

  1. Block Capacity:

    • Total block size =64 KB=64×210=65536 bytes= 64\text{ KB} = 64 \times 2^{10} = 65536\text{ bytes}.

    • Each block reserves 4 bytes4\text{ bytes} for the next pointer (or NULL pointer).

    • Data capacity per block =65536−4=65532 bytes= 65536 - 4 = 65532\text{ bytes}.

  2. Number of Blocks Needed:

    • Total file size =1 MB=220=1048576 bytes= 1\text{ MB} = 2^{20} = 1048576\text{ bytes}.

    • Number of blocks required n=⌈104857665532⌉=⌈16.001038⌉=17 blocksn = \left\lceil \frac{1048576}{65532} \right\rceil = \lceil 16.001038 \rceil = 17\text{ blocks}.

  3. Space Used in the Last (17th17^{\text{th}}) Block:

    • Data stored in the first 16 blocks =16×65532=1048512 bytes= 16 \times 65532 = 1048512\text{ bytes}.

    • Data stored in the 17th17^{\text{th}} block =1048576−1048512=64 bytes= 1048576 - 1048512 = 64\text{ bytes}.

    • Pointer space used in the 17th17^{\text{th}} block =4 bytes= 4\text{ bytes}.

    • Total space used in the 17th17^{\text{th}} block =64+4=68 bytes= 64 + 4 = 68\text{ bytes}.

  4. Internal Fragmentation:

    • Internal fragmentation is the unused space in the allocated 17th17^{\text{th}} block:

    Internal Fragmentation=65536−68=65468 bytes\text{Internal Fragmentation} = 65536 - 68 = 65468\text{ bytes}

Hence, the amount of wasted space is 65468 bytes.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This File Systems previous year question is Q51 of the GATE CSE 2025 Set 1 paper. Find more GATE CSE PYQs on File Systems in Operating Systems, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related File Systems PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

File Systems in GATE CSE

File Systems has 14 GATE CSE PYQs across 14 papers from 2011 to 2026. 7 of them are 2-mark NAT questions like this one, and it is the only one in GATE CSE 2025 Set 1.

How GATE tests File Systems

More from GATE CSE 2025 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2025 Set 1 · Q51 · NAT

A disk of size 512M bytes is divided into blocks of 64K bytes. A file is stored in the disk using linked allocation. In linked allocation, each data block reserves 4 bytes to store the pointer to the next data block. The link part of the last data block contains a NULL pointer (also of 4 bytes). Suppose a file of 1M bytes needs to be stored in the disk. Assume, 1K = 210 and 1M = 220. The amount of space in bytes that will be wasted due to internal fragmentation is … (Answer in integer)

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.