CS FundamentalsVery hardGATE CS (PYQ pattern)

LRU-2 replacement: on a fault the victim is the resident page whose SECOND most recent reference is oldest (a page referenced only once counts as infinitely old; ties are broken by the older most recent reference). With 3 frames (initially empty) and the string 2, 3, 2, 1, 5, 2, 1, 5, 6, 3, 6, 4, 1, 1, 1, 6, 5, 2, 1, 4, 4, 1, 6, 4, how many faults occur?

  1. A. 13
  2. B. 12
  3. C. 10
  4. D. 11

Correct answer: D. 11

Tracking the last two reference times of each page gives 11 faults; plain LRU on the same string gives 13.

More Operating Systems questions

Exams that ask this topic