Operating Systems Interview Questions
Processes and threads, CPU scheduling, synchronization, deadlocks, paging, virtual memory, and page replacement.
30 questions in this section
- What is an Operating System and what are its main functions? (Beginner)
- Explain kernel mode vs user mode and how system calls work (Beginner)
- Monolithic kernel vs microkernel: differences and trade-offs (Intermediate)
- Program vs process: what is the difference? (Beginner)
- Process states, state transitions and the Process Control Block (Beginner)
- Process vs thread: key differences (Beginner)
- User-level threads vs kernel-level threads and threading models (Advanced)
- What is a context switch and why is it expensive? (Intermediate)
- fork() and exec(): predict the output (Intermediate)
- Zombie and orphan processes (Intermediate)
- Inter-process communication: pipes, shared memory and message queues (Intermediate)
- CPU scheduling algorithms: FCFS, SJF, SRTF, Round Robin, Priority (Beginner)
- Worked example: Gantt charts and average waiting time for FCFS, SJF, SRTF and RR (Intermediate)
- Starvation, priority inversion and aging in scheduling (Beginner)
- Race conditions and the critical section problem (Beginner)
- Mutex vs semaphore (binary and counting) (Intermediate)
- The producer-consumer (bounded buffer) problem (Intermediate)
- Readers-writers and dining philosophers problems (Advanced)
- Spinlocks, test-and-set and when to spin versus sleep (Advanced)
- Deadlock: four necessary conditions and prevention strategies (Intermediate)
- Banker's algorithm: safe state and worked example (Advanced)
- Deadlock detection and recovery (Advanced)
- Paging, page tables and the TLB (Intermediate)
- Segmentation vs paging and segmented paging (Intermediate)
- Internal vs external fragmentation and how to reduce them (Beginner)
- Virtual memory, demand paging and page faults (Intermediate)
- Page replacement: FIFO, LRU and Optimal with a worked example (Advanced)
- Thrashing and Belady's anomaly (Advanced)
- File systems, inodes and directory structure (Intermediate)
- Disk scheduling: FCFS, SSTF, SCAN and C-SCAN (Beginner)