Optimal Page Replacement Algorithm Multiple Choice Questions and Answers (MCQs)

This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “Optimal Page Replacement Algorithm”.

1. __________ has the lowest fault rate of all the page replacement algorithms.
a) Optimal page replacement algorithm
b) LRU replacement algorithm
c) FIFO
d) Counting based
View Answer

Answer: a
Explanation: Optimal page replacement algorithm has the lowest fault rate as it has the knowledge of all the pages beforehand.

2. Optimal page replacement algorithm is also called as __________
a) LIFO
b) NRU
c) Clairvoyant replacement algorithm
d) Page buffering
View Answer

Answer: c
Explanation: Optimal page replacement algorithm is also called a Clairvoyant replacement algorithm or Belady’s optimal replacement algorithm.

3. In a optimal page replacement algorithm, when a page is to be replaced, which of the following pages is chosen?
a) Oldest page
b) Newest page
c) Frequently occurred page in the future
d) Not frequently occurred page in the future
View Answer

Answer: d
Explanation: The page which doesn’t occur more frequently in the future is chosen to be replaced with the page in the frame.
advertisement
advertisement

4. A page that is not going to be used for the next 7 seconds will be swapped out over a page that is going to be used within the next 0.7 seconds.
a) True
b) False
View Answer

Answer: a
Explanation: In an optimal page replacement algorithm, the page that is to be used later in the future is swapped out over a page that is to be used immediately.

5. Analysis of the optimal paging problem has been done through___________
a) Deterministic algorithm
b) Online algorithm
c) Euclid algorithm
d) Optimal algorithm
View Answer

Answer: b
Explanation: Analysis of the optimal paging algorithm is done through an online algorithm. Efficiency is calculated through amortized analysis.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. Optimal page replacement algorithm is implemented in __________
a) General-purpose operating system
b) Special-purpose operating system
c) In any kind of operating system
d) In Windows only
View Answer

Answer: b
Explanation: Optimal page replacement algorithm is used in special-purpose operating system because it is impossible to compute time before which a page is used.

7. Optimal page replacement algorithm is said to satisfy __________
a) Online algorithm
b) Stack algorithm
c) Queue algorithm
d) Array algorithm
View Answer

Answer: b
Explanation: Optimal page replacement algorithm is said to satisfy the stack algorithm. It is also called as inclusion property.
advertisement

8. In a stack algorithm, the set of pages in a k-frame memory is always a subset of pages in a __________ frame memory.
a) k-1
b) k
c) k+1
d) k(k+1)
View Answer

Answer: c
Explanation: Stack algorithm is satisfied if the set of pages in a k-frame memory is always a subset of pages in a k+1 frame memory.

9. When all software that runs on a system is known beforehand, optimal page replacement algorithm can be used in a general-purpose operating system.
a) True
b) False
View Answer

Answer: a
Explanation: The algorithm can be implemented in a general-purpose algorithm if the software is known beforehand and if it is amenable to the static analysis of the memory.
advertisement

10. Consider a reference string 7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1 of frame size 3. Calculate the number of page faults using optimal page replacement algorithm.
a) 10
b) 9
c) 8
d) 7
View Answer

Answer: b
Explanation: For the given string, the number of page faults using optimal page replacement algorithm is 9. It is solved in the given diagram.

11. Consider a reference string 7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1 of frame size 4. Calculate the number of page faults using optimal page replacement algorithm.
The number of page faults using optimal page replacement algorithm is 8
a) 7
b) 9
c) 8
d) 6
View Answer

Answer: c
Explanation: For the given reference string, the number of page faults using optimal page replacement algorithm is said to be 8. It is solved in the given diagram.

12. Consider a reference string 1,2,3,2,1,5,2,1,6,2,5,6,3,1,3,6,1,2,4,3 of frame size 3. Calculate the number of page faults using optimal page replacement algorithm.
The number of page faults using optimal page replacement algorithm is 14
a) 12
b) 16
c) 14
d) 15
View Answer

Answer: c
Explanation: For the given reference string, the number of page faults using optimal page replacement algorithm is said to be 14.

Sanfoundry Global Education & Learning Series – Data Structures & Algorithms.

To practice all areas of Data Structures & Algorithms, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.