Interview questions

Operating System Interview Questions

20 operating system interview questions with model answers: processes vs threads, scheduling, deadlock, paging and virtual memory. For both sides.

Operating System Interview Questions

What's here

20 Operating System interview questions, grouped into 4 areas: processes and threads, scheduling and synchronisation, memory management and storage, i/o and practical questions. Each one comes with why it is worth asking and what a strong answer contains, so the same question can be scored the same way by different interviewers.

  • Follow each definition with a 'where have you seen this?' question: a deadlock they debugged, a memory issue in production.
  • Ask for the four deadlock conditions and then a practical way to break one in real code.
  • Use a short concurrent counter example to test understanding of race conditions and locks.
For hiring teams

Cohesyve finds, contacts and tests Operating System candidates on the real work, then ranks them for these interviews. Ten candidates free, no card.

Preparing for this interview yourself? Practise it free →

These operating system interview questions cover the OS concepts asked in software engineering, systems and SRE interviews and in campus placements: processes and threads, scheduling, synchronisation and deadlock, memory management and virtual memory, file systems and I/O, plus practical Linux troubleshooting. Candidates can use the 'what to look for' notes as model answers; interviewers can use them as a scoring guide.

Processes and Threads

The units of execution an operating system manages.

  1. 1

    What is the difference between a process and a thread?

    Why ask it

    The most common OS interview question.

    What to look for

    A process is a running program with its own address space and resources; threads are units of execution within a process that share its memory and open files but have their own stack and registers. Threads are cheaper to create and switch between but need synchronisation; processes are better isolated.
  2. 2

    What is a context switch, and why is it expensive?

    Why ask it

    Explains performance costs of concurrency.

    What to look for

    The OS saves the state of the running process or thread (registers, program counter) and loads another's. Costs include the save and restore work, kernel entry, and indirect effects such as cache and TLB misses; switching between processes also changes the address space.
  3. 3

    What are the states a process moves through?

    Why ask it

    Basic OS vocabulary.

    What to look for

    New, ready, running, waiting (blocked) and terminated. A running process moves to waiting on I/O, back to ready when the I/O completes, and to ready when preempted. The scheduler picks from the ready queue.
  4. 4

    What is the difference between user mode and kernel mode, and what is a system call?

    Why ask it

    Fundamental to how programs interact with the OS.

    What to look for

    Kernel mode can execute privileged instructions and access hardware; user mode cannot, which protects the system. A system call is the controlled way a user program asks the kernel for a service (reading a file, creating a process), switching into kernel mode and back.
  5. 5

    How are new processes created on Unix-like systems?

    Why ask it

    Common in systems and Linux-focused interviews.

    What to look for

    fork creates a copy of the calling process (usually with copy-on-write memory), and exec replaces the child's program with a new one. The parent can wait for the child to collect its exit status. Good answers mention copy-on-write making fork cheap.
For hiring teams

Before the Operating System interviews, see who can do the work

Cohesyve finds and contacts Operating System candidates from your job description and tests each one on an AI job simulation of the role, so these questions go to a ranked shortlist. Ten candidates free, no card.

Scheduling and Synchronisation

