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 the role of directory entries in file name resolution
Directory entries map file names to inode numbers, acting as the bridge between human-readable names and inode metadata.Step 2: Clarify inode responsibilities
Inodes store metadata and pointers to data blocks but do not contain file names.Step 3: Differentiate superblock and data blocks
The superblock manages file system-wide metadata, not individual file mappings; data blocks store file content, not names.Final Answer:
Option D -> Option DQuick Check:
Directory entries handle name-to-inode mapping [OK]
- Confusing inode as containing file names
- Assuming data blocks store file names
- Believing superblock handles file name mappings
Solution
Step 1: Recall Round Robin preemption
When a process's time quantum expires, it is preempted to ensure fairness and allow other processes CPU access.Step 2: Understand queue management
The preempted process is placed at the end of the ready queue to wait for its next turn.Step 3: Analyze incorrect options
The process continues running until it voluntarily yields the CPU contradicts RR's preemption principle. The process is terminated and removed from the system is incorrect because process termination depends on completion, not quantum expiry. The process is moved to the waiting queue for I/O is incorrect unless the process requests I/O, which is unrelated to quantum expiration.Final Answer:
Option A -> Option AQuick Check:
Quantum expiry -> preempt -> enqueue at ready queue's end.
- Thinking process runs until completion ignoring quantum
- Confusing preemption with process termination
- Assuming process moves to waiting queue without I/O
Solution
Step 1: Identify Peterson's algorithm characteristics
Peterson's algorithm uses busy waiting (spinlock), which can waste CPU resources.Step 2: Analyze other options
It cannot guarantee mutual exclusion under any circumstances is false because mutual exclusion is guaranteed. It depends on hardware atomic instructions to function correctly is incorrect since Peterson's algorithm was designed to avoid hardware atomic instructions. It allows unbounded waiting, leading to starvation is wrong because bounded waiting is guaranteed.Final Answer:
Option B -> Option BQuick Check:
Busy waiting is a known practical limitation of Peterson's algorithm.
- Assuming Peterson's needs hardware atomic instructions
- Confusing bounded waiting with starvation
- Believing mutual exclusion can fail
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
