Interview Q&A / Operating Systems
Operating Systems interview questions
Processes, threads, scheduling, memory and deadlocks, in plain words.
Prefer rapid revision? Practise Operating Systems short interview answers →
- What are the states of a process in its life cycle?
A process moves through new, ready, running, waiting (blocked) and terminated. The scheduler moves it between ready and running; I/O or events move it between running and waiting.
BeginnerQuick answer1 min read - What does fork() return, and how does a program use that value?
fork() creates a copy of the calling process. It returns 0 in the child, the child's PID in the parent, and -1 if creation failed. Programs branch on that value to run different code in each.
BeginnerQuick answer1 min read - What is a Process Control Block (PCB) and what does it store?
A PCB is the kernel data structure holding everything the OS needs to manage one process: its ID, state, saved registers, program counter, memory information, open files and scheduling data.
BeginnerQuick answer1 min read - What is the difference between a zombie process and an orphan process?
A zombie has finished running but still has an entry in the process table because its parent has not collected its exit status. An orphan is still running but its parent has died; init adopts it.
BeginnerQuick answer1 min read