# 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

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

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
c) Frequently occurred page in the future
d) Not frequently occurred page in the future

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

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

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

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

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

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

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)

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

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.

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

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.

a) 7
b) 9
c) 8
d) 6

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.

a) 12
b) 16
c) 14
d) 15

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]