CS FundamentalsVery hardGATE CS (PYQ pattern)
With 3 frames, initially empty, the reference string is 4, 2, 1, 5, 2, 1, 3, 2, 4, 3, 1, 3, 2, 2, 5, 4, 5, 1, 3, 2, 4, 4. How many MORE page faults does LRU incur than the optimal (Belady) policy?
- A. 5
- B. 3
- C. 6
- D. 4
Correct answer: D. 4
LRU gives 14 faults and OPT 10, a difference of 4 (FIFO gives 16, so FIFO - OPT = 6 is the trap).
More Operating Systems questions
- A 32-bit machine uses two-level paging with 4 KB pages, 4-byte entries and 10 + 10 + 12 address bits, so each page-table page maps 4 MB. A…
- Deadlock detection (multiple instances of 3 resource types) with 6 processes. Allocation: P0 (2,0,2), P1 (1,2,1), P2 (1,0,1), P3 (1,0,0)…
- Three processes all arrive at time 0 in the order A, B, C and are scheduled FCFS (non-preemptive on the CPU). Each alternates CPU burst…
- A 3-level feedback queue scheduler uses strict priority between levels. Level 0 has quantum 2 ms, level 1 has quantum 4 ms, level 2 is…
- Two processes i and j (j is the other one) use shared flag[2] (initially false) and turn to guard a critical section. Entry code of four…
- Arrays A and B are 128 x 128 int matrices stored row-major, 4-byte ints, 512-byte pages (each row occupies exactly one page, A and B…