CS FundamentalsHardGATE CS (PYQ pattern)
A program loops over pages 1, 2, 3, 4, 5 six times in cyclic order (30 references) with 4 frames, initially empty. How many page faults does the MRU policy (evict the most recently used page) incur?
- A. 30
- B. 13
- C. 11
- D. 8
Correct answer: C. 11
MRU, FIFO and LRU respectively give 11, 30 and 30 faults on this string; MRU keeps four pages resident and only the remaining page keeps cycling, unlike LRU/FIFO which fault on every reference. On this cyclic string MRU even matches OPT (11).
More Operating Systems questions
- SJF predicts each process's next CPU burst by exponential averaging, tau(n+1) = a x t(n) + (1 - a) x tau(n), with a = 0.5 and tau(0) = 10…
- Assume every fork() succeeds. for (int i = 0; i < 4; i++) { if (fork() == 0 && i % 2 == 1) execl("/bin/true", "true", NULL); }…
- A machine with 4 KB pages and demand paging has a 6-byte memory-to-memory MOVE instruction stored at virtual address 0x0FFC. It copies 300…
- Six threads each take two locks in a fixed order and hold the first while acquiring the second: T1 takes A then B, T2: B then C, T3: C…
- Four processes (arrival, burst) in ms: A (0, 7), B (1, 2), C (2, 1), D (2, 2). Scheduling is non-preemptive. Compare non-preemptive SJF…
- A 2-slot bounded buffer uses mutex = 1, empty = 2, full = 0. Two producers each insert 2 items with the (buggy) code wait(mutex)…