Operating Systems · Module 9 — Interview Capstone
Answer frames for the 20 most-asked questions
You will not always get through all four. Beats 1 and 3 are the ones to protect if you are cut short. The twenty questions, with the skeleton of an answer for each. These are the ones that actually recur.
Sign in to track your score
Two candidates are asked "what is a semaphore?".
The first says: "It's a synchronisation primitive used for mutual exclusion." True, and it ends the conversation.
The second says: "It's an integer counter with two atomic operations, where the count is how many of a resource are left. The browser allows three connections, so its semaphore starts at 3 — the fourth thread sleeps until somebody signals. The cost is that it's a convention: one thread that forgets to call wait breaks the whole thing."
Same knowledge. One of them gets a follow-up question instead of a change of subject.
Why & what
The four-beat frame. Almost every OS question fits this shape.
- Define — one sentence, no hedging. If you cannot say it in one sentence, you do not know it yet.
- Mechanism — how it actually works. The steps, or the hardware that makes it possible. This is where most answers stop short.
- Example — one concrete case with a number or a name. "A 4 ms quantum against a 5 µs switch" beats any adjective.
- Trade-off — what it costs. Nothing in an operating system is free, and naming the cost is what separates understanding from recall.
You will not always get through all four. Beats 1 and 3 are the ones to protect if you are cut short. The twenty questions, with the skeleton of an answer for each. These are the ones that actually recur.
Module 1 — Foundations
- What is an operating system? Referee, illusionist, glue — one example each.
- What happens when you press the power button? Firmware → bootloader → kernel → first process → login.
Module 2 — Processes and Threads
- Program vs process? Passive file vs running instance with its own memory and place in the instruction stream.
- What is in a PCB? PID, program counter, registers, state, memory map, open files — everything needed to restart it exactly.
- Process vs thread? Threads share code, data, heap and open files; each keeps a private stack, registers and program counter. Switching is cheaper because the memory map does not change.
Module 3 — Scheduling
- Preemptive vs non-preemptive? Whether the OS can take the core back, which requires a timer interrupt.
- Why not just use SJF? It is optimal for average waiting time and needs burst lengths in advance, which the OS cannot know.
- What if the Round Robin quantum is too large or too small? Too large and it becomes FCFS; too small and the 5 µs switch dominates.
Module 4 — Synchronisation
- What is a race condition? Output depending on thread timing rather than program logic. One line of code is three machine instructions.
- Why can't a lock be built from an if-statement? The check and the set are two instructions with a gap. You need one atomic instruction.
- Solve producer–consumer. Three semaphores — empty, full, mutex — and explain what breaks if you swap the first two waits.
Module 5 — Deadlocks
- The four conditions? Mutual exclusion, hold and wait, no preemption, circular wait. All four are required.
- How do you prevent deadlock in real code? Lock ordering — number the locks, always acquire in increasing order.
- Unsafe state vs deadlock? Unsafe means a deadlock is reachable from here; deadlock means it has already happened.
Module 6 — Memory
- Logical vs physical address? What the program says vs where it lands. The separation is what enables protection and relocation.
- Explain paging with an example. Page number plus offset; the offset is never translated. 0x2328 → 0x7328.
Module 7 — Virtual Memory
- Walk through a page fault. Trap, validate, find a frame, read 100 µs from swap, restart the instruction.
- What is Belady's anomaly? More frames producing more faults; FIFO can, LRU and Optimal cannot.
Module 8 — Files and I/O
- What is an inode and why is the name separate? Metadata plus block list; separating the name is what makes hard links and instant renames possible.
- Compute head movement for FCFS, SSTF, SCAN. State your direction and counting convention, then add up the distances.
How it works
Building an answer live, in about ten seconds of thinking:
- Say the definition first, even while you are still assembling the rest. It buys time and it anchors the answer.
- Reach for the mechanism. How does the hardware or the OS actually do this?
- Pick your example from the Nova-14. You have used the same laptop for thirty-three topics; the numbers are already in your head.
- Name one cost. There is always one.
- Stop. A four-beat answer that ends cleanly invites a follow-up. Rambling does not.

Common confusion
"Longer answers are better answers." They are not. An interviewer is listening for structure, not volume. Four beats and a clean stop reads as confidence; five minutes of everything you can remember reads as uncertainty.
"You should never say you don't know." Say it, then say what you do know that is adjacent. "I haven't used that directly, but it sounds like the same trade-off as spinlock versus mutex — is it?" is a genuinely good answer.
"Memorising twenty answers is enough." The frame matters more than the list. The twenty above are the common ones, not the only ones, and an interviewer who asks the twenty-first will immediately see which you have.
Interview angle
Two habits that are worth more than any individual answer.
Volunteer the trade-off. Most candidates describe the benefit and stop. If you add the cost unprompted — "the TLB gives us 120 ns instead of 200, but it gets flushed on every context switch" — you have answered the follow-up before it was asked.
Reach across modules. When paging comes up, mention that the offset trick is why external fragmentation disappears. When starvation comes up, note it is the same problem in scheduling and in SSTF disk scheduling. Interviewers are explicitly listening for whether topics are connected in your head or filed separately.
- 1.
Which two beats of the answer frame should you protect if you are cut short?
- 2.
An interviewer asks about the TLB and you describe the speed benefit. What should you add unprompted?
- 3.
What is the strongest answer to a question you genuinely do not know?