Coursify

Operating System

PYQ Analysis & Exam Preparation — Module 5

50 mins

A strategic analysis of 29 exam questions spanning 2019–2024. Module 5 is the most numerically intensive module in the course — page replacement traces and TLB calculations appear every single year. Know exactly what to practice.

Learning Goals

  • Identify the four guaranteed numerical question types: page replacement traces, EAT/TLB calculations, fit algorithms, and address translation.
  • Practice with actual MCQ questions from 2019–2024 papers.
  • Understand the answer structure for the highest-mark theoretical questions: Thrashing, Belady's Anomaly, and Paging.

The Exam Blueprint: Module 5 PYQ Deep Analysis (2019–2024)

An analysis of 29 exam questions spanning 2019 to 2024 reveals that Module 5 is the most numerically intensive module in the entire OS course. The 2019 paper alone had a 14-mark page replacement question. In 2022, there were 5 separate questions on memory management topics. In 2023 and 2024, Module 5 consistently dominates the exam paper.

Complete PYQ Table (29 Questions)

YearQ#MarksTopicType
2019Q1j2Physical memory fixed blocks = framesMCQ
2019Q714LRU + FIFO with 4 and 3 frames (string: 23 refs)Numerical
2022Q1f2Belady's anomaly occurs in FIFOMCQ
2022Q1j2Worst-fit allocates the largest holeMCQ
2022Q3a7Address binding + various schemesTheory
2022Q3b7LRU numerical: 16-page string, 4 framesNumerical
2022Q6b7Thrashing: cause, detection, eliminationTheory
2022Q7a7Fragmentation: internal vs externalTheory
2022Q7b7TLB EAT calculation (hit ratio = 0.6)Numerical
2022Q8b7TLB in paging hardware + benefitsTheory
2022Q9b7Short notes: PagingTheory
2023Q1a2Variable partition → external fragmentationMCQ
2023Q1e2Virtual memory = illusion of large memoryMCQ
2023Q1h224KB space, 4096B page → 6 pagesMCQ
2023Q4a4Compare compile/load/execution-time bindingTheory
2023Q4b3Purpose of modify (dirty) bit in page tableTheory
2023Q4c7Paging with TLB + diagramsTheory
2023Q5a5Thrashing: main cause + how to limitTheory
2023Q5b9FIFO + LRU + Optimal: 20-ref string, 4 framesNumerical
2023Q9a7Short notes: Inverted Page TableTheory
2023Q9d7Short notes: Belady's AnomalyTheory
2024Q1g2Demand paging: loaded only when requiredMCQ
2024Q4a7Virtual memory + implementation + TLB diagramTheory
2024Q4b7Fixed vs variable partition + compactionTheory
2024Q6b7Belady's Anomaly + why LRU/Optimal immuneTheory
2024Q7a7Thrashing: what, when, how to avoidTheory
2024Q7b7FIFO vs LRU comparison: 14-ref string, 4 framesNumerical
2024Q8a7Address translation in paging + power of 2Theory
2024Q8b7First-fit and best-fit with 5 partitions + 4 processesNumerical

Total marks tracked: 166 marks across 5 years.


Topic Heat Map

Topic2019202220232024Total Marks
Page Replacement Numericals14M ✅7M ✅9M ✅7M ✅37M
Paging + TLB (theory + numerical)21M ✅14M ✅14M ✅49M
Thrashing7M ✅5M ✅7M ✅19M
Belady's Anomaly2M ✅7M ✅7M ✅16M
Fragmentation + Fit Algorithms7M ✅7M ✅14M
Address Binding7M ✅4M ✅11M
Virtual Memory2M ✅7M ✅9M

The Four Guaranteed Question Types

1. 🔴 Page Replacement Numerical (7–14M) — appeared in ALL 4 years The biggest mark earner in the module. Practice all 3 algorithms (FIFO, LRU, Optimal) on the SAME reference string. The 2023 paper asked all three in one 9-mark question. 2019 asked the same string with both 4 AND 3 frames.

