Operating systems is a core CS subject that shows up across campus placements and product-company interviews, especially for systems and backend roles. The topics are well-defined: processes and threads, scheduling, synchronization, deadlocks, and memory management. Here are the operating system interview questions that actually get asked, with answers.
Processes & threads
- What is the difference between a process and a thread?
- What is a context switch?
- Process states and the process control block (PCB).
- What is inter-process communication (IPC)?
- Concurrency vs parallelism.
CPU scheduling
- Explain scheduling algorithms — FCFS, SJF, Round Robin, Priority.
- Preemptive vs non-preemptive scheduling.
- What is starvation, and how does aging fix it?
- Turnaround time, waiting time, response time.
Synchronization & deadlocks
- What is a race condition and a critical section?
- Semaphores vs mutexes.
- The four necessary conditions for deadlock, and how to prevent or avoid one (Banker's algorithm).
- The producer-consumer and readers-writers problems.
Memory management
- Paging vs segmentation.
- What is virtual memory? What is a page fault?
- Page replacement algorithms — FIFO, LRU, Optimal.
- What is thrashing?
- Internal vs external fragmentation.
How to prepare
OS questions are conceptual and verbal — you explain mechanisms, not write code. Practise articulating each concept simply, out loud. Greenroom runs spoken technical interviews that follow up on your answers and give feedback on clarity. Pair it with our DBMS and computer networks guides.
Frequently asked questions
What are the most common operating system interview questions?
Common OS questions cover the difference between a process and a thread, context switches, CPU scheduling algorithms (FCFS, SJF, Round Robin, Priority), race conditions and critical sections, semaphores vs mutexes, the four conditions for deadlock and how to prevent them, and memory management topics like paging, virtual memory, page faults and page replacement algorithms.
What is the difference between a process and a thread?
A process is an independent program in execution with its own memory space, while a thread is the smallest unit of execution within a process that shares the process's memory and resources with other threads. Threads are lighter to create and switch between, and they enable concurrency within a process, but a crash in one thread can affect the whole process.
What are the four conditions for a deadlock?
A deadlock requires all four conditions simultaneously: mutual exclusion (a resource is held in non-shareable mode), hold and wait (a process holds resources while waiting for others), no preemption (resources can't be forcibly taken), and circular wait (a closed chain of processes each waiting on the next). Breaking any one condition prevents deadlock.
How should I prepare for an OS interview?
Build clear mental models of what actually happens — during a context switch, in each scheduling algorithm, when a deadlock forms, and how virtual memory maps to physical — rather than memorizing lists. Then practise explaining each concept simply and out loud, ideally with a voice-based mock interview, since OS rounds are conceptual and verbal.