IAE Academy

ISRO CS 2025 Q.70: solution and answer

ISRO 2025 · CSQ.70 · 1 mark · MCQ

Consider the following reference strings and assume 3 frames are available, then the number of page faults that occur using Optimal page replacement algorithm is
6, 0, 5, 2, 0, 3, 0, 4, 2, 3, 0, 3, 2, 5, 2

  1. (A)

    15 Page Faults

  2. (B)

    9 Page Faults

  3. (C)

    12 Page Faults

  4. (D)

    8 Page Faults

See the question in the paper

Answer and solution

ANSWER

The Optimal algorithm causes 8 page faults, which is option (d).

Official answer: DSource: ISRO's final answer key of 15 May 2026

  1. Optimal replacement evicts the page in memory whose next use lies farthest in the future, or that is never used again. Start with 3 empty frames.

  2. References fill the empty frames: 3 faults. Frames .

  3. Reference is a fault (4th). Page is never used again, so evict it. Frames . The next reference is a hit.

  4. Reference is a fault (5th). Remaining references: . Page is needed first, is needed 3rd, and is needed 8th, so evict . Frames . The next reference is a hit.

  5. Reference is a fault (6th). Remaining references: . The first uses are , then , then , so evict . Frames . The next references and are hits.

  6. Reference is a fault (7th). Remaining references: . Page is never used again, so evict it. Frames . The next references and are hits.

  7. Reference is a fault (8th). The only remaining reference is , so either or may be evicted; the count is unaffected. The final is a hit.

  8. Total page faults .

KEY IDEA

On each fault with full frames, look ahead in the reference string and evict the resident page whose next use is farthest away, or that is never used again. Count a fault only when the requested page is not already in a frame.

WATCH OUT FOR

Counting the initial fills incorrectly, or evicting by recency (as in LRU) instead of looking ahead. Some students also count hits as faults and answer with the length of the reference string.

From the ISRO CS 2025 paper. Every question of this paper · The full paper (PDF, ISRO) · All 1 ISRO Virtual memory question, with notes