Practice
Solution
Step 1: Understand contiguous allocation characteristics
Contiguous allocation stores all file blocks sequentially on disk, enabling fast sequential and direct access without extra pointers.Step 2: Analyze when fast sequential and direct access to file blocks is required with minimal overhead
Fast sequential and direct access is exactly what contiguous allocation optimizes for.Step 3: Analyze when files are frequently extended or shrunk dynamically during runtime
Contiguous allocation struggles with dynamic file size changes due to fragmentation and need for contiguous free space.Step 4: Analyze when the file system must handle very large files with unpredictable sizes
Large unpredictable files are better handled by linked or indexed allocation to avoid fragmentation and allocation overhead.Step 5: Analyze when minimizing external fragmentation is the highest priority
Contiguous allocation tends to cause external fragmentation, so it does not minimize it.Final Answer:
Option C -> Option CQuick Check:
Contiguous allocation -> fast access but poor flexibility and fragmentation handling.
- Assuming contiguous allocation handles dynamic file sizes well
- Confusing fragmentation minimization with contiguous allocation benefits
Solution
Step 1: Understand preemptive SJF behavior
Preemptive SJF allows the CPU to switch to a newly arrived process if it has a shorter burst time than the currently running process.Step 2: Analyze scenarios
If new processes with shorter burst times can arrive anytime, preemptive SJF ensures the CPU always runs the shortest job next, improving average waiting time.Step 3: Why other options are incorrect
A: If all processes arrive simultaneously with similar burst times, preemptive advantage is minimal.
B: Starvation is a concern in preemptive SJF, so it's not chosen when fairness is ignored.
C: Preemptive SJF increases context switches, so it's not preferred when minimizing overhead.Final Answer:
Option A -> Option AQuick Check:
Preemptive SJF is best when shorter jobs can arrive anytime, requiring immediate preemption.
- Assuming preemptive SJF always reduces overhead
- Believing preemptive SJF is best when all jobs arrive simultaneously
Solution
Step 1: Analyze each statement
A is correct; long processes delaying short ones is the convoy effect.
B is correct; preemption can reduce the convoy effect.
C is incorrect; the convoy effect increases average waiting time, not minimizes it.
D is correct; convoy effect can cause poor CPU utilization and longer waits.Step 2: Identify the incorrect statement
Only The convoy effect causes the average waiting time to always be minimal in FCFS falsely claims minimal average waiting time due to the convoy effect.Final Answer:
Option C -> Option CQuick Check:
Convoy effect worsens waiting time, not improves it.
- Assuming convoy effect improves waiting time
- Ignoring preemption as a mitigation
- Misunderstanding convoy effect impact on CPU utilization
Solution
Step 1: Understand indexed allocation overhead
Indexed allocation stores pointers in index blocks, consuming extra disk space.Step 2: Analyze indexed allocation requires additional disk space for index blocks, increasing overhead
Correctly identifies the overhead cost of index blocks.Step 3: Analyze indexed allocation causes more external fragmentation than contiguous allocation
Indexed allocation reduces external fragmentation by allowing non-contiguous blocks.Step 4: Analyze indexed allocation cannot support direct access to file blocks
Indexed allocation supports direct access via the index block.Step 5: Analyze indexed allocation always results in slower sequential access than linked allocation
Sequential access speed is generally better than linked allocation due to direct indexing.Final Answer:
Option A -> Option AQuick Check:
Indexed allocation trades space overhead for flexible block placement and direct access.
- Confusing external fragmentation effects between allocation methods
- Believing indexed allocation cannot do direct access
- Assuming indexed allocation is always slower than linked for sequential access
Solution
Step 1: Clarify inode contents
Inodes store metadata (permissions, timestamps, size) and pointers, but NOT file names.Step 2: Confirm pointer role
Inodes contain direct and indirect pointers to data blocks.Step 3: Understand hard links
Multiple directory entries can reference the same inode, enabling hard links.Step 4: Recognize inode size
Inodes are fixed-size and do not store variable-length file names.Final Answer:
Option B -> Option BQuick Check:
File names are stored in directory entries, not inodes [OK]
- Assuming inodes store file names
- Confusing directory entries with inodes
- Believing inode size varies with file name length