2. 🟠 Paging + TLB (7M) — appeared 2022, 2023, 2024 consecutively Either a pure theory question (explain paging with TLB diagram) or a numerical (EAT calculation). Know both. The 2022 Q7b asked for an exact EAT value — solved below.

3. 🟡 Thrashing (5–7M) — appeared 2022, 2023, 2024 consecutively Always the same 3-part structure: define thrashing, explain the cause (working sets exceed available frames), describe the fix (working set strategy / reduce multiprogramming degree).

4. 🟢 Belady's Anomaly (2–7M) — trending: 2022 MCQ → 2023 short notes → 2024 full 7M question The 2024 question specifically asked why LRU and Optimal are IMMUNE. Know the "stack algorithm" explanation.

Solved Numericals: The Exam-Critical Calculations


Numerical 1: TLB Effective Access Time [2022 Q7b — 7 Marks]

"TLB search time = 10ms, memory access time = 80ms, TLB hit ratio = 0.6. Find EAT."

EAT=α×(ϵ+m)+(1α)×(ϵ+2m)\text{EAT} = \alpha \times (\epsilon + m) + (1-\alpha) \times (\epsilon + 2m) =0.6×(10+80)+0.4×(10+80+80)= 0.6 \times (10 + 80) + 0.4 \times (10 + 80 + 80) =0.6×90+0.4×170= 0.6 \times 90 + 0.4 \times 170 =54+68=122 ms= 54 + 68 = \mathbf{122 \text{ ms}}

Interpretation: Without TLB (always 2 memory accesses): 10+80+80=17010 + 80 + 80 = 170 ms. With TLB at 60% hit rate: 122 ms — a 28% improvement. A modern system with 95%+ hit rate achieves near-ideal performance.


Numerical 2: First-Fit vs Best-Fit [2024 Q8b — 7 Marks]

"Partitions: 100KB, 500KB, 200KB, 300KB, 600KB. Processes: 212KB, 417KB, 112KB, 426KB. Compare First-Fit and Best-Fit."

First-Fit (scan left to right, take first hole that fits):

ProcessScansAllocated FromRemaining in Slot
212KB100❌→500✅500KB slot288KB
417KB100❌→288❌→200❌→300❌→600✅600KB slot183KB
112KB100❌→288✅288KB slot176KB
426KB100❌→176❌→200❌→300❌→183❌❌ Cannot allocate

First-Fit fails to place the 4th process (426KB).

Best-Fit (find smallest hole that is big enough):

ProcessCandidates (≥ size)Best HoleRemaining
212KB500(288), 300(88), 600(388)300KB (smallest gap=88)88KB
417KB500(83), 600(183)500KB (smallest gap=83)83KB
112KB200(88), 600(488)200KB (smallest gap=88)88KB
426KB600(174)600KB174KB

Best-Fit successfully allocates ALL 4 processes.

Verdict: Best-Fit makes more efficient use of memory in this case. Final holes: 100, 83, 88, 88, 174 KB.


Numerical 3: Page Number Calculation [2023 Q1h — 2 Marks]

"Process has 24KB logical address space, page size = 4096 bytes. Number of pages?"

Number of pages=24×10244096=24,5764096=6 pages\text{Number of pages} = \frac{24 \times 1024}{4096} = \frac{24{,}576}{4096} = \mathbf{6 \text{ pages}}

Answer: (ii) 6


Numerical 4: LRU Trace [2022 Q3b — 7 Marks]

"Reference string: 0, 4, 8, 20, 24, 36, 44, 12, 68, 72, 80, 84, 28, 32, 88, 92. 4 frames, LRU policy."

Key observation: All 16 page numbers are distinct — no page is referenced twice. Therefore, LRU (and FIFO and Optimal) all produce the same result: every reference is a page fault = 16 page faults.

Final frames (last 4 pages loaded): 28, 32, 88, 92 ← pages in memory at end of string.


The Ultimate Numerical Challenge [2023 Q5b — 9 Marks]

"Reference string: 7,2,3,1,2,5,3,4,6,7,7,1,0,5,4,6,2,3,0,1. 4 frames. Count faults for FIFO, LRU, and Optimal."

