Bird
Raised Fist0

Trace the sequence of page faults when using the FIFO algorithm with 3 frames for the reference string: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5. How many page faults occur?

easy🧠🧾 Concept Trace Q12 of Q15
Operating Systems - Page Replacement - FIFO, LRU, Optimal Algorithm
Trace the sequence of page faults when using the FIFO algorithm with 3 frames for the reference string: 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5. How many page faults occur?
A8
B9
C10
D7
Step-by-Step Solution
  1. Step 1: Initialize FIFO with empty frames

    Frames: []
  2. Step 2: Process each page in order

    1 -> fault, frames: [1]
    2 -> fault, frames: [1,2]
    3 -> fault, frames: [1,2,3]
    4 -> fault, evict 1, frames: [4,2,3]
    1 -> fault, evict 2, frames: [4,1,3]
    2 -> fault, evict 3, frames: [4,1,2]
    5 -> fault, evict 4, frames: [5,1,2]
    1 -> hit
    2 -> hit
    3 -> fault, evict 1, frames: [5,3,2]
    4 -> fault, evict 2, frames: [5,3,4]
    5 -> hit
  3. Step 3: Count faults

    Total faults = 9
  4. Final Answer:

    Option B -> Option B
  5. Quick Check:

    FIFO evicts oldest page regardless of future use, causing 9 faults here.
Quick Trick: FIFO faults count equals number of unique pages plus evictions [OK]
Common Mistakes:
MISTAKES
  • Counting hits as faults
  • Misordering evictions in FIFO
  • Forgetting to update frames after eviction
Trap Explanation:
PITFALL
  • Options with 7 or 8 faults underestimate evictions; 10 faults overcount by treating hits as faults.
Interviewer Note:
CONTEXT
  • Tests candidate's ability to mentally simulate FIFO page replacement and count faults accurately.
Master "Page Replacement - FIFO, LRU, Optimal Algorithm" in Operating Systems

2 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Operating Systems Quizzes