250+ TOP MCQs on Optimal Page Replacement Algorithm and Answers

This set of Data Structures & Algorithms Multiple Choice Questions 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

Answer: a
Clarification: 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

Answer: c
Clarification: 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
Answer: d
Clarification: 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
Answer: a
Clarification: 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

Answer: b
Clarification: Analysis of the optimal paging algorithm is done through an online algorithm. Efficiency is calculated through amortized analysis.

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

Answer: b
Clarification: 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

Answer: b
Clarification: 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)

Answer: c
Clarification: 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

Answer: a
Clarification: 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
Answer: b
Clarification: 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.
optimal-page-replacement-algorithm-questions-answers-q11
a) 7
b) 9
c) 8
d) 6

Answer: c
Clarification: 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.
optimal-page-replacement-algorithm-questions-answers-q12
a) 12
b) 16
c) 14
d) 15

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

Leave a Reply

Your email address will not be published. Required fields are marked *