Skip to content
GATEiit

GATE CSE 2025 Session 1 Q54: Page faults with optimal replacement limited to 4-reference lookahead

Question

In optimal page replacement algorithm, information about all future page references is available to the operating system (OS). A modification of the optimal page replacement algorithm is as follows:

The OS correctly predicts only up to next 4 page references (including the current page) at the time of allocating a frame to a page.

A process accesses the pages in the following order of page numbers:

1, 3, 2, 4, 2, 3, 1, 2, 4, 3, 1, 4.

If the system has three memory frames that are initially empty, the number of page faults that will occur during execution of the process is ________. (Answer in integer)

Try it: numerical answer: type the value

Numerical answer. No negative marking.
Show answer and explanation

Answer: 6 (official GATE 2025 final answer key)

Concept used: Optimal (Belady) replacement with a limited window: evict the page used farthest in the visible future, or one not seen in the window.

First step: The first three references fault. At the fault on 4, the window is 4, 2, 3, 1: decide which of the resident pages 1, 3, 2 is used last.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2025 Session 1 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key