CS FundamentalsHardAmazon · Microsoft MCQ pattern

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) algorithm produce?

  1. A. 11
  2. B. 12
  3. C. 5
  4. D. 7

Correct answer: D. 7

OPT evicts the page used furthest in the future: faults on 3, 1, 4, then 2 (evict 4), 5 (evict 2), 4 (evict 3), 2 (evict 1): 7. FIFO on the same string gives 11, LRU 12, and 5 counts only the compulsory first-time misses.

More Operating Systems questions

Exams that ask this topic