Interview Prep10 min read

Top 25 Operating System Interview Questions with Answers (2026)

Operating systems questions are conceptual and high-yield in both placements and GATE. A handful of topics cover most of what's asked - get processes, scheduling, deadlocks and memory right and you're set. Here they are, answered.

A laptop with a terminal window and process icons, representing operating systems concepts

Processes & threads

Process vs thread?

A process has its own separate memory space; threads live inside a process and share its memory but keep their own stack and registers. Threads are lighter to create and switch between.

What are process states and the PCB?

A process moves through new, ready, running, waiting and terminated states. The Process Control Block stores its state, program counter, registers and other metadata the OS needs to manage it.

Why does a context switch have a cost?

Switching the CPU from one process/thread to another means saving the current one's state and loading the next one's - pure overhead during which no useful work happens.

How do processes communicate (IPC)?

Through mechanisms like pipes, shared memory and message passing, since processes don't share memory by default.

Scheduling & synchronization

Explain FCFS, SJF and Round Robin.

FCFS runs processes in arrival order (simple but suffers the convoy effect). SJF runs the shortest job next (optimal average waiting time but needs burst prediction). Round Robin gives each process a fixed time slice (fair, good for time-sharing). Be ready to compute waiting and turnaround times.

What is a race condition and the critical section?

A race condition is when the result depends on the timing of threads accessing shared data. The critical section is the code accessing that shared data, which must run with mutual exclusion.

Semaphore vs mutex, and the producer-consumer problem?

A mutex is a lock owned by one thread at a time; a semaphore is a counter controlling access to a number of permits. The producer-consumer problem uses them to coordinate a bounded buffer so producers wait when it's full and consumers wait when it's empty.

What are the four conditions for deadlock?

Mutual exclusion, hold-and-wait, no preemption, and circular wait - all four must hold. Break any one (e.g. impose a lock ordering to remove circular wait) to prevent deadlock; Banker's algorithm avoids unsafe states.

Memory management

Paging vs segmentation?

Paging splits memory into fixed-size frames, eliminating external fragmentation. Segmentation divides memory into variable-size logical units (code, stack, data) that match program structure but can fragment.

Explain virtual memory, page faults and replacement algorithms.

Virtual memory lets a program use more address space than physical RAM by paging to disk. A page fault occurs when a referenced page isn't in memory and must be loaded; FIFO, LRU and Optimal decide which page to evict when memory is full.

What is thrashing?

When processes don't have enough frames, the system spends most of its time paging in and out rather than executing. Fix it by reducing the degree of multiprogramming or adding memory.

The bottom line

Now go test yourself

Operating systems is a high-yield subject precisely because it's so predictable: processes and threads, scheduling, deadlocks and memory management cover the vast majority of questions, and most are conceptual. Add the ability to compute scheduling times and trace page replacement, and you've covered both the interview and GATE angles.

Numerical OS questions reward practice more than reading. Start an operating systems quiz, work through the scheduling and deadlock problems, and let the explanations lock in the method until the calculations feel routine.

FAQs

Frequently asked questions

Which OS topics are most important for placements?

Process vs thread, CPU scheduling, deadlocks, and paging/virtual memory are asked most, often with small numerical calculations.

Are there numerical OS questions in GATE?

Yes - scheduling (waiting/turnaround time) and page-replacement problems are common numerical questions in GATE CSE.

How do I revise OS quickly?

Drill scheduling and deadlock MCQs, and practise computing waiting times for FCFS, SJF and Round Robin until it's automatic.

What is the difference between a process and a thread?

A process has its own separate memory space, while threads live inside a process and share its memory but keep their own stack and registers. Threads are lighter to create and switch between, which is why they're used for concurrency within a program.

What are the conditions for a deadlock?

Four conditions must hold simultaneously: mutual exclusion, hold-and-wait, no preemption, and circular wait. Breaking any one of them - for example, imposing a global lock order to remove circular wait - prevents deadlock.

What is the difference between paging and segmentation?

Paging divides memory into fixed-size frames, eliminating external fragmentation. Segmentation divides memory into variable-size logical units (code, stack, data) that match program structure but can fragment.

What is virtual memory and a page fault?

Virtual memory lets a program use more address space than the physical RAM by paging data to disk. A page fault occurs when a referenced page isn't in memory and must be loaded, possibly evicting another page.

What is thrashing in operating systems?

Thrashing is when processes don't have enough memory frames, so the system spends most of its time swapping pages in and out instead of doing useful work. It's fixed by reducing multiprogramming or adding memory.

Which scheduling algorithm gives the minimum average waiting time?

Shortest Job First (SJF) is provably optimal for average waiting time, but it requires knowing or predicting each process's burst time, which isn't always possible in practice.

Related quizzes

Put it into practice

Keep reading

Related articles

Browse all articles →

Test yourself in two minutes

Six adaptive questions, every answer explained by an AI tutor. Free.

▶ Start an AI quiz