Level 1: Bronze
A memorized definition. Not wrong, but it stops there.
They decide which page to push out when memory is full. FIFO and LRU are two of them.
2 stars Asked often.
In one or two sentences
They are the rules for choosing which page to evict when no frame is free. FIFO, LRU, optimal and clock are the usual ones.
Say it out loud, or type it below. What you type never leaves this device.
A memorized definition. Not wrong, but it stops there.
They decide which page to push out when memory is full. FIFO and LRU are two of them.
Correct, but too broad or missing context.
FIFO evicts the page that came in first. LRU evicts the page unused for the longest time. LRU fits locality better, so it usually faults less.
Reaches principle, use and trade-off, with words that invite the next question.
Optimal evicts the page that will be used furthest in the future. It faults least but needs the future, so it only serves as a yardstick. LRU guesses the future from the past, but tracking order on every access is expensive, so real systems use approximations such as clock, which relies on a reference bit. FIFO is simple but suffers Belady's anomaly, where more frames can mean more faults. It is a trade between accuracy and implementation cost.
These are likely next questions from an interviewer. Think of your answer first, then press the button.
1 / 3
What is locality?
The tendency of a program to reuse recent addresses and ones near them. There is temporal and spatial locality, and caches and paging both rely on it.
2 / 3
How does the clock algorithm work?
Frames sit in a circle and a hand sweeps around. If the reference bit is 1, clear it and move on. If it is 0, replace that page. It imitates LRU cheaply.
3 / 3
What is a working set?
The set of pages a process actually touched over a recent window. If it gets fewer frames than that, faults become frequent.
This is a textbook level concept, so no outside source is listed.