46 Linux & OS interview questions with answers
46 Linux & OS interview questions with detailed answers, sorted from basic to advanced. Free to practice, with progress saved automatically.
All Linux & OS interview questions
How do processes and threads differ? When should you use multi-process vs multi-thread?
What is context switching? How does its cost impact performance?
What are the common process scheduling algorithms? (FCFS, Round Robin, SJF)
What is Inter-Process Communication (IPC)? What are the common IPC mechanisms?
What is a deadlock? What are the 4 necessary conditions and how do you prevent it?
How do Mutex and Semaphore differ? When should you use each?
How do Concurrency and Parallelism differ?
What is a thread pool? Why is it needed and how do you size it correctly?
What is virtual memory? Why is it needed?
How do Paging and Segmentation differ? Which mechanism does x86-64 use?
What is a memory leak? How do you detect and prevent it in Node.js/Go?
How does Garbage Collection work? Compare GC in JVM, Go, and V8.
How does a file system work? Compare ext4, NTFS, and APFS.
What are the I/O models? Compare blocking, non-blocking, I/O multiplexing, and async I/O.
What are Linux signals? What are the important signals and how do you implement graceful shutdown?
How do containers differ from VMs? How do containers work at the OS level?
What are cgroups and namespaces? How does Kubernetes use them to manage pods?
What is a race condition? How do you detect and prevent it in real-world code?
What is the Monitor pattern? How do you implement the producer-consumer problem?
The Readers-Writers problem: how do you solve it with a read/write lock and what are the trade-offs?
select, poll, epoll, kqueue — the evolution of I/O multiplexing in Linux/macOS?
How does the Multilevel Feedback Queue (MLFQ) scheduler work? What is Linux CFS?
What are file descriptors, pipes, and the /proc filesystem in Linux?
Linux process states: what do R, S, D, Z, T mean? When is a process in state D?
How does Copy-on-Write (CoW) work on fork()? Why is it important for Redis?
The Linux OOM Killer: how does it work and how do you protect important processes?
Inodes, hard links, and symbolic links: differences and practical applications?
What is Linux page cache? Why is disk I/O often faster than people think?
How do the FIFO, LRU, and Optimal page-replacement algorithms differ? What is Belady’s Anomaly?
What is thrashing? When does it happen and how is it handled?
What is demand paging? What happens on a page fault?
What states make up the five-state process model?
How do zombie and orphan processes differ?
How does the Banker’s algorithm work? What is a safe state?
How does an OS detect and recover from deadlock?
How do internal and external fragmentation differ?
How do logical (virtual) and physical addresses differ? How does the MMU translate them?
What information does a Process Control Block (PCB) hold?
What is starvation in CPU scheduling? How does aging solve it?
How do preemptive and non-preemptive scheduling differ?
What is the critical-section problem? Its three requirements and Peterson’s solution?
How do user-level and kernel-level threads differ? What are the mapping models?
How do a monolithic kernel and a microkernel differ?
What are kernel mode and user mode? How does a system call work?
What is swapping? What is swap space for?
What is RAID? How do levels 0, 1, 5, 6, and 10 differ?