File management is the part of Operating Systems where a few structural ideas carry an outsized share of the marks. Examiners keep testing the same skills: choosing between contiguous, linked and indexed allocation, computing the maximum file size a Unix i-node can address, reading symbolic-link behaviour, and telling apart directory operations from free-space bookkeeping. GATE builds the i-node numericals; UGC NET and PSU papers lean on the definitions and the disk-layout facts.
Below are 12 solved MCQs from KnowledgeGate's published question bank, most of them real previous-year questions with the exam and year noted. Attempt each before checking the answer; the explanation is short by design. The full theory sits in the file management learn module.
A note on the deep links: where a question is a GATE PYQ carried inside the GATE course, we link its exact solved page. The questions from other recruitment papers live in the same module's practice sets, so for those the module link above is your entry point.
File allocation methods
Q1. In the indexed allocation scheme of blocks to a file, the maximum possible size of the file depends on: *(GATE 2002, see the solved page)*
(a) the size of the blocks and the size of the address of the blocks
(b) the number of blocks used for the index and the size of the blocks
(c) the size of the blocks, the number of blocks used for the index, and the size of the address of the blocks
(d) None of these
Answer: (c) the size of the blocks, the number of blocks used for the index, and the size of the address of the blocks.
An index block holds pointers, and how many it holds is the block size divided by the address size. The total data blocks reachable is that count multiplied by the number of index blocks, and the file size is finally that total times the block size. All three quantities enter the answer, so any option naming only two is incomplete.
Q2. A Unix-style i-node has 10 direct pointers and one single, one double and one triple indirect pointer. Disk block size is 1 KB and a disk block address is 32 bits. What is the maximum possible file size? *(GATE 2004, see the solved page)*
(a) 2^24 bytes
(b) 2^32 bytes
(c) 2^34 bytes
(d) 2^48 bytes
Answer: (c) 2^34 bytes.
A 1 KB block holding 4-byte addresses stores 256, that is 2^8, pointers. The triple indirect pointer therefore reaches 256 times 256 times 256, which is 2^24 blocks, and every other term is tiny beside it. Multiplying 2^24 blocks by the 2^10 byte block size gives 2^34 bytes, and the triple-indirect term dominates the total.
Q3. In a Unix OS each data block is 1024 bytes, each i-node has 10 direct addresses plus one single, one double and one triple indirect address, and each block holds addresses for 128 blocks. Approximately what is the maximum file size? *(GATE 2004, see the solved page)*
(a) 512 MB
(b) 2 GB
(c) 8 GB
(d) 16 GB
Answer: (b) 2 GB.
With 128 addresses per block, the triple indirect pointer reaches 128 times 128 times 128, which is roughly two million blocks. Multiply that by the 1024-byte block size and the total is about 2 GB, because the triple-indirect term again swamps the direct, single and double contributions. Watch the addresses-per-block figure: 128 here versus 256 in the previous question changes the answer completely.
Q4. The data blocks of a very large file in the Unix file system are allocated using *(GATE 2008, see the solved page)*
(a) contiguous allocation
(b) linked allocation
(c) indexed allocation
(d) an extension of indexed allocation
Answer: (d) an extension of indexed allocation.
The i-node keeps a handful of direct pointers, but a very large file overflows them and spills into single, double and triple indirect blocks. That multilevel indirect structure is more than plain indexed allocation; it is a layered extension of it. So (d) captures the Unix scheme more precisely than the bare "indexed allocation" option.
Q5. Which file allocation method provides the best access time for sequential access? (TPSC 2026)
(a) contiguous allocation
(b) linked allocation
(c) indexed allocation
(d) hashed allocation
Answer: (a) contiguous allocation.
When a file's blocks sit in consecutive sectors, reading it sequentially means the head barely moves, so seek time stays minimal and throughput is highest. Linked and indexed schemes scatter blocks and add pointer chasing or index lookups. Contiguous allocation wins on sequential speed, though it pays for it with external fragmentation.
Q6. A Unix i-node uses 12 direct block addresses plus one single, one double and one triple indirect pointer. The disk block address is 32 bits and the block size is 1 KB. What is the maximum file size? (Coal India 2020)
(a) 32 GB
(b) 64 GB
(c) 16 GB
(d) 8 GB
Answer: (c) 16 GB.
A 1 KB block with 4-byte addresses again holds 256 pointers, so the triple indirect pointer reaches 256 cubed, which is 2^24 blocks. Multiplying by the 2^10 byte block size gives 2^34 bytes, and 2^34 is 16 GB. The extra direct pointers barely register against the triple-indirect term.
Directory structure and file operations
Q7. A student has files "file 1", "file 2" and "file 3" holding hobbies, friends and courses respectively. She runs ln -s file 1 file 2 then ln -s file 2 file 3. Which information is lost? *(GATE 2005, see the solved page)*
(a) hobbies and friends
(b) friends and courses
(c) friends only
(d) hobbies and courses
Answer: (b) friends and courses.
The syntax is ln -s target linkname, so the first command turns "file 2" into a symbolic link to "file 1", discarding its original friends content. The second turns "file 3" into a link pointing at "file 2", discarding its courses content. The hobbies in "file 1" are never touched, so friends and courses are the losses.
Q8. The command find -name passwd -print is run in the /etc directory of a Unix system. Which command gives the same information when run in the same directory? *(GATE 2005, see the solved page)*
(a) ls passwd
(b) cat passwd
(c) grep name passwd
(d) grep print passwd
Answer: (a) ls passwd.
The find command here simply locates and prints the path of a file named passwd, which is exactly what ls passwd does by listing that name. The cat and grep options read or search the file's contents instead of matching by name. Distinguishing "find by name" from "read the contents" is the whole point.
Q9. Which of the following is the main purpose of the file system in an operating system? (TPSC 2025)
(a) manage memory allocation
(b) manage CPU scheduling
(c) provide a structured way to store and access data
(d) control peripheral devices
Answer: (c) provide a structured way to store and access data.
A file system organises bytes on storage into named files and directories, and manages their creation, reading, writing and permissions while preserving integrity. Memory allocation, CPU scheduling and device control are separate OS subsystems. The file system's defining job is structured, persistent access to data.
Free-space management and disk layout
Q10. Where does the swap space reside? *(GATE 2001, see the solved page)*
(a) RAM
(b) Disk
(c) ROM
(d) on-chip cache
Answer: (b) Disk.
Swap space is a reserved region on secondary storage that backs virtual memory. When RAM fills, the OS moves less active pages out to this on-disk area and pulls them back when needed. Because its purpose is to extend memory beyond physical RAM, it must live on the disk, not in RAM or cache.
Q11. Four files of 11050, 4990, 5170 and 12640 bytes are stored using either 100-byte or 200-byte blocks, with 4 bytes of bookkeeping per block held in separate blocks. What is the total space used with 100-byte and 200-byte blocks respectively? *(GATE 2005, see the solved page)*
(a) 35400 and 35800 bytes
(b) 35800 and 35400 bytes
(c) 35600 and 35400 bytes
(d) 35400 and 35600 bytes
Answer: (c) 35600 and 35400 bytes.
For each file, count data blocks as the file size rounded up to whole blocks, then count bookkeeping blocks as four bytes per data block, again rounded up to whole blocks. The total is those blocks times the block size, summed across all four files. The smaller 100-byte blocks waste less on internal fragmentation per file but need more bookkeeping, and the arithmetic lands at 35600 and 35400.
Q12. File fragmentation means that a file (UP Police 2013)
(a) is unusable until it is defragmented
(b) has been compressed
(c) is stored in noncontiguous locations in RAM
(d) is stored in noncontiguous locations in disk
Answer: (d) is stored in noncontiguous locations in disk.
Fragmentation happens on secondary storage when no single run of free blocks is large enough, so the file system scatters the file across whatever gaps exist. The file stays perfectly usable, just slower to read because the head jumps between pieces. Note the storage medium: this is a disk phenomenon, not a RAM one.
Where these 12 fit in your preparation
The set matches how the topic is examined: the allocation-method core with its i-node sizing numericals (Q1 to Q6), the directory and file-operation questions that test Unix commands and links (Q7 to Q9), and the free-space and disk-layout items that round out most papers (Q10 to Q12). If the i-node numericals cost you marks, memorise the pattern that the triple-indirect term always dominates and just compute addresses per block first.
For the theory behind every answer, work through the file management learn module and place the topic in context with our Operating Systems for GATE breakdown. GATE aspirants get the full OS sequence inside GATE Guidance by Sanchit Sir; to time yourself under exam conditions, use the GATE Test Series. Solve, review the ones you missed, and return to the i-node questions a week later.




