# Top Operating System Interview Questions — With Short Answers

Source: https://skills101.in/learn/operating-systems/os-interview-questions — Skills101 free tutorial (Operating Systems). Updated 2026-11-09.

Revise these before technical rounds. Each answer fits in two lines — expand with an example if asked.

![Process states: new, ready, running, waiting and terminated — the starting point for many OS questions](https://skills101.in/learn-img/operating-systems/process-states.svg)

## Basics

1. **What is an OS?** Software that manages hardware and provides services to programs: processes, memory, files, devices, security.
2. **Kernel?** The core of the OS running in privileged kernel mode.
3. **System call?** The way a program requests an OS service (e.g. `read`, `fork`).
4. **Monolithic vs microkernel?** Monolithic: all services in the kernel (fast, Linux). Microkernel: minimal kernel, services in user space (stable, modular).

## Processes and threads

5. **Program vs process?** A program is a passive file; a process is a program in execution.
6. **Process vs thread?** Processes have separate memory; threads share their process's memory and have their own stacks.
7. **What is a PCB?** The Process Control Block — the OS's record of a process (PID, state, registers, memory info).
8. **Context switch?** Saving one process's CPU state and loading another's; pure overhead.
9. **Zombie vs orphan?** Zombie: finished but not yet reaped by its parent. Orphan: parent died; adopted by init.

## Scheduling

10. **Preemptive vs non-preemptive?** Preemptive can interrupt a running process; non-preemptive lets it finish its burst.
11. **Which scheduling minimises average waiting time?** SJF (non-preemptive) / SRTF (preemptive).
12. **Convoy effect?** In FCFS, short jobs wait behind a long one.
13. **Starvation and aging?** Starvation: a process waits indefinitely. Aging: gradually raising its priority.

## Synchronization and deadlock

14. **Race condition?** The output depends on the timing of concurrent access to shared data.
15. **Mutex vs semaphore?** Mutex: a lock with an owner. Semaphore: a counter with wait/signal; can manage n resources.
16. **Deadlock conditions?** Mutual exclusion, hold and wait, no preemption, circular wait — all four.
17. **Deadlock vs starvation?** Deadlock: processes wait for each other forever. Starvation: one process waits while others progress.
18. **Banker's algorithm?** Deadlock avoidance — grant a request only if the system stays in a safe state.

## Memory

19. **Paging vs segmentation?** Paging: fixed-size pages (no external fragmentation). Segmentation: variable-size logical segments.
20. **Internal vs external fragmentation?** Internal: waste inside an allocated block. External: free memory split into unusable holes.
21. **What is a TLB?** A fast cache of page-table entries that speeds up address translation.
22. **Virtual memory?** Using disk to extend RAM; only needed pages stay in memory (demand paging).
23. **Page fault?** Accessing a page that isn't in RAM; the OS loads it from disk.
24. **Thrashing?** Excessive paging that leaves the CPU idle; fix by reducing multiprogramming or adding frames.
25. **Belady's anomaly?** With FIFO replacement, more frames can cause more page faults.

## Bonus: quick calculations interviewers like

- **n calls to fork()** → **2ⁿ** processes in total.
- **Page number / offset:** page = address ÷ page size, offset = address mod page size.
- **Waiting time** = turnaround − burst; **turnaround** = completion − arrival.

## Common mistakes

- Mixing up deadlock prevention (break a condition) and avoidance (stay safe).
- Saying threads have separate heaps.
- Forgetting that all four deadlock conditions are needed together.

## Quick recap

- Revise: kernel, process vs thread, PCB, scheduling, race conditions, mutex vs semaphore, deadlock, paging, virtual memory, thrashing.
- Answer in two lines, then give an example.


Practice quiz and free certificate: https://skills101.in/learn/operating-systems/os-interview-questions