CS FundamentalsHardProduct-company MCQ pattern
Reference string: 3, 1, 4, 3, 2, 1, 5, 3, 4, 1, 2, 5, 4, 3 frames, initially empty. Which statement is correct?
- A. FIFO and LRU both give 11 faults
- B. LRU gives 12 faults and OPT gives 9
- C. FIFO gives 11 faults and LRU gives 12, so LRU is worse here
- D. LRU gives fewer faults than FIFO, as it always does
Correct answer: C. FIFO gives 11 faults and LRU gives 12, so LRU is worse here
FIFO: 11 faults (hits on the 4th and 6th references). LRU: only the 4th reference (3) hits, so 12 faults. OPT gives 7. LRU is usually better than FIFO but not on every string, which is the trap.
More Operating Systems questions
- Reference string: 3, 1, 4, 3, 2, 1, 5, 3, 4, 1, 2, 5, 4. With 3 frames, initially empty, how many page faults does the Optimal (OPT)…
- Assertion (A): For FIFO page replacement, increasing the number of frames can increase the number of page faults. Reason (R): FIFO is a…
- Five processes P0–P4 and three resource types A, B, C. Allocation: P0 (1,0,1), P1 (2,1,1), P2 (0,1,2), P3 (1,1,0), P4 (0,0,2). Max: P0…
- A system has 6 identical tape drives. Each of n processes needs at most 2 drives. What is the maximum n for which the system is guaranteed…
- How many of the following statements about deadlock are correct? 1. Requiring a process to request all its resources at once prevents…
- Semaphores S = 1 and T = 0. Process X runs: wait(S); print('A'); signal(T); Process Y runs: wait(T); print('B'); signal(S); Each runs its…