Practice
Solution
Step 1: Identify head direction and requests
Head at 15 moving up; requests: 2, 10, 20, 22, 40.Step 2: SCAN moves towards higher tracks first
It services requests in ascending order from current position: 20, 22, 40.Step 3: After reaching the highest request, SCAN reverses direction
Then it services remaining requests in descending order: 10, 2.Final Answer:
Option C -> Option CQuick Check:
20, 22, 40, 10, 2 correctly reflects SCAN's elevator movement servicing requests in one direction then reversing.
- Assuming SCAN skips requests on the return trip
- Mixing up order of requests on the return trip
- Confusing SCAN with C-SCAN which only moves in one direction
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 segmentation's purpose
Segmentation divides memory into logical units like code, stack, and data, which can vary in size.Step 2: Analyze When fixed-size memory blocks are needed to simplify allocation
Paging uses fixed-size pages, not segmentation, so this is incorrect.Step 3: Analyze When minimizing internal fragmentation is the primary goal
Paging reduces internal fragmentation better than segmentation; segmentation can have external fragmentation.Step 4: Analyze When hardware support for address translation is limited
Both paging and segmentation require hardware support; limited hardware support is not a reason to prefer segmentation.Final Answer:
Option D -> Option DQuick Check:
Segmentation fits variable-sized logical divisions, matching the scenario described in When the program requires logical division of memory into variable-sized segments.
- Confusing segmentation with fixed-size allocation
- Assuming segmentation eliminates fragmentation
- Believing segmentation is chosen due to hardware limits
Solution
Step 1: Understand C-SCAN fairness assumptions
C-SCAN assumes uniform head movement speed to provide uniform wait times.Step 2: Impact of variable head speed
Variable speed causes some requests to wait longer, breaking fairness and uniform wait time guarantees.Step 3: Mitigation strategies
Introducing a dynamic priority queue that accounts for estimated seek time can help balance servicing order and restore fairness.Step 4: Evaluate other options
Variable head speed does not affect C-SCAN fairness since it always services requests in one direction; no modification is needed. ignores the impact of speed variation; Variable head speed causes starvation in C-SCAN; switching to SSTF is the best mitigation. incorrectly claims starvation occurs and suggests SSTF, which can worsen starvation; Variable head speed improves average wait time by allowing faster servicing of distant requests; no modification is necessary. incorrectly claims variable speed improves wait times.Final Answer:
Option D -> Option DQuick Check:
Variable head speed breaks C-SCAN's uniform wait time guarantee; adding a dynamic priority queue based on estimated seek time can mitigate this. correctly identifies the problem and a plausible mitigation.
- Assuming C-SCAN fairness is speed-independent
- Confusing starvation with fairness degradation
- Believing variable speed always improves performance
Solution
Step 1: Understand single-level index block capacity
A single-level index block can only hold pointers to a fixed number of blocks.Step 2: What if file grows beyond index block capacity?
The single index block cannot hold more pointers, so the file cannot grow further under this scheme.Step 3: Analyze the file cannot grow further; to support larger files, multi-level or combined index schemes must be used
Correct: multi-level or combined index schemes (e.g., multi-level indexing, inode structures) are used to support larger files.Step 4: Analyze the file system automatically converts the file to contiguous allocation to accommodate growth
File systems do not convert allocation methods automatically; contiguous allocation is inflexible for growth.Step 5: Analyze the index block dynamically expands by linking to additional index blocks without performance penalty
Index blocks do not dynamically expand by linking; multi-level indexing is a designed solution.Step 6: Analyze the file system switches to linked allocation for that file to handle the extra blocks
File systems do not switch allocation methods on the fly; allocation method is fixed per file.Final Answer:
Option A -> Option AQuick Check:
Single-level index block limits file size; multi-level indexing needed for large files.
- Believing index blocks can dynamically expand
- Thinking allocation methods switch automatically
- Assuming contiguous allocation can handle dynamic growth easily
