0
0
Operating Systemsknowledge~20 mins

File allocation methods (contiguous, linked, indexed) in Operating Systems - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
File Allocation Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Contiguous File Allocation

Which of the following best describes the main characteristic of contiguous file allocation?

AFiles are compressed and stored in a single block to save space.
BFiles are stored as linked blocks scattered anywhere on disk, with pointers connecting them.
CFiles are stored in an index block that contains pointers to all file blocks, allowing random access.
DFiles are stored in consecutive blocks on disk, making access fast but causing external fragmentation.
Attempts:
2 left
💡 Hint

Think about how the file blocks are arranged physically on the disk.

📋 Factual
intermediate
2:00remaining
Linked Allocation Characteristics

What is a key disadvantage of linked file allocation compared to contiguous allocation?

AIt requires a large index block to store pointers to all file blocks.
BIt has slower access time because each block contains a pointer to the next block, requiring sequential traversal.
CIt causes external fragmentation due to scattered file blocks.
DIt cannot handle files larger than a fixed size.
Attempts:
2 left
💡 Hint

Consider how the system finds the next block in linked allocation.

🔍 Analysis
advanced
2:00remaining
Indexed Allocation Advantages

Why does indexed file allocation improve random access compared to linked allocation?

ABecause an index block contains pointers to all file blocks, allowing direct access to any block without traversal.
BBecause all file blocks are stored contiguously, making access direct.
CBecause it compresses file data to reduce disk usage.
DBecause it uses a linked list of blocks, reducing overhead.
Attempts:
2 left
💡 Hint

Think about how the system finds a specific block in indexed allocation.

Comparison
advanced
2:00remaining
Comparing Fragmentation in Allocation Methods

Which file allocation method is most prone to external fragmentation, and why?

AContiguous allocation, because files require consecutive free blocks which may not be available as disk fills up.
BLinked allocation, because pointers cause blocks to scatter randomly.
CIndexed allocation, because the index block can become fragmented.
DNone of the methods cause external fragmentation.
Attempts:
2 left
💡 Hint

Consider how each method allocates space and what happens when disk space is fragmented.

Reasoning
expert
3:00remaining
Choosing File Allocation for Large Files with Random Access

A system needs to store very large files and allow fast random access to any part of the file. Which file allocation method is best suited, and why?

AContiguous allocation, because it stores files in consecutive blocks for fast access.
BLinked allocation, because it uses pointers to link scattered blocks, saving space.
CIndexed allocation, because it uses an index block to directly access any file block, supporting large files and fast random access.
DNone of these methods support large files with random access efficiently.
Attempts:
2 left
💡 Hint

Think about how each method supports random access and file size limits.