First-in, First-out Algorithm (FIFO) Multiple Choice Questions and Answers (MCQs)

This set of Data Structures & Algorithms Multiple Choice Questions & Answers (MCQs) focuses on “First-in, First-out Algorithm (FIFO)”.

1. ________ is a typical online problem from the competitive analysis to determine the optimal solution.
a) Page replacement algorithm
b) Segmentation
c) Paging
d) Segmentation with paging
View Answer

Answer: a
Explanation: Page replacement is a typical online problem from the competitive analysis. They determine which pages to page out or write to disk.

2. Which of the following is the simplest page replacement algorithm?
a) FIFO
b) Optimal page replacement
c) LRU replacement
d) Counting based replacement
View Answer

Answer: a
Explanation: FIFO is the simplest page replacement algorithm since LRU and optimal replacement algorithms require past and future data patterns respectively.

3. __________ algorithm associates with each page the time when the page was brought into memory.
a) Optimal page replacement
b) FIFO
c) LRU replacement algorithm
d) Counting based replacement
View Answer

Answer: b
Explanation: FIFO algorithm associates with each page the time when the page was brought into memory. The new page is inserted at the tail of the queue.
advertisement
advertisement

4. As the number of frames available increases, the number of page faults decreases.
a) True
b) False
View Answer

Answer: a
Explanation: One of the rules of the page replacement algorithm is that, as the number of frames available increases, the number of page faults decreases.

5. Which of the following page replacement algorithms return the minimum number of page faults?
a) LRU replacement algorithm
b) Optimal page replacement algorithm
c) FIFO
d) Counting based replacement
View Answer

Answer: b
Explanation: Though FIFO is the simplest of all algorithms, optimal page replacement algorithm returns the minimum number of page faults.

6. Which of the following is the main drawback of FIFO page replacement algorithm?
a) Requirement of large memory
b) Frame allocation
c) Reduction in multiprogramming
d) Reduced optimality
View Answer

Answer: c
Explanation: The main drawback of FIFO page replacement algorithm is that it reduces the level of multiprogramming and also causes Belady’s anomaly.

7. Which of the following is required to determine the number of page faults in FIFO?
a) Page number
b) Page frame number
c) Memory capacity
d) Segment number
View Answer

Answer: b
Explanation: To determine the number of page faults in a page replacement algorithm using FIFO, we require page frame number.
advertisement

8. In a FIFO algorithm, when a page is to be replaced, which of the following page is chosen?
a) Oldest page
b) Newest page
c) Frequently occurred page in past
d) Frequently occurred page in future
View Answer

Answer: a
Explanation: In FIFO page replacement algorithm, when a page is to be replaced, the oldest page is chosen and replaced at the tail of the queue.

9. The cost required to execute a FIFO algorithm is expensive.
a) True
b) False
View Answer

Answer: b
Explanation: The cost of a FIFO algorithm is cheap and intuitive and it is used in poor practical applications.
advertisement

10. FIFO algorithm is used by __________ operating system.
a) Linux
b) Mac
c) Windows
d) VAX/VMS
View Answer

Answer: d
Explanation: Of the following given operating systems, VAX/VMS uses a FIFO algorithm.

11. What is the competitive analysis of the FIFO algorithm?
a) k/k+1
b) k+1
c) k(k+1)
d) k/(k-h+1)
View Answer

Answer: d
Explanation: The competitive analysis of a FIFO algorithm is mathematically found to be k/(k-h+1) where k and h are some constants used in page replacement and always, h<=k.

12. Under which of the following scenarios is page replacement algorithm required?
a) When total memory exceeds physical memory
b) To determine the number of frames for each process
c) When paging and segmentation are to be used
d) Execution of a process, not in memory
View Answer

Answer: a
Explanation: An appropriate page replacement algorithm is required when the total memory requirements exceed the physical memory.

13. 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. Using FIFO algorithm, determine the number of page faults.
a) 12
b) 16
c) 14
d) 15
View Answer

Answer: d
Explanation: For the given reference string of frame size 3, the number of page faults is calculated to be 15. It is explained in the diagram.
The number of page faults is calculated to be 15 is explained in the diagram

14. 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. Using FIFO algorithm, determine the number of page faults.
a) 12
b) 16
c) 10
d) 14
View Answer

Answer: c
Explanation: For the given reference string of frame size 4, the number of page faults is calculated to be 10. It is explained in the diagram.
The number of page faults is calculated to be 10 is explained in the diagram

15. _________ states that, on a page fault, the frame that has been in memory the longest is replaced.
a) Belady’s anomaly
b) Second chance algorithm
c) Partial second chance algorithm
d) LRU replacement algorithm
View Answer

Answer: a
Explanation: Belady’s anomaly states that, on a page fault, the frame that has been in memory the longest is replaced. It occurs in FIFO algorithm.

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.