Expected Results (trace yourself — compare with these):

AlgorithmPage Faults
FIFO~14–15 faults
LRU~12–13 faults
Optimal~8–9 faults

Hint for Optimal: At each fault, look ahead in the string. The page whose NEXT USE is furthest in the future gets evicted. Pages that never appear again in the remaining string are always evicted first.

Practice strategy: Trace FIFO first (easiest — just a queue). Then trace LRU (maintain order by recency). Then trace Optimal (scan ahead for each eviction). Count faults for each. The examiner wants all three Gantt-chart-style traces shown.

Knowledge Check

Question 1 of 5
Q1Single choice

[2019 Q1j] Physical memory is broken into fixed-sized blocks called:

High-Yield Subjective Bank: Structure Your Answers


[2022 Q7a / 2024 Q4b — 7 Marks] Fragmentation + Fixed vs Variable Partition

Answer structure:

  1. Internal Fragmentation (2M): Wasted space INSIDE an allocated partition. Occurs in fixed partitioning. Example: 4KB partition holding a 3KB process wastes 1KB inside.
  2. External Fragmentation (2M): Wasted space BETWEEN allocated partitions. Occurs in variable partitioning. Total free memory may be sufficient but no single hole is large enough.
  3. Fixed Partition (1M): Equal/unequal fixed divisions at boot. Advantage: simple. Disadvantage: internal fragmentation.
  4. Variable Partition (1M): Holes sized exactly to the process. Advantage: no internal fragmentation. Disadvantage: external fragmentation.
  5. Compaction (1M): Consolidate all free holes into one large block by shuffling processes in memory. Requires execution-time binding. Slow but eliminates external fragmentation.

[2022 Q6b / 2023 Q5a / 2024 Q7a — 5–7 Marks] Thrashing

Answer structure (3-part formula — always works):

  1. Definition (1M): Thrashing occurs when a process spends more time paging than executing. CPU utilization collapses despite the system being "active."
  2. Cause (2M): When total demand D = Σ|Wi| (sum of working set sizes) > m (available frames). The OS cannot keep every process's working set in RAM. Processes constantly page fault, causing continuous disk I/O.
  3. Prevention/Detection/Elimination (3–4M):
    • Working Set Strategy: Monitor working set size of each process. If D > m, suspend processes until D ≤ m.
    • Page Fault Frequency (PFF): Set upper and lower bounds on the acceptable page fault rate. If a process's rate exceeds the upper bound, give it more frames. If below the lower bound, take frames away. If increasing frames doesn't help, suspend the process.

[2023 Q9d / 2024 Q6b — 7 Marks] Belady's Anomaly

Answer structure:

  1. Definition (2M): The counterintuitive property of FIFO where increasing the number of available frames can increase the number of page faults.
  2. Demonstration (3M): Show the standard example — reference string 1,2,3,4,1,2,5,1,2,3,4,5 produces 9 faults with 3 frames but 10 faults with 4 frames using FIFO.
  3. Why LRU and Optimal are IMMUNE (2M): They are stack algorithms. A stack algorithm has the property that the set of pages in memory with nn frames is always a subset of the pages in memory with n+1n+1 frames. Adding a frame never removes a page that was previously in memory. FIFO is NOT a stack algorithm.

[2022 Q3a / 2023 Q4a — 4–7 Marks] Address Binding

Answer structure:

  1. Definition (1M): Address binding is the mapping of instructions/data addresses from one space to another.
  2. Compile-Time (2M): Absolute physical addresses generated by the compiler. Process must always load at the same location. Not flexible.
  3. Load-Time (2M): Relocatable code generated; loader translates to physical addresses at load time. Process cannot move after loading.
  4. Execution-Time (2M): Logical addresses used at runtime; MMU translates every access. Process can be moved in memory. Requires MMU hardware support. Used by all modern OSes.

To view the complete PYQ for Module 5, go here: https://pyqdeck.in/it/it_sem5/it_sem5_106503/practice/chapter