CS FundamentalsVery hardGATE CS (PYQ pattern)

The clock algorithm uses 3 frames (initially empty); the reference bit is set when a page is loaded and on every hit. On a fault the hand examines frames one by one (clearing a set bit and moving on, or replacing a frame with a clear bit and then moving past it); every examined frame counts as one hand step, including the replaced one. String: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5, 3, 4, 6, 1. How many hand steps occur in total?

  1. A. 11
  2. B. 23
  3. C. 26
  4. D. 20

Correct answer: B. 23

There are 11 faults; each needs a sweep that clears the bits it passes before finding a victim, giving 23 examined frames in all.

More Operating Systems questions

Exams that ask this topic