Question:medium

A data file with 1,50,000 student records is stored on disk with block size 4096 bytes.
Each index record consists of an ANum field of size 12 bytes and a record pointer of size 7 bytes. The number of blocks in the index file is \(\underline{\hspace{2cm}}\).

Show Hint

Always round up when calculating disk blocks because partial blocks still occupy full space.
Updated On: Feb 2, 2026
Show Solution

Correct Answer: 698

Solution and Explanation

To determine the number of blocks in the index file, we first calculate the size of each index record. An index record comprises an ANum field (12 bytes) and a record pointer (7 bytes), totaling:

Size of each index record = 12 + 7 = 19 bytes

Given the block size is 4096 bytes, we compute how many index records fit into one block:

Index records per block = ⌊4096 / 19⌋ ≈ 215

Now, calculate the total number of index records required for 150,000 student records:

Total index records = 150,000

The number of blocks needed for the index is:

Number of blocks = ⌈150,000 / 215⌉ ≈ 698

This result of 698 blocks fits within the provided range of 698,698, confirming its validity.

Thus, the number of blocks in the index file is 698.

Was this answer helpful?
0