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 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 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