chapter

    File Systems and Storage Allocation Practice Questions for Gate Cs

    Solve 124+ File Systems and Storage Allocation practice questions for GATE CS with answers and detailed solutions. Free sample questions below.

    Try a question

    Answer it here to see how it works. Nothing is recorded until you sign in.

    Question 1
    Level 1: Warm-up

    Assertion (A): Reading the 3rd block of a 10-block file in linked allocation requires 3 disk accesses.

    Reason (R): The time taken is 3 KB because each block is 1 KB in size.

    Question 2
    Level 1: Warm-up

    Which of the following statements is strictly true regarding directory operations in a linear list organization?

    Question 3
    Level 1: Warm-up

    A file consists of 4 logical blocks. The operating system uses contiguous allocation and assigns the first physical block as block number 50. What is the physical block number of the last logical block of this file?

    Question 4
    Level 1: Warm-up

    In a linked allocation file system, the directory entry for a file stores only the starting block address. Assuming the directory entry is already in memory, what is the minimum number of disk accesses required to read the very first block of the file?

    Question 5
    Level 1: Warm-up

    In a linear list directory containing entries, what is the minimum number of entries that must be examined to successfully complete a "presence check" (finding an existing file), assuming the target file is the very first entry in the list?

    Question 6
    Level 1: Warm-up

    Consider a file of blocks stored using contiguous allocation. A new block is to be inserted at position (between the -th and -th blocks). Assuming the file control block is already in memory, which of the following statements regarding the disk accesses required are strictly true?

    Question 7
    Level 1: Warm-up

    Consider a file of blocks stored on a disk, where the File Control Block (FCB) is already in memory. Which of the following statements regarding the number of disk accesses required for specific file operations are strictly true?

    Question 8
    Level 1: Warm-up

    A file system uses a chained list to track free disk blocks. Each disk block is $4$ KB in size, and a block pointer is $8$ bytes. Assuming one pointer in each block is reserved to point to the next block in the free list, how many usable addresses for free blocks can be stored in a single disk block?

    Question 9
    Level 1: Warm-up

    A file is stored on a disk using a chained pointer approach. Assuming the File Control Block (FCB) is already in memory, how many disk read accesses are required to read the logical block of this file?

    Question 10
    Level 1: Warm-up

    According to the foundational roadmap of file systems and storage allocation, what is the primary entity that the operating system maps to physical disk blocks in the very first step?

    Free preview ends here

    Login to view the complete practice questions and solutions

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Explore complete test series, official past papers, and chapter-wise study tools.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    File Systems and Storage Allocation Practice Questions for GATE CS

    Solve 124+ File Systems and Storage Allocation practice questions for GATE CS with answers and detailed solutions. Free sample questions below.

    Chapter Roadmap: File Systems and Storage Allocation

    Chapter Journey

    File Systems & Storage Allocation

    1. Contiguous & Linked Allocation

    Mapping logical files to physical disk blocks. Trade-offs between linear and chained storage.

    2. Directory Search & Operations

    Locating files, managing metadata, and analyzing search efficiencies.

    3. Free-Space Management

    Tracking available disk blocks using bitmaps and linked lists.

    Why start here? Understanding how individual files are stored is the foundational step before analyzing directories and free space.

    Hero Concept: The File Allocation Problem

    The File Allocation Problem

    How do we map the logical blocks of a file to the physical blocks on a disk?

    Efficient Access
    Minimize disk head movement
    Space Efficiency
    Minimize fragmentation
    Dynamic Growth
    Expand without moving data

    Foundational Strategies

    Contiguous Allocation

    Blocks are stored in adjacent physical sectors.

    Linked Allocation

    Blocks are scattered, but chained together via pointers.

    File Systems and Storage Allocation: Solved Questions with Step-by-Step Explanations (10 Problems)

    Question 1 · Operating System MCQ

    Assertion (A): Reading the 3rd block of a 10-block file in linked allocation requires 3 disk accesses.

    Reason (R): The time taken is 3 KB because each block is 1 KB in size.

    1. A.

      Both A and R are true, and R is the correct explanation of A.

    2. B.

      A is true, but R is false.

    3. C.

      Both A and R are true, but R is not the correct explanation of A.

    4. D.

      A is false, but R is true.

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is an assertion-reason question testing disk access counts and unit awareness.

    Step 1: Evaluate Assertion (A). In linked allocation, reading the -th block requires disk accesses. For , it requires 3 accesses. So, A is true.

    Step 2: Evaluate Reason (R). Disk accesses are counted in number of operations, not in kilobytes (KB). Stating the "time taken is 3 KB" is a unit mismatch and conceptually false. So, R is false.

    Step 3: Conclude that A is true, but R is false.

    Answer: A is true, but R is false.

    Question 2 · Operating System MCQ

    Which of the following statements is strictly true regarding directory operations in a linear list organization?

    1. A.

      Deleting an existing file necessarily requires a full scan of the directory.

    2. B.

      Creating a new file necessarily requires a full scan to verify name uniqueness.

    3. C.

      Opening an existing file necessarily requires a full scan of the directory.

    4. D.

      Renaming an existing file can always stop early without checking the entire directory.

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This tests the constraints of directory operations, specifically the difference between presence and absence checks.

    Step 1: Analyze "Deleting" and "Opening". These are presence checks. They can stop early upon finding the file, so they do not necessarily require a full scan.

    Step 2: Analyze "Creating". This is an absence check. To ensure the new name does not already exist, the system must verify uniqueness by scanning every entry.

    Step 3: Analyze "Renaming". This requires finding the old name (can stop early) AND verifying the new name is unique (requires a full scan). Thus, it necessarily requires a full scan, making the fourth option false.

    Answer: Creating a new file necessarily requires a full scan to verify name uniqueness.

    Question 3 · Operating System MCQ

    A file consists of 4 logical blocks. The operating system uses contiguous allocation and assigns the first physical block as block number 50. What is the physical block number of the last logical block of this file?

    1. A.

      54

    2. B.

      50

    3. C.

      53

    4. D.

      49

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: This is a direct substitution question for contiguous allocation block numbering.

    Step 1: Identify the starting block and the length .

    Step 2: The blocks occupied are .

    Step 3: Calculate the last block: .

    Answer: 53.

    Question 4 · Operating System MCQ

    In a linked allocation file system, the directory entry for a file stores only the starting block address. Assuming the directory entry is already in memory, what is the minimum number of disk accesses required to read the very first block of the file?

    1. A.

      0

    2. B.

      1

    3. C.

      2

    4. D.

      N

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This tests the basic disk access count for the first block in linked allocation.

    Step 1: The directory entry is in memory, so we know the starting block address without a disk access.

    Step 2: To read the very first block, we must fetch it from the disk.

    Step 3: Fetching one block requires exactly 1 disk access.

    Answer: 1.

    Question 5 · Operating System MCQ

    In a linear list directory containing entries, what is the minimum number of entries that must be examined to successfully complete a "presence check" (finding an existing file), assuming the target file is the very first entry in the list?

    1. A.

      0

    2. B.

      1

    3. C.

    4. D.

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This tests the best-case scenario for a presence check in a linear list.

    Step 1: A "presence check" aims to find a specific file.

    Step 2: The search terminates immediately upon finding a match.

    Step 3: If the target file is the very first entry, the system examines exactly 1 entry, finds the match, and stops.

    Answer: 1.

    Question 6 · Operating System MSQ

    Consider a file of blocks stored using contiguous allocation. A new block is to be inserted at position (between the -th and -th blocks). Assuming the file control block is already in memory, which of the following statements regarding the disk accesses required are strictly true?

    1. A.

      The number of blocks that must be shifted to the right is .

    2. B.

      The total number of disk accesses required is .

    3. C.

      The operation requires reading and writing all blocks of the file.

    4. D.

      The operation requires exactly disk accesses.

    Correct Answer:

    ["A","B"]

    Step-by-Step Solution

    Key idea: This is an estimation question testing the disk access formula for insertion in contiguous allocation.

    Step 1: Identify the blocks to shift. Only blocks from position to must be moved. The number of such blocks is .

    Step 2: Calculate the accesses for shifting. Each of the blocks must be read (1 access) and written to its new position (1 access), totaling accesses.

    Step 3: Add the access for the new block. Writing the new block into the freed position takes 1 access.

    Step 4: Total accesses = .

    Answer: ["A", "B"]

    Question 7 · Operating System MSQ

    Consider a file of blocks stored on a disk, where the File Control Block (FCB) is already in memory. Which of the following statements regarding the number of disk accesses required for specific file operations are strictly true?

    1. A.

      Reading the -th logical block using a chained pointer allocation method requires exactly disk read accesses.

    2. B.

      Inserting a new block between the -th and -th positions using a chained pointer method requires disk accesses.

    3. C.

      Reading the -th logical block using a linear adjacent block allocation method requires disk read accesses.

    4. D.

      Inserting a new block between the -th and -th positions in an -block file using a linear adjacent block method requires disk accesses.

    Correct Answer:

    ["A","B","D"]

    Step-by-Step Solution

    Key idea: This is a disk access counting question, recognisable because it asks for the number of reads/writes for specific file operations under different allocation methods.

    Exam route: Recall the standard formulas for a file of blocks. For chained (linked) allocation, reading the -th block takes accesses, and inserting at takes accesses. For linear adjacent (contiguous) allocation, reading any block takes $1$ access, and inserting at takes accesses.

    Step 1: Evaluate Option A. Chained read of the -th block requires traversing from the start, taking exactly accesses. (True)

    Step 2: Evaluate Option B. Chained insertion at requires reads to traverse, $1$ read to get the next pointer, and $2$ writes (new block and updating the -th block), totaling accesses. (True)

    Step 3: Evaluate Option C. Linear adjacent read of the -th block takes exactly $1$ access via direct calculation (). The option claims . (False)

    Step 4: Evaluate Option D. Linear adjacent insertion at requires shifting blocks (each is $1$ read + $1$ write) plus $1$ write for the new block, totaling accesses. (True)

    Answer: A, B, D

    Question 8 · Operating System NAT

    A file system uses a chained list to track free disk blocks. Each disk block is $4$ KB in size, and a block pointer is $8$ bytes. Assuming one pointer in each block is reserved to point to the next block in the free list, how many usable addresses for free blocks can be stored in a single disk block?

    Correct Answer:

    511.00

    Step-by-Step Solution

    Key idea: This is a pointer packing question, recognisable because it asks for the number of usable addresses in a single disk block for free-space management.

    Exam route: Calculate total pointers per block, then subtract 1 for the 'next' pointer.

    Step 1: Convert block size to bytes. bytes.

    Step 2: Calculate total pointers per block. pointers.

    Step 3: Subtract the 1 pointer reserved for the next block. usable addresses.

    Answer: 511.00

    Question 9 · Operating System NAT

    A file is stored on a disk using a chained pointer approach. Assuming the File Control Block (FCB) is already in memory, how many disk read accesses are required to read the logical block of this file?

    Correct Answer:

    15.00

    Step-by-Step Solution

    Key idea: This is a disk access counting question, recognisable because it asks for the number of read accesses for a specific logical block in a chained pointer file.

    Exam route: Recall that chained pointer allocation requires sequential traversal from the start of the file.

    Step 1: Identify the allocation method: chained pointer (linked).

    Step 2: Identify the operation: reading the logical block.

    Step 3: In chained allocation, reading the -th block requires traversing the first blocks, taking exactly disk read accesses.

    Step 4: Substitute . The number of accesses is 15.

    Answer: 15.00

    Question 10 · Operating System MCQ

    According to the foundational roadmap of file systems and storage allocation, what is the primary entity that the operating system maps to physical disk blocks in the very first step?

    1. A.

      Virtual memory pages

    2. B.

      Logical blocks of a file

    3. C.

      Directory metadata entries

    4. D.

      Free-space bitmap sectors

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is a direct recall question about the foundational step in file systems.

    Step 1: Recall the chapter roadmap. The first step is understanding how individual files are stored.

    Step 2: The core problem is mapping the logical blocks of a file to the physical blocks on a disk.

    Answer: Logical blocks of a file.

    More practice questions in this unit