How the OS shares the CPU and how concurrent code stays correct.

  1. 6

    Compare common CPU scheduling algorithms.

    Why ask it

    Classic theory question with real trade-offs.

    What to look for

    First-come first-served (simple, long jobs delay short ones), shortest job first (good average waiting time, needs run-time estimates, can starve long jobs), round robin (time slices, fair and responsive, slice length matters) and priority scheduling (can starve low-priority work, fixed by ageing). Real systems combine ideas.
  2. 7

    What is a race condition, and what is a critical section?

    Why ask it

    The root of most concurrency bugs.

    What to look for

    A race condition is when the result depends on the timing of threads accessing shared data, such as two threads incrementing a counter. A critical section is code that accesses shared state and must not run in more than one thread at once. Solutions: locks, atomic operations, or avoiding shared mutable state.
  3. 8

    What is the difference between a mutex and a semaphore?

    Why ask it

    A standard synchronisation question.

    What to look for

    A mutex gives one thread exclusive access and is released by the thread that holds it. A semaphore is a counter that allows up to N concurrent holders; a binary semaphore resembles a mutex but has no ownership. Semaphores also suit signalling between threads, such as producer and consumer.
  4. 9

    What is a deadlock? Name the four conditions and how to prevent it.

    Why ask it

    One of the most frequently asked OS questions.

    What to look for

    Threads each waiting for resources held by the others, so none proceed. The four conditions: mutual exclusion, hold and wait, no preemption and circular wait. Break one to prevent it, for example by always acquiring locks in a fixed order. Avoidance (such as the banker's algorithm) and detection with recovery are alternatives.
  5. 10

    What is priority inversion, and how is it handled?

    Why ask it

    Tests deeper scheduling knowledge.

    What to look for

    A high-priority task waits for a lock held by a low-priority task, which is itself preempted by medium-priority tasks, so the high-priority task waits indefinitely. Priority inheritance temporarily raises the lock holder's priority to the waiting task's level.

Memory Management

Virtual memory and paging, the second big theme in OS interviews.

  1. 11

    What is virtual memory, and why do operating systems use it?

    Why ask it

    A core concept that underpins isolation and memory use.

    What to look for

    Each process sees its own large, contiguous address space that the OS maps to physical memory and disk. Benefits: isolation between processes, running programs larger than physical RAM, sharing code between processes, and simpler memory allocation for programs.
  2. 12

    What is the difference between paging and segmentation? What is a TLB?

    Why ask it

    Tests understanding of address translation.

    What to look for

    Paging splits memory into fixed-size pages and frames, mapped through page tables, which avoids external fragmentation. Segmentation splits it into variable-sized logical segments such as code and stack. The TLB is a cache of recent address translations that avoids walking the page table on every memory access.
  3. 13

    What is a page fault, and how do page replacement algorithms work?

    Why ask it

    Connects theory to performance.

    What to look for

    A page fault occurs when a process accesses a page that is not in physical memory; the OS loads it, possibly evicting another page. Algorithms: FIFO, LRU (approximated in practice, for example by the clock algorithm) and the theoretical optimal algorithm. Bonus: Belady's anomaly, where FIFO can fault more with more frames.
  4. 14

    What is thrashing?

    Why ask it

    A classic performance failure mode.

    What to look for

    The system spends most of its time swapping pages in and out because processes' working sets do not fit in memory, so useful work collapses. Fixes: reduce the number of running processes, add memory, or control allocation using working-set ideas.
  5. 15

    What is the difference between the stack and the heap, and between internal and external fragmentation?

    Why ask it

    Practical memory knowledge for programmers.

    What to look for

    The stack holds function call frames and local variables, allocated and freed automatically in order; the heap holds dynamically allocated memory with flexible lifetimes. Internal fragmentation is wasted space inside allocated blocks; external fragmentation is free memory split into pieces too small to use.

Storage, I/O and Practical Questions

File systems, devices and the hands-on troubleshooting expected in systems and SRE roles.

  1. 16

    What is an inode, and what is the difference between a hard link and a symbolic link?

    Why ask it

    Common in Linux and systems interviews.

    What to look for

    An inode stores a file's metadata and the location of its data, but not its name; directory entries map names to inodes. A hard link is another name for the same inode, and the data remains until all hard links are removed. A symbolic link is a separate file containing a path, which breaks if the target moves.
  2. 17

    What is the difference between interrupts and polling, and what is DMA?

    Why ask it

    Tests understanding of how the OS talks to hardware.

    What to look for

    With polling, the CPU repeatedly checks a device's status, wasting cycles; with interrupts, the device signals the CPU when it needs attention. DMA lets devices transfer data directly to memory without the CPU copying each byte, interrupting only when the transfer completes.
  3. 18

    A Linux server is slow. How would you investigate?

    Why ask it

    Turns theory into practical diagnosis.

    What to look for

    Check load and CPU (top or htop, uptime), memory and swapping (free, vmstat), disk I/O (iostat), network, and which processes use the most resources, then logs. Strong candidates separate CPU-bound, memory-bound and I/O-bound causes before acting.
  4. 19

    What are zombie and orphan processes?

    Why ask it

    A common Linux interview question.

    What to look for

    A zombie has finished but its parent has not yet read its exit status, so it keeps an entry in the process table. An orphan's parent has exited, and it is adopted by init or a designated reaper process. Fix zombies by having the parent wait for its children or by restarting the parent.
  5. 20

    Describe what happens when a computer boots.

    Why ask it

    Tests a joined-up view of the system.

    What to look for

    Firmware (BIOS or UEFI) initialises hardware and finds a bootloader, the bootloader loads the kernel (and often an initial RAM disk), the kernel initialises drivers and mounts the root file system, then starts the first user-space process (init, such as systemd), which starts services.

Running the interview well

  • 1Follow each definition with a 'where have you seen this?' question: a deadlock they debugged, a memory issue in production.
  • 2Ask for the four deadlock conditions and then a practical way to break one in real code.
  • 3Use a short concurrent counter example to test understanding of race conditions and locks.
  • 4For SRE and systems roles, include the slow Linux server scenario and ask which commands they would run.
  • 5For graduate and campus interviews, focus on processes, threads, scheduling, deadlock and paging, which most courses cover.
  • 6Let candidates draw diagrams; memory and scheduling answers are often clearer on paper.

Common questions

What operating system topics are asked most in interviews?

Processes versus threads, context switching, CPU scheduling, race conditions, mutexes and semaphores, deadlock, virtual memory, paging, page replacement and thrashing.

How should I prepare for OS interview questions?

Revise the core topics from a standard operating systems textbook or course, practise explaining each with a small example or diagram, and write simple multithreaded code to see race conditions and locking in action. Using Linux day to day helps with practical questions.

Why do software engineering interviews ask about operating systems?

OS concepts explain how programs actually run: concurrency, memory use and I/O. They help engineers debug performance problems and write correct concurrent code.

Are OS questions asked in campus placements?

Yes. Operating systems is a core computer science subject, and placement interviews often include questions on processes, scheduling, deadlock and memory management alongside data structures, databases and networks.

Do I need to know Linux for operating system interviews?

For systems, DevOps and SRE roles, yes: expect process management, file permissions, links and troubleshooting commands. For general software roles, the concepts matter more than specific commands.

What is the difference between multitasking, multiprocessing and multithreading?

Multitasking runs several tasks by switching between them; multiprocessing uses several CPUs or cores to run tasks truly in parallel; multithreading runs several threads within one process, which can run in parallel on multiple cores.

For hiring teams

Save these questions for the Operating System candidates who can do the work

Cohesyve takes your Operating System job description, finds candidates, reaches out to them and runs an AI job simulation of the real work, then returns a ranked shortlist.

1,500+

assessments completed

50%

faster time-to-hire

5 min

from JD to assessment

No credit card · 10 free candidates · Plans sized to your hiring volume

For job seekers

Preparing for an Operating System interview yourself? Practise on an AI job simulation of the role. 3 free tests, no card.

Practise an Operating System interview free →

See Cohesyve in action

Free 30-min walkthrough

See it on your role