CS FundamentalsHardProduct-company interview pattern

Reference string: 6, 1, 6, 2, 0, 1, 6, 4, 2, 1, 0, 4, 6. With 3 frames, initially empty, which set of page-fault counts is correct for FIFO, LRU and Optimal?

  1. A. FIFO 12, LRU 11, Optimal 8
  2. B. FIFO 11, LRU 10, Optimal 8
  3. C. FIFO 11, LRU 12, Optimal 8
  4. D. FIFO 11, LRU 12, Optimal 7

Correct answer: C. FIFO 11, LRU 12, Optimal 8

Simulating: FIFO faults 11, LRU 12, Optimal 8. LRU is usually better than FIFO, but not on every string — here LRU keeps evicting exactly the page needed next. Only Optimal is guaranteed to be the minimum.

More Operating Systems questions

Exams that ask this topic