0
0
Operating Systemsknowledge~20 mins

Page replacement algorithms (FIFO, LRU, Optimal) in Operating Systems - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Page Replacement Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding FIFO Page Replacement

Consider a system using the FIFO (First-In-First-Out) page replacement algorithm with 3 page frames. Given the page reference string: 7, 0, 1, 2, 0, 3, 0, 4, how many page faults will occur?

A7
B5
C6
D4
Attempts:
2 left
💡 Hint

Remember, FIFO replaces the oldest loaded page first.

🔍 Analysis
intermediate
2:00remaining
LRU Page Replacement Behavior

Using the LRU (Least Recently Used) algorithm with 4 page frames, analyze the page reference string: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5. How many page faults will occur?

A10
B9
C8
D7
Attempts:
2 left
💡 Hint

LRU replaces the page that was least recently used when a replacement is needed.

Comparison
advanced
2:00remaining
Optimal vs FIFO Page Replacement

Given the page reference string 2, 3, 2, 1, 5, 2, 4, 5, 3, 2, 5, 2 and 3 page frames, which algorithm results in fewer page faults: FIFO or Optimal?

AFIFO results in fewer page faults
BCannot determine without frame size
COptimal results in fewer page faults
DBoth have the same number of page faults
Attempts:
2 left
💡 Hint

Optimal algorithm replaces the page that will not be used for the longest time in the future.

Reasoning
advanced
2:00remaining
Identifying Page Faults in LRU

With 2 page frames and the reference string 1, 2, 3, 2, 1, 4, 5, which pages cause page faults under the LRU algorithm?

A1, 2, 3, 4, 5
B1, 2, 3, 5
C1, 2, 3, 4
D1, 3, 4, 5
Attempts:
2 left
💡 Hint

Page faults occur when a page is not in any frame at the time of reference.

📋 Factual
expert
2:00remaining
Optimal Page Replacement Algorithm Property

Which statement correctly describes the Optimal page replacement algorithm?

AIt replaces the page that was loaded first in memory
BIt replaces the page that has the highest frequency of use
CIt replaces the page that was least recently used
DIt replaces the page that will not be used for the longest time in the future
Attempts:
2 left
💡 Hint

Think about how Optimal predicts future page references.