CS FundamentalsVery hardGATE CS (PYQ pattern)

The clock (second-chance) algorithm manages 4 frames, initially empty and filled in order 0..3. A page's reference bit is set to 1 when it is loaded and on every hit. On a fault the hand sweeps forward, clearing set bits, and replaces the first frame with bit 0, then moves one step past it. How many page faults occur for the string 4, 3, 4, 5, 2, 5, 2, 6, 3, 4, 1, 6, 1, 4, 6, 3, 4, 5, 1, 6?

  1. A. 11
  2. B. 9
  3. C. 10
  4. D. 7

Correct answer: B. 9

Simulating the hand: clock gives 9 faults, whereas LRU gives 11, FIFO 10 and OPT 7 for the same string.

More Operating Systems questions

Exams that ask this topic