A system uses FIFO policy for page replacement. It has 4 page frames with no…

2010

A system uses FIFO policy for page replacement. It has 4 page frames with no pages loaded to begin with. The system first accesses 100 distinct pages in some order and then accesses the same 100 pages but now in the reverse order. How many page faults will occur?

  1. A.

    196

  2. B.

    192

  3. C.

    197

  4. D.

    195

Attempted by 139 students.

Show answer & explanation

Correct answer: A

Key idea: Count faults per pass and track which pages remain in frames.

  • First pass (100 distinct pages): every access is a miss because all pages are distinct and there are only 4 frames, so total faults = 100.

  • State after first pass: the 4 frames contain the last 4 pages accessed in that order.

  • Second pass (reverse order): the first 4 accesses are exactly those last 4 pages, so they are hits. The remaining 96 accesses are different pages not currently in frames, so each causes a fault.

Total page faults = 100 (first pass) + 96 (second pass) = 196.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir