CS FundamentalsVery hardProduct company interview · GATE level

An inode has 10 direct pointers, one single-indirect, one double-indirect and one triple-indirect pointer. Blocks are 2 KB and block pointers are 8 bytes. What is the largest possible file size, to the nearest hundredth of a GiB?

  1. A. About 256.50 GiB
  2. B. About 32.13 GiB
  3. C. About 64.25 GiB
  4. D. About 0.13 GiB

Correct answer: B. About 32.13 GiB

One block holds 2048/8 = 256 pointers. Data blocks reachable: 10 + 256 + 256^2 + 256^3 = 10 + 256 + 65,536 + 16,777,216 = 16,843,018. Times 2 KB = 34,494,500,864 bytes, about 32.13 GiB, almost all of it through the triple-indirect pointer. 256.50 GiB assumes 4-byte pointers (512 per block); 0.13 GiB stops at the double-indirect level; 64.25 GiB multiplies 256 pointers per block by a 4 KB data block, mixing two block sizes.

More Operating Systems questions

Exams that ask this topic