✓ FIFO evicts the oldest page regardless of future use.
This insight is hard to see from code alone because the eviction is implicit in the queue structure.
✓ Page faults occur only when a page is not in memory.
Visualizing each page check clarifies when faults happen and when pages are hits.
✓ The queue order directly controls eviction order in FIFO.
Seeing the queue update step-by-step reveals how insertion order drives eviction.
Practice
(1/5)
1. In which scenario is segmentation preferred over paging for memory management?
easy
A. When fixed-size memory blocks are needed to simplify allocation
B. When hardware support for address translation is limited
C. When minimizing internal fragmentation is the primary goal
D. When the program requires logical division of memory into variable-sized segments
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 D
Quick Check:
Segmentation fits variable-sized logical divisions, matching the scenario described in When the program requires logical division of memory into variable-sized segments.
Believing segmentation is chosen due to hardware limits
2. In which scenario is the Process Control Block (PCB) primarily used during the process state transitions in the five-state model?
easy
A. When a process moves from New to Ready state to store initial process information
B. When a process is terminated to delete all its data from memory
C. When a process is in the Ready state to execute instructions directly
D. When a process moves from Running to Waiting state to save CPU registers and state
Solution
Step 1: Understand the role of PCB during state transitions
The PCB stores the process state, CPU registers, and scheduling information during context switches.
Step 2: Analyze each option
A: PCB is created at process creation but its primary use is during context switches, not just at New to Ready. B: PCB is involved in termination but mainly to release resources; it is not primarily used to delete data. C: Processes in Ready state do not execute instructions directly; they wait for CPU allocation. D: Correct. When a process moves from Running to Waiting, the PCB saves CPU registers and state for resumption.
Final Answer:
Option D -> Option D
Quick Check:
PCB is essential for saving CPU state during Running to Waiting transitions [OK]
Hint: PCB saves CPU state during Running to Waiting transitions [OK]
Common Mistakes:
Thinking PCB is only used at process creation
Assuming Ready state processes execute instructions
Believing PCB is deleted immediately at termination
3. Why is it generally inefficient to keep a process in the Ready state for a long time without scheduling it to Running, especially in a multi-core system?
medium
A. Because the process wastes CPU cache locality and increases context switch overhead when scheduled later
B. Because the process holds resources like memory and I/O devices exclusively while Ready
C. Because the process consumes CPU cycles even in Ready state, reducing overall throughput
D. Because the process cannot perform I/O operations while in Ready state, causing system deadlocks
Solution
Step 1: Understand Ready state resource usage
Processes in Ready state do not consume CPU cycles but occupy scheduling queues.
Step 2: Analyze each option
A: Correct. Long Ready times cause loss of CPU cache locality and increase context switch overhead when finally scheduled. B: Incorrect. Processes do not hold exclusive I/O or memory resources just by being Ready. C: Incorrect. Ready processes do not consume CPU cycles. D: Incorrect. Ready processes do not cause deadlocks by not performing I/O.
Final Answer:
Option A -> Option A
Quick Check:
Ready state delays hurt cache locality and increase context switch costs [OK]
Hint: Ready state processes wait without CPU but lose cache locality and increase context switch overhead [OK]
Common Mistakes:
Believing Ready processes consume CPU cycles
Assuming Ready processes hold exclusive resources
Confusing Ready state with Waiting state regarding I/O
4. Which of the following is a significant drawback of preemptive SJF scheduling compared to non-preemptive SJF?
medium
A. It reduces CPU utilization due to frequent context switches
B. It can cause starvation of longer processes if short jobs keep arriving
C. It always results in higher average turnaround time
D. It cannot handle processes arriving at different times
Solution
Step 1: Understand starvation in preemptive SJF
Shorter jobs can continuously preempt longer ones, causing longer processes to wait indefinitely.
Step 2: Analyze other options
A: While context switches increase, CPU utilization remains high; overhead is a concern but not utilization. B: Preemptive SJF generally reduces average turnaround time, not increases it. D: Preemptive SJF is designed to handle processes arriving at different times.
Final Answer:
Option B -> Option B
Quick Check:
Starvation is a classic drawback of preemptive SJF.
Hint: Preemptive SJF risks starving long jobs if short jobs keep arriving [OK]
5. What is a key limitation of the working set model in preventing thrashing that candidates often overlook?
medium
A. It requires tracking all page references, which can be expensive and complex
B. It guarantees zero page faults once the working set is allocated
C. It works best when all processes have identical working set sizes
D. It eliminates the need for load control mechanisms
Solution
Step 1: Understand working set model overhead
The model requires monitoring page references over time windows, which can be costly.
Step 2: Analyze options
A is correct because tracking page references precisely is resource-intensive. B is incorrect because even with working set allocation, some page faults can occur. C is incorrect because working set sizes vary widely among processes. D is incorrect because load control is still needed when total working sets exceed memory.
Final Answer:
Option A -> Option A
Quick Check:
Working set tracking overhead is a practical limitation often underestimated.