GATE CSE 2025 Session 1 Q54: Page faults with optimal replacement limited to 4-reference lookahead
- Operating System
- 2 marks
- NAT
- No negative marking
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
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
Source: official GATE 2025 Session 1 CS question paper and final answer key, organised by IIT Roorkee. Question paper · Answer key
More Operating System PYQs
- 2026 Session 1 · Q29False statements about deadlocks
- 2026 Session 1 · Q35Minimum resource instances for deadlock freedom (5 processes, max 2)
- 2026 Session 1 · Q59Disk transfer time for random sectors on tracks 5, 12, 7
- 2026 Session 1 · Q63Number of printf calls with fork, continue and break
- 2026 Session 1 · Q64Average FCFS waiting time for alternating A and C processes
- 2026 Session 2 · Q23CPU scheduling algorithm that cannot be preemptive