GATE CS 2014 Set 2 — Question 43
Go beyond PYQs with Success TrackerAI-powered personalised practice and doubt support. Unlimited practice on eligible plans; AI usage limits apply.MCQ+2 / -0.67HardPage Replacement AlgorithmsMemory ManagementOperating System
Operating System → Memory Management → Page Replacement Algorithms
Last updated
Question
A computer has twenty physical page frames which contain pages numbered 101 through 120. Now a program accesses the pages numbered 1, 2, …, 100 in that order, and repeats the access sequence THRICE. Which one of the following page replacement policies experiences the same number of page faults as the optimal page replacement policy for this program?
Correct answer
(D) Most-recently-used
Solution
The access sequence is cyclic: .
Number of frames . Number of pages .Optimal Policy (OPT):
Number of frames . Number of pages .Optimal Policy (OPT):
- Pass 1: 100 faults (all cold misses). At the end of Pass 1, OPT will ensure the memory contains pages that are needed earliest in Pass 2. Since the sequence repeats 1..100, the pages needed earliest are 1, 2, ..., 19. OPT will keep 1..19 in memory and use the 20th frame to swap in 20, 21, ..., 100 one by one.
- Pass 2: Pages 1..19 are hits. Pages 20..100 are misses. Hits = 19.
- Pass 3: Same as Pass 2. Hits = 19.
- Total Hits = 38. Total Faults = .
- Pass 1: Loads 1..20. Frame 20 is the "Last In". When 21 comes, it replaces 20. When 22 comes, it replaces 21. This continues until 100 replaces 99. At the end of Pass 1, memory contains .
- Pass 2: Access 1..19 (Hits). Access 20 (Miss) -> replaces 100 (Last In). Access 21 (Miss) -> replaces 20. This continues. Memory effectively keeps 1..19 static and uses the last frame for the stream.
- Pass 3: Same as Pass 2. Hits = 19.
- Total Hits = 38. Total Faults = 262.
Continue learning with Success Tracker
A step still unclear? Work through it with support
Use Success Tracker to ask about the reasoning, then try another GATE CS question to check your understanding.
AI-powered practice· Unlimited practice on eligible plans
- PYQs with solutions
- Attempt available previous-year questions, then compare your reasoning with the worked solution. Coverage varies by stream.
- Practice that adapts
- Choose a topic, work on weaker areas and bookmark questions to revisit. Your attempts feed your progress tracking.
- AI doubt support
- Ask follow-up questions about a step or concept while practising, instead of stopping at the final answer.
Unlimited practice is available on eligible plans. Free practice and AI usage have limits; check the current plan allowances before choosing.
This page stays readable without an account. AI responses can be wrong; check them against the solution and source material.
More questions on Memory Management
2026 Set 2 Q23Which one of the following CPU scheduling algorithms cannot be preemptive?2026 Set 1 Q29With respect to deadlocks in an operating system, which of the following statements is/are FALSE?2026 Set 1 Q31In the context of relational database normalization, which of the following statements is/are true?2026 Set 1 Q35Consider a system consisting of instances of a resource , being shared by 5 processes.…2026 Set 2 Q51Consider three processes P1, P2, and P3 running identical code, as shown in the pseudocode below. A…