Assume that there are 3 page frames which are initially empty. If the page reference string is 1, 2, 3, 4, 2, 1, 5, 3, 2, 4, 6, the number of page faults using the *optimal replacement policy* is …
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2014 Set 1 · Q33
Time
Your answerNumerical answer
Solution
Official answer: 7
Memory Management and Virtual MemoryWe trace the optimal page replacement algorithm with 3 frames for the reference string:
Ref 1: Miss (Page Fault 1). Frames:
Ref 2: Miss (Page Fault 2). Frames:
Ref 3: Miss (Page Fault 3). Frames:
Ref 4: Miss (Page Fault 4). Future references: (next), (soon after), (later). Replace page (farthest in future). Frames:
Ref 2: Hit. Frames:
Ref 1: Hit. Frames:
Ref 5: Miss (Page Fault 5). Future references: , , , . Pages in frames are . Page is never referenced again. Replace page . Frames:
Ref 3: Miss (Page Fault 6). Future references: , , . Pages in frames are . Page is never referenced again. Replace page . Frames:
Ref 2: Hit. Frames:
Ref 4: Hit. Frames:
Ref 6: Miss (Page Fault 7). Replace any page (e.g., ). Frames:
Total number of page faults = 7.
Try the question first, then check your work.
Examiner trap
The optimal replacement policy replaces the page that will not be used for the longest period of time in the future.
This Memory Management and Virtual Memory previous year question is Q33 of the GATE CSE 2014 Set 1 paper. Find more GATE CSE PYQs on Memory Management and Virtual Memory in Operating Systems, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Memory Management and Virtual Memory PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Memory Management and Virtual Memory has 32 GATE CSE PYQs across 22 papers from 2011 to 2026. 15 of them are 2-mark NAT questions like this one, and it is the only one in GATE CSE 2014 Set 1.
How GATE tests Memory Management and Virtual MemoryIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.