CS FundamentalsVery hardGATE CS

Reference string: 4, 5, 2, 3, 4, 2, 3, 2, 1, 3, 5, 4, 1, 0, 3 frames, initially empty. Using the clock (second-chance) algorithm, where a newly loaded page gets reference bit 1, a hit sets the bit to 1, and the hand starts at frame 0 and advances past each frame it replaces, how many page faults occur?

  1. A. 8
  2. B. 14
  3. C. 6
  4. D. 9

Correct answer: D. 9

Simulating the hand, which clears reference bits until it finds a 0, gives 9 faults; hits set bits that change which page survives. Plain FIFO on this string gives 8, 14 counts every reference, and 6 counts only the cold misses of the six distinct pages.

More Operating Systems questions

Exams that ask this topic