Operating Systems Interview Questions
150 curated questions graded from Foundations (Easy) to Practical Patterns (Medium) and Internals & Architecture (Hard).
150
150
0
5 / Level
Foundations & Core Concepts
Q1What is an Operating System (OS)? What are its primary goals and functions?
An OS is system software that acts as an intermediary between computer hardware and the user/applications.
- Primary Goals: Convenience for users, efficiency of hardware utilization, and execution of user programs.
- Core Functions: Process management, memory management, storage/file system management, device (I/O) management, security, and error handling.
Q2What is the difference between Kernel Mode and User Mode?
To protect hardware integrity, the CPU executes instructions in two distinct privilege levels:
- User Mode (Non-privileged): Executing user application code. Access to physical hardware, raw memory, and privileged instructions is blocked. Attempting access triggers a trap/exception.
- Kernel Mode (Privileged/Supervisor): Executing core OS kernel code. The CPU has complete, unrestricted access to all hardware, physical registers, and memory addresses.
Q3What is a System Call? How does it work?
A system call is a programmatic interface that allows a user-mode application to safely request privileged services from the OS kernel.
- Mechanism:
- The user program loads arguments into designated registers.
- The program executes a special instruction (e.g.,
syscallorint 0x80), triggering a software interrupt. - The CPU switches from User Mode to Kernel Mode and jumps to the Interrupt Vector Table (IVT).
- The kernel executes the request, switches back to User Mode, and returns control.
Q4What is a Process and what are its different states (Process Lifecycle)?
A process is a program in execution. Its lifecycle is managed through several state transitions:
- New: The process is being created.
- Ready: The process is loaded into main memory and waiting to be assigned to a CPU.
- Running: Instructions are being executed on the CPU.
- Waiting (Blocked): The process is blocked waiting for an event or I/O completion.
- Terminated: The process has finished execution.
Q5What is a Process Control Block (PCB)? What information does it contain?
A PCB is a data structure in kernel memory that stores all essential state metadata for a specific process, enabling multitasking:
- Process State: Ready, running, waiting, etc.
- Program Counter (PC): Address of the next instruction to execute.
- CPU Registers: Saved register states (accumulators, index registers, stack pointers).
- CPU Scheduling Info: Priority, scheduling queue pointers.
- Memory Management Info: Page tables, segment tables.
- I/O Status Info: List of open files, allocated I/O devices.
Unlock the complete Operating Systems Easy question bank
Get instant access to all 50 questions, in-depth model answers, code sandboxes, and all 27+ technologies for a single one-time payment.
Browse All Operating Systems Questions by Difficulty
Core concepts, definitions, basic syntax, and first principles expected in round 1 screening.
Real-world mechanisms, state management, edge cases, performance trade-offs, and practical coding.
Deep runtime internals, memory models, distributed design, concurrency failure modes, and architectural decisions.