# OS Interview Questions: 205 Questions Across 51 Topics

> OS interview questions grouped by topic: 205 questions from 51 operating system notes on scheduling, memory, deadlocks and synchronization.

Canonical: https://devsunite.com/resources/core-subjects/operating-systems
Last updated: 2026-11-22

How an OS manages processes, memory, scheduling, and synchronization, the concepts every backend and systems interview eventually touches.

51 topics across 6 categories, 205 interview questions

## Top 10 OS interview questions with answers

1. **What is an operating system, in one sentence?** Software that manages hardware resources and provides a consistent interface for applications to run on top of. [What Is an Operating System?](https://devsunite.com/resources/core-subjects/operating-systems/what-is-operating-systems)
2. **What's the key difference between a process and a thread?** Processes have fully isolated memory from each other; threads within the same process share that process's memory, only getting their own separate stack and register state. [Process vs Program vs Thread](https://devsunite.com/resources/core-subjects/operating-systems/process-vs-program-vs-threads)
3. **What is a context switch?** Saving the currently running process's complete execution state (into its PCB) and loading a different process's previously saved state, so the CPU can pause one process and resume another with no loss of correctness. [Context Switching](https://devsunite.com/resources/core-subjects/operating-systems/context-switching)
4. **What is a race condition, precisely?** A situation where a program's correctness depends on the unpredictable relative timing of multiple processes or threads, rather than being guaranteed deterministically by the program's logic. [Data Inconsistency and Race Conditions](https://devsunite.com/resources/core-subjects/operating-systems/data-inconsistency-and-race-condition)
5. **What is a semaphore, and what two operations does it support?** An integer variable manipulated only through atomic wait (decrement, block if negative) and signal (increment, wake a waiter) operations, used to control access to shared resources. [Semaphores](https://devsunite.com/resources/core-subjects/operating-systems/semaphores)
6. **What are the four necessary conditions for a deadlock?** Mutual exclusion, hold and wait, no preemption, circular wait, all four must hold simultaneously. [Deadlocks in Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/deadlocks-in-os)
7. **What problem does paging solve?** External fragmentation, by allowing a process's memory to be scattered across non-contiguous physical frames instead of requiring one contiguous block. [Paging in Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/paging-in-os)
8. **What is virtual memory?** A technique letting a process's address space, and the combined memory demand of all running processes, exceed the physical RAM actually installed, by keeping only actively-used pages in RAM. [Virtual Memory and Demand Paging](https://devsunite.com/resources/core-subjects/operating-systems/virtual-memory-and-demand-paging)
9. **What's the difference between internal and external fragmentation?** External fragmentation is free memory scattered into unusable gaps between allocated blocks (a variable-size allocation problem); internal fragmentation is wasted space inside an allocated block that's bigger than what's actually needed (a fixed-size allocation problem). [Fragmentation in Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/fragmentation-in-os)
10. **What's the core difference between preemptive and non-preemptive scheduling?** Preemptive scheduling can forcibly interrupt a running process before it finishes or voluntarily yields; non-preemptive scheduling cannot, a process always runs to completion or until it blocks on its own. [Preemptive vs Non-Preemptive Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/preemptive-vs-non-preemptive-scheduling)

## Process Scheduling

- [Process Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/process-scheduling) - Process scheduling is how an operating system decides which of several ready processes gets to run on the CPU next, and for how long.
- [Scheduling Queues](https://devsunite.com/resources/core-subjects/operating-systems/scheduling-queues) - Scheduling queues are the data structures an OS uses to track processes at each stage: waiting to run, waiting on a device, or waiting to be admitted at all.
- [Preemptive vs Non-Preemptive Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/preemptive-vs-non-preemptive-scheduling) - Preemptive scheduling can interrupt a running process before it's done, while non-preemptive scheduling always lets a process run to completion or until it voluntarily gives up the CPU.
- [Scheduler vs Dispatcher](https://devsunite.com/resources/core-subjects/operating-systems/scheduler-vs-dispatcher) - The scheduler decides which process should run next, while the dispatcher is the mechanism that actually performs the switch, loading that process's context onto the CPU.
- [Scheduling Criteria](https://devsunite.com/resources/core-subjects/operating-systems/scheduling-criterias) - Scheduling criteria are the measurable properties, like waiting time, turnaround time, and CPU utilization, used to judge how good a particular scheduling algorithm actually is.
- [FCFS (First Come First Served) Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/fcfs-scheduling) - FCFS runs processes in the exact order they arrive in the ready queue, with no regard for how long each one needs, which is simple but can leave short jobs waiting behind long ones.
- [Shortest Job First (SJF) Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/sjf-scheduling) - SJF picks whichever ready process needs the least CPU time next, which gives the lowest possible average waiting time but risks starving long processes.
- [SRTF (Shortest Remaining Time First) Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/srtf-scheduling) - SRTF is the preemptive version of SJF, always running whichever ready process currently has the least remaining burst time left, even if that means interrupting a process already running.
- [Priority Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/priority-scheduling) - Priority scheduling always runs whichever ready process has the highest priority, which can be combined with either preemptive or non-preemptive behavior, and risks starving low-priority processes without a fix like aging.
- [Round Robin Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/round-robin-scheduling) - Round Robin gives every ready process a fixed time slice in rotation, preempting whoever's running once their slice expires and moving to the next process in the queue, which guarantees fairness and good responsiveness.
- [Multilevel Queue Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/multilevel-queue-scheduling) - Multilevel queue scheduling splits the ready queue into several separate queues, usually by process type, each with its own scheduling algorithm and priority relative to the other queues.
- [Multilevel Feedback Queue Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/multilevel-feedback-queue-scheduling) - Multilevel feedback queue scheduling extends multilevel queues by letting a process actually move between queues based on its observed behavior, rewarding short, interactive processes and demoting long, CPU-heavy ones.
- [Starvation and Aging in Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/starvation-and-aging) - In the specific context of scheduling, starvation is a process endlessly losing out to newer or higher-priority arrivals, and aging fixes it by gradually raising a waiting process's priority the longer it waits.

## Introduction

- [What Is an Operating System?](https://devsunite.com/resources/core-subjects/operating-systems/what-is-operating-systems) - An operating system is the software layer that manages a computer's hardware and provides a consistent environment for every other program to run in, so applications never have to talk to hardware directly.
- [Types of Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/types-of-operating-systems) - Operating systems come in several distinct types, batch, time-sharing, distributed, real-time, and embedded, each built around a different priority: throughput, fairness, coordination, timing guarantees, or a fixed single-purpose job.
- [RAM vs ROM](https://devsunite.com/resources/core-subjects/operating-systems/ram-vs-rom) - RAM is fast, volatile memory that holds data only while powered and is used for actively running programs, while ROM is non-volatile memory that keeps its contents without power and is used to store instructions a device needs before anything else can load.
- [System Calls and APIs](https://devsunite.com/resources/core-subjects/operating-systems/system-calls-and-apis) - A system call is the formal, controlled way an application asks the OS kernel to do something a normal program isn't allowed to do directly, like reading a file or sending network data, and APIs are the higher-level, friendlier functions built on top of those calls.
- [Virtualization vs Containerization](https://devsunite.com/resources/core-subjects/operating-systems/virtualization-vs-containerization) - Virtualization runs multiple complete operating systems on shared hardware via a hypervisor, while containerization runs multiple isolated applications on a single shared OS kernel, which makes containers far lighter weight but slightly less isolated.
- [BIOS vs UEFI](https://devsunite.com/resources/core-subjects/operating-systems/bios-vs-uefi) - BIOS and UEFI are both firmware that runs before an operating system loads, but UEFI is the modern replacement, offering faster boot, support for larger disks, a graphical interface, and secure boot verification that BIOS never had.
- [Important Terms in Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/important-terms-in-os) - A handful of OS vocabulary terms, kernel, multitasking, multiprogramming, spooling, and interrupt, come up constantly across every other OS topic, so getting their exact meanings straight early on makes everything downstream easier to follow.
- [Monolithic Kernel vs Microkernel](https://devsunite.com/resources/core-subjects/operating-systems/monolithic-kernal-vs-microkernal) - A monolithic kernel runs almost all OS services, including drivers, in one privileged address space for speed, while a microkernel keeps the privileged core minimal and runs most services as separate isolated processes for stability and security.
- [The Complete Booting Process](https://devsunite.com/resources/core-subjects/operating-systems/complete-booting-process) - Booting a computer is a strict sequence: firmware initializes hardware and finds a boot device, a bootloader loads the OS kernel into memory, and the kernel initializes itself before finally starting user-space processes.

## Process Management

- [Processes in an Operating System](https://devsunite.com/resources/core-subjects/operating-systems/processes-in-os) - A process is a program in execution, an independent, isolated unit that the OS tracks and schedules, with its own memory space, distinct from the static program file it was started from.
- [Process vs Program vs Thread](https://devsunite.com/resources/core-subjects/operating-systems/process-vs-program-vs-threads) - A program is static code on disk, a process is that program running with its own isolated memory, and a thread is a lightweight unit of execution inside a process that shares that process's memory with any other threads in it.
- [Process Control Block (PCB)](https://devsunite.com/resources/core-subjects/operating-systems/process-control-block-pcb) - The Process Control Block is the data structure the OS kernel maintains for every process, holding everything needed to pause it and correctly resume it later: its state, register values, memory info, and open resources.
- [Context Switching](https://devsunite.com/resources/core-subjects/operating-systems/context-switching) - A context switch is the process of saving one process's complete execution state and loading a different process's saved state, letting the CPU pause one task and resume another with no loss of correctness, at the cost of real overhead.
- [CPU-Bound vs I/O-Bound Processes](https://devsunite.com/resources/core-subjects/operating-systems/cpu-bound-vs-io-bound-process) - A CPU-bound process spends most of its time doing actual computation and rarely waits on I/O, while an I/O-bound process spends most of its time waiting on slow operations like disk or network access, and this distinction directly shapes how a scheduler should treat each one.
- [IPC and Pipes](https://devsunite.com/resources/core-subjects/operating-systems/ipc-and-pipes) - Inter-Process Communication (IPC) is the set of OS-provided mechanisms that let isolated processes exchange data despite having separate memory, and a pipe is one of the simplest IPC mechanisms, a one-way byte stream connecting one process's output directly to another's input.
- [Zombie vs Orphan Process](https://devsunite.com/resources/core-subjects/operating-systems/zombie-vs-orphan-process) - A zombie process has finished running but still has an entry in the process table because its parent hasn't yet collected its exit status, while an orphan process is still running but its original parent has terminated, so the OS reassigns it a new parent.
- [Important Terms Related to Processes](https://devsunite.com/resources/core-subjects/operating-systems/important-terms-related-to-process) - A handful of process-related vocabulary terms, degree of multiprogramming, process hierarchy, turnaround time, and dispatch latency, recur across scheduling and process management topics, so having their precise meanings down makes those topics easier to follow.

## Process Synchronization

- [The Need for Process Synchronization](https://devsunite.com/resources/core-subjects/operating-systems/need-of-process-synchronization) - When multiple processes or threads access and modify shared data at the same time, the result can depend on unpredictable timing rather than program logic, and process synchronization exists specifically to prevent that.
- [Data Inconsistency and Race Conditions](https://devsunite.com/resources/core-subjects/operating-systems/data-inconsistency-and-race-condition) - A race condition occurs when the correctness of a program depends on the unpredictable relative timing of multiple processes or threads, and it's the specific mechanism that causes data inconsistency in unsynchronized concurrent code.
- [The Critical Section Problem](https://devsunite.com/resources/core-subjects/operating-systems/critical-section-problem) - The critical section problem is designing a protocol that lets multiple processes safely take turns accessing shared data, guaranteeing mutual exclusion, progress, and bounded waiting all at once.
- [Peterson's Solution](https://devsunite.com/resources/core-subjects/operating-systems/petersons-solution) - Peterson's Solution is a classic software-only algorithm for two processes that correctly solves the critical section problem using just two shared variables, with no special hardware instructions required.
- [Semaphores](https://devsunite.com/resources/core-subjects/operating-systems/semaphores) - A semaphore is an integer variable, accessed only through two atomic operations, wait and signal, used to control access to a shared resource among multiple processes or threads.
- [Busy Waiting and Spinlocks](https://devsunite.com/resources/core-subjects/operating-systems/busy-waiting-and-spinlocks) - Busy waiting means a process repeatedly checks a condition in a tight loop instead of yielding the CPU while it waits, and a spinlock is a lock built directly on that idea, efficient for very short waits but wasteful for long ones.

## Deadlocks

- [Deadlocks in Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/deadlocks-in-os) - A deadlock happens when a group of processes are each waiting for a resource that another process in the same group is holding, so none of them can ever proceed.
- [Deadlock Prevention](https://devsunite.com/resources/core-subjects/operating-systems/deadlock-prevention) - Deadlock prevention works by designing the system so that at least one of the four necessary deadlock conditions can never occur in the first place.
- [Deadlock Avoidance](https://devsunite.com/resources/core-subjects/operating-systems/deadlock-avoidance) - Deadlock avoidance lets processes request resources dynamically but only grants a request if the resulting system state is still guaranteed safe from ever reaching a deadlock.
- [Banker's Algorithm](https://devsunite.com/resources/core-subjects/operating-systems/bankers-algorithm) - The Banker's Algorithm decides whether to grant a resource request by simulating the grant and checking whether a safe completion order for every process still exists afterward.
- [Deadlock Detection](https://devsunite.com/resources/core-subjects/operating-systems/deadlock-detection) - Deadlock detection lets deadlocks happen and periodically checks the system's resource allocation graph for a cycle, then recovers by breaking that cycle.
- [Deadlock Ignorance (The Ostrich Algorithm)](https://devsunite.com/resources/core-subjects/operating-systems/deadlock-ignorance) - The ostrich algorithm deliberately ignores the possibility of deadlocks entirely, betting that the cost of handling them is higher than the cost of the rare deadlock actually happening.
- [Starvation in Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/starvation) - Starvation happens when a process is repeatedly denied a resource it needs, not because of a permanent standstill like a deadlock, but because other processes keep getting priority instead.

## Memory Management

- [Logical vs Physical Address Space](https://devsunite.com/resources/core-subjects/operating-systems/logical-vs-physical-address-space) - A logical address is what a running program sees and works with, while a physical address is the actual location in RAM. The memory management unit translates one into the other.
- [Swapping and Contiguous Memory Allocation](https://devsunite.com/resources/core-subjects/operating-systems/swapping-and-contiguous-memory-allocation) - Swapping temporarily moves an entire process out of RAM to disk to free up space, while contiguous allocation gives each process a single unbroken block of physical memory.
- [Fragmentation in Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/fragmentation-in-os) - Fragmentation is wasted memory that exists in unusable gaps, either external gaps between allocated blocks or internal wasted space inside a block that's bigger than what it holds.
- [Paging in Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/paging-in-os) - Paging divides both logical and physical memory into fixed-size blocks, called pages and frames, so a process's memory no longer needs to sit in one contiguous chunk of RAM.
- [Segmentation in Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/segmentation-in-os) - Segmentation divides a process's memory into logically meaningful, variable-sized units, like code, stack, and data, instead of the fixed-size, meaning-agnostic chunks paging uses.
- [Virtual Memory and Demand Paging](https://devsunite.com/resources/core-subjects/operating-systems/virtual-memory-and-demand-paging) - Virtual memory lets a process behave as if it has more memory than physically exists, by keeping only the pages actually being used in RAM and pulling the rest in from disk on demand.
- [Page Fault Handling](https://devsunite.com/resources/core-subjects/operating-systems/page-fault-handling) - A page fault happens when a program accesses a page that isn't currently loaded in physical memory, and the OS has to pause the program, load the missing page from disk, and resume it.
- [Page Replacement Algorithms](https://devsunite.com/resources/core-subjects/operating-systems/page-replacement-algorithms) - When physical memory is full and a new page needs to be loaded, a page replacement algorithm decides which existing page gets evicted to make room.

## All 205 OS interview questions

### Process Scheduling

- [Process Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/process-scheduling)

1. What is the difference between the long-term and short-term scheduler?
2. What are the typical goals a scheduler tries to balance?
3. Name a real scheduler used in a production operating system.
4. Why can't a scheduler optimize for every goal simultaneously?

- [Scheduling Queues](https://devsunite.com/resources/core-subjects/operating-systems/scheduling-queues)

1. What's the difference between the job queue and the ready queue?
2. What is a device queue?
3. Describe the typical queue journey of a process that performs I/O.
4. How does this relate to real process states you'd see in a tool like `top`?

- [Preemptive vs Non-Preemptive Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/preemptive-vs-non-preemptive-scheduling)

1. What's the core difference between preemptive and non-preemptive scheduling?
2. Give an example of each.
3. What real cost does preemption introduce?
4. Why do virtually all modern general-purpose operating systems use preemptive scheduling?

- [Scheduler vs Dispatcher](https://devsunite.com/resources/core-subjects/operating-systems/scheduler-vs-dispatcher)

1. What is the difference between the scheduler and the dispatcher?
2. What is dispatch latency?
3. Why does time slice length matter for a preemptive scheduler like Round Robin?
4. Is the dispatcher part of the scheduling policy, or separate from it?

- [Scheduling Criteria](https://devsunite.com/resources/core-subjects/operating-systems/scheduling-criterias)

1. Name the standard scheduling criteria.
2. What's the difference between turnaround time and waiting time?
3. What's the difference between turnaround time and response time?
4. Why can't a scheduler optimize all these criteria simultaneously?

- [FCFS (First Come First Served) Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/fcfs-scheduling)

1. What is FCFS scheduling?
2. What is the convoy effect, and how does FCFS cause it?
3. Is FCFS preemptive or non-preemptive?
4. What's the main practical weakness of FCFS compared to something like SJF?

- [Shortest Job First (SJF) Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/sjf-scheduling)

1. Is SJF preemptive or non-preemptive?
2. Why is SJF called optimal, and optimal for what exactly?
3. What's the biggest problem with SJF in practice?
4. How would you fix starvation in SJF?
5. Walk me through a Gantt chart for these four processes.

- [SRTF (Shortest Remaining Time First) Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/srtf-scheduling)

1. What's the difference between SJF and SRTF?
2. Why is SRTF considered even more optimal than non-preemptive SJF for average waiting time?
3. What real-world limitation does SRTF share with SJF?
4. Trace through what happens if a shorter process arrives while another is running.

- [Priority Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/priority-scheduling)

1. What is priority scheduling?
2. What's the major risk of pure priority scheduling?
3. How do you fix starvation in priority scheduling?
4. How does Linux's real scheduler relate to this?

- [Round Robin Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/round-robin-scheduling)

1. What is Round Robin scheduling?
2. What happens if the time quantum is too large or too small?
3. Is Round Robin preemptive or non-preemptive?
4. Why is Round Robin considered good for interactive systems specifically?

- [Multilevel Queue Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/multilevel-queue-scheduling)

1. What is multilevel queue scheduling?
2. What's a real risk of multilevel queue scheduling with strict inter-queue priority?
3. How is this different from multilevel feedback queue scheduling?
4. Give a real-world example of this idea.

- [Multilevel Feedback Queue Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/multilevel-feedback-queue-scheduling)

1. How does multilevel feedback queue scheduling differ from plain multilevel queue scheduling?
2. What causes a process to be demoted to a lower-priority queue?
3. What's the key advantage of this approach over SJF or priority scheduling?
4. Can a process move back up to a higher-priority queue?

- [Starvation and Aging in Scheduling](https://devsunite.com/resources/core-subjects/operating-systems/starvation-and-aging)

1. How can starvation occur in SJF, specifically?
2. What is aging, precisely?
3. Does aging change a process's real, declared priority, or just how it's treated by the scheduler?
4. Is starvation the same problem in every scheduling algorithm?

### Introduction

- [What Is an Operating System?](https://devsunite.com/resources/core-subjects/operating-systems/what-is-operating-systems)

1. What is an operating system, in one sentence?
2. Name the core responsibilities of an OS.
3. Why can't applications just talk to hardware directly?
4. What's the difference between an OS and a kernel?

- [Types of Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/types-of-operating-systems)

1. What's the difference between a batch and a time-sharing OS?
2. What is a real-time operating system, and what's the difference between hard and soft real-time?
3. Give an example of where a real-time OS matters and why a normal OS wouldn't work there.
4. What is a distributed operating system?

- [RAM vs ROM](https://devsunite.com/resources/core-subjects/operating-systems/ram-vs-rom)

1. What's the fundamental difference between RAM and ROM?
2. Why can't a computer boot directly from RAM?
3. Is ROM really unwritable?
4. Why does RAM need to be fast if ROM doesn't?

- [System Calls and APIs](https://devsunite.com/resources/core-subjects/operating-systems/system-calls-and-apis)

1. What is a system call?
2. What's the difference between user mode and kernel mode?
3. What's the difference between a system call and an API?
4. Why are system calls relatively expensive?

- [Virtualization vs Containerization](https://devsunite.com/resources/core-subjects/operating-systems/virtualization-vs-containerization)

1. What's the core difference between a VM and a container?
2. Why do containers start faster than VMs?
3. Which is more isolated, a VM or a container, and why?
4. Why would a company use both together?

- [BIOS vs UEFI](https://devsunite.com/resources/core-subjects/operating-systems/bios-vs-uefi)

1. What's the core difference between BIOS and UEFI?
2. What is Secure Boot and why does it matter?
3. Why can't BIOS boot from disks larger than 2TB as a single partition?
4. Why does Windows 11 require UEFI?

- [Important Terms in Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/important-terms-in-os)

1. What's the difference between multiprogramming and multitasking?
2. What is a kernel, and how is it different from 'the operating system'?
3. What is spooling, and why does it help?
4. What is an interrupt, and why not just poll devices in a loop instead?

- [Monolithic Kernel vs Microkernel](https://devsunite.com/resources/core-subjects/operating-systems/monolithic-kernal-vs-microkernal)

1. What's the core architectural difference?
2. Why are monolithic kernels generally faster?
3. Why are microkernels considered more stable/fault-tolerant?
4. Is Linux monolithic or a microkernel?

- [The Complete Booting Process](https://devsunite.com/resources/core-subjects/operating-systems/complete-booting-process)

1. Walk me through what happens between pressing the power button and reaching a login screen.
2. What's the difference between the bootloader's job and the kernel's job?
3. What is PID 1, and why does it matter?
4. If a machine shows beep codes and never displays anything, what stage failed?

### Process Management

- [Processes in an Operating System](https://devsunite.com/resources/core-subjects/operating-systems/processes-in-os)

1. What's the difference between a program and a process?
2. What are the main states a process moves through?
3. Why do two instances of the same program get separate processes instead of sharing one?
4. What memory regions make up a process?

- [Process vs Program vs Thread](https://devsunite.com/resources/core-subjects/operating-systems/process-vs-program-vs-threads)

1. What's the key difference between a process and a thread?
2. Why are threads considered 'lighter weight' than processes?
3. What's the downside of threads sharing memory?
4. Can two threads in the same process run on different CPU cores at the same time?

- [Process Control Block (PCB)](https://devsunite.com/resources/core-subjects/operating-systems/process-control-block-pcb)

1. What is a Process Control Block?
2. Why is the PCB essential for context switching?
3. What information does a PCB typically hold?
4. What is Linux's real equivalent of a PCB called?

- [Context Switching](https://devsunite.com/resources/core-subjects/operating-systems/context-switching)

1. What is a context switch?
2. Why does context switching have overhead if it's 'just bookkeeping'?
3. What triggers a context switch?
4. Why is switching between threads generally cheaper than switching between processes?

- [CPU-Bound vs I/O-Bound Processes](https://devsunite.com/resources/core-subjects/operating-systems/cpu-bound-vs-io-bound-process)

1. What's the difference between a CPU-bound and an I/O-bound process?
2. Why should a scheduler treat these two types differently?
3. Give a real-world example of each.
4. How does a scheduler like Linux's CFS account for this distinction?

- [IPC and Pipes](https://devsunite.com/resources/core-subjects/operating-systems/ipc-and-pipes)

1. What is IPC, and why is it needed?
2. What is a pipe, specifically?
3. What's the difference between a pipe and a named pipe (FIFO)?
4. Why is shared memory the fastest IPC mechanism, and what's the tradeoff?

- [Zombie vs Orphan Process](https://devsunite.com/resources/core-subjects/operating-systems/zombie-vs-orphan-process)

1. What is a zombie process?
2. Is a zombie process still using CPU or memory?
3. What is an orphan process, and what happens to it?
4. How would too many zombie processes actually cause a problem?

- [Important Terms Related to Processes](https://devsunite.com/resources/core-subjects/operating-systems/important-terms-related-to-process)

1. What is turnaround time, and how is it different from waiting time?
2. What is the degree of multiprogramming?
3. What is dispatch latency, and why does it matter for real-time systems?
4. How does process hierarchy relate to zombie and orphan processes?

### Process Synchronization

- [The Need for Process Synchronization](https://devsunite.com/resources/core-subjects/operating-systems/need-of-process-synchronization)

1. Why is `counter++` not safe to run from multiple threads without synchronization?
2. What is process synchronization trying to prevent?
3. Give a real-world example of why this matters.
4. Where in real systems is this problem actually solved in practice?

- [Data Inconsistency and Race Conditions](https://devsunite.com/resources/core-subjects/operating-systems/data-inconsistency-and-race-condition)

1. What is a race condition, precisely?
2. Why is `counter++` unsafe across threads without synchronization, exactly?
3. Why are race conditions hard to debug?
4. How do you actually prevent a race condition?

- [The Critical Section Problem](https://devsunite.com/resources/core-subjects/operating-systems/critical-section-problem)

1. What are the three requirements a correct critical section solution must satisfy?
2. What is a critical section?
3. Why isn't mutual exclusion alone considered a correct solution?
4. What's the practical, real-world equivalent of the critical section problem in a database?

- [Peterson's Solution](https://devsunite.com/resources/core-subjects/operating-systems/petersons-solution)

1. What two variables does Peterson's Solution use, and what does each mean?
2. Walk through why Peterson's Solution guarantees mutual exclusion.
3. Why isn't Peterson's Solution used in real production systems today?
4. What is Peterson's Solution's real educational value, then?

- [Semaphores](https://devsunite.com/resources/core-subjects/operating-systems/semaphores)

1. What is a semaphore, and what two operations does it support?
2. What's the difference between a binary and a counting semaphore?
3. Why must `wait` and `signal` be atomic?
4. Give a real, practical use of a counting semaphore.

- [Busy Waiting and Spinlocks](https://devsunite.com/resources/core-subjects/operating-systems/busy-waiting-and-spinlocks)

1. What is busy waiting?
2. What is a spinlock, and how does it relate to busy waiting?
3. When is a spinlock actually a good choice, and when is it a bad one?
4. Why would a spinlock never make sense on a single-core system?

### Deadlocks

- [Deadlocks in Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/deadlocks-in-os)

1. What are the four necessary conditions for a deadlock?
2. If I remove one of the four conditions, is a deadlock still possible?
3. How is a deadlock different from starvation?
4. How would you detect a deadlock has occurred?

- [Deadlock Prevention](https://devsunite.com/resources/core-subjects/operating-systems/deadlock-prevention)

1. How do you prevent hold and wait?
2. How do you prevent circular wait?
3. What's the tradeoff of deadlock prevention compared to just letting deadlocks happen and detecting them?
4. Why is mutual exclusion usually left alone in prevention strategies?

- [Deadlock Avoidance](https://devsunite.com/resources/core-subjects/operating-systems/deadlock-avoidance)

1. What's the difference between deadlock avoidance and deadlock prevention?
2. What is a safe state?
3. What information does deadlock avoidance require that prevention doesn't?
4. Is an unsafe state the same as a deadlock?

- [Banker's Algorithm](https://devsunite.com/resources/core-subjects/operating-systems/bankers-algorithm)

1. Walk me through how the Banker's Algorithm decides to grant or deny a request.
2. What must a process declare before the algorithm can be used?
3. Why is a request sometimes denied even though the resources are physically available?
4. What's the time complexity concern with running the Banker's Algorithm frequently?

- [Deadlock Detection](https://devsunite.com/resources/core-subjects/operating-systems/deadlock-detection)

1. How do you detect a deadlock?
2. What are the two recovery strategies once a deadlock is detected?
3. Why can't you just always terminate every process in the cycle?
4. How does this relate to what real databases do?

- [Deadlock Ignorance (The Ostrich Algorithm)](https://devsunite.com/resources/core-subjects/operating-systems/deadlock-ignorance)

1. What is the ostrich algorithm?
2. Why do general-purpose OSes like Linux use this approach?
3. When would the ostrich algorithm be a bad choice?
4. Is this the same as not caring about deadlocks at all?

- [Starvation in Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/starvation)

1. What's the difference between starvation and deadlock?
2. How do you fix starvation?
3. Can a system have starvation without ever having a deadlock?
4. Give a real-world example of a starvation risk.

### Memory Management

- [Logical vs Physical Address Space](https://devsunite.com/resources/core-subjects/operating-systems/logical-vs-physical-address-space)

1. What is the difference between a logical and a physical address?
2. What component performs the translation?
3. Why do processes use logical addresses instead of physical addresses directly?
4. What happens if a process tries to access a logical address outside its allowed range?

- [Swapping and Contiguous Memory Allocation](https://devsunite.com/resources/core-subjects/operating-systems/swapping-and-contiguous-memory-allocation)

1. What is contiguous memory allocation?
2. What problem does contiguous allocation create over time?
3. What is swapping?
4. How does modern virtual memory relate to swapping?

- [Fragmentation in Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/fragmentation-in-os)

1. What's the difference between internal and external fragmentation?
2. Which allocation scheme causes which kind of fragmentation?
3. How do you fix external fragmentation?
4. Why do most modern operating systems accept internal fragmentation instead of external fragmentation?

- [Paging in Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/paging-in-os)

1. What problem does paging solve?
2. Walk me through translating a logical address to a physical address under paging.
3. What does a page table actually store?
4. What is a TLB and why does it matter for paging performance?

- [Segmentation in Operating Systems](https://devsunite.com/resources/core-subjects/operating-systems/segmentation-in-os)

1. What's the difference between paging and segmentation?
2. What does a segment table entry store?
3. What happens if an offset exceeds a segment's limit?
4. Why might segmentation be more natural for a compiler to reason about than paging?

- [Virtual Memory and Demand Paging](https://devsunite.com/resources/core-subjects/operating-systems/virtual-memory-and-demand-paging)

1. What is virtual memory?
2. What is demand paging specifically?
3. Why does demand paging work well given how real programs behave?
4. What happens when a process accesses a page that isn't currently in RAM?

- [Page Fault Handling](https://devsunite.com/resources/core-subjects/operating-systems/page-fault-handling)

1. What is a page fault?
2. Walk me through the full sequence of steps when a page fault occurs.
3. What's the difference between a legitimate page fault and an illegal memory access?
4. What is thrashing and how does it relate to page faults?

- [Page Replacement Algorithms](https://devsunite.com/resources/core-subjects/operating-systems/page-replacement-algorithms)

1. Compare FIFO and LRU.
2. What is the Optimal algorithm, and why can't it actually be implemented?
3. Why doesn't Linux implement exact LRU?
4. What is Belady's Anomaly?

## Frequently asked questions

### Where do these os interview questions come from?

Each of the 205 questions comes from the "What interviewers actually ask" section of one of 51 Operating Systems topic notes. Every question links to its topic page, where it is answered next to the explanation it tests.

### What does the Operating Systems section cover?

51 topics across 6 categories: How an OS manages processes, memory, scheduling, and synchronization, the concepts every backend and systems interview eventually touches.

### Is it free to read?

Yes. Every article is free to read with no account required. Creating a free DevsUnite account lets you mark topics as read and track your progress across every Core Subjects article.

## Related

- [DBMS](https://devsunite.com/resources/core-subjects/dbms)
- [Computer Networks](https://devsunite.com/resources/core-subjects/computer-networks)
- [OOP](https://devsunite.com/resources/core-subjects/oop)
- [Core Subjects](https://devsunite.com/resources/core-subjects)
