{}DSA Atlas

Operating Systems

Processes, threads, CPU scheduling, synchronization (mutexes, semaphores, monitors), deadlocks, memory management, paging, virtual memory, page replacement, file systems and I/O — with worked examples and C/Python code.

10 chapters77 interview questionsPractice this track’s questions →

The operating system is the layer every backend engineer leans on without thinking: it decides which thread runs, gives each process the illusion of its own memory, and turns disk blocks into files and network packets into sockets. Interviewers use OS questions to check that you understand what your code actually costs — a context switch, a page fault, a lock contention, a blocking syscall.

How this track is organised

  1. Foundations — kernel vs user mode, system calls, interrupts, kernel architectures.
  2. Processes — lifecycle, PCB, fork/exec, context switches, IPC.
  3. Threads — threading models, user vs kernel threads, async I/O and event loops.
  4. CPU scheduling — every classic algorithm with worked Gantt charts, plus Linux CFS/EEVDF.
  5. Synchronization — race conditions, mutexes, spinlocks, semaphores, monitors, atomics, memory ordering.
  6. Classic concurrency problems — producer–consumer, readers–writers, dining philosophers, with code.
  7. Deadlocks — the four conditions, prevention, avoidance (Banker's algorithm worked), detection, livelock, priority inversion.
  8. Memory management — address translation, paging, page tables, TLB, segmentation.
  9. Virtual memory — demand paging, page replacement (FIFO, OPT, LRU, Clock) worked, thrashing, copy-on-write, mmap.
  10. Storage, file systems & I/O — disk scheduling, inodes, journaling, RAID, I/O models (select/epoll/io_uring).

Chapters

In recommended order
What an operating system does, user mode vs kernel mode, system calls, interrupts and traps, the boot process and kernel architectures (monolithic, microkernel, hybrid).
6 Q
What a process is, its memory layout, the process control block, the five-state lifecycle, fork/exec/wait, zombies and orphans, context switching, and every inter-process communication mechanism.
8 Q
Threads vs processes, what threads share, user vs kernel threads and threading models, thread pools, the GIL, green threads, coroutines and event loops, and concurrency vs parallelism.
8 Q
Scheduling criteria and metrics, FCFS, SJF, SRTF, priority, round robin, multilevel (feedback) queues, Linux CFS/EEVDF, multiprocessor and real-time scheduling — with fully worked Gantt charts.
9 Q
Race conditions and critical sections, Peterson's algorithm, hardware atomics (test-and-set, CAS), spinlocks vs mutexes, semaphores, condition variables, monitors, read-write locks, futexes, memory ordering and lock-free basics.
10 Q
Producer–consumer (bounded buffer), readers–writers, dining philosophers, sleeping barber, H2O and print-in-order — the problems interviewers use to test synchronization, with working solutions.
6 Q
The four Coffman conditions, resource-allocation graphs, prevention, avoidance with the Banker's algorithm (fully worked), detection and recovery, plus livelock, starvation, priority inversion and database deadlocks.
7 Q
Logical vs physical addresses, the MMU, contiguous allocation and fragmentation, paging with worked address translation, page-table structures (multi-level, hashed, inverted), the TLB and effective access time, segmentation, and kernel allocators.
8 Q
Demand paging, what happens on a page fault, effective access time with faults, page replacement (FIFO, Optimal, LRU, Clock, LFU) worked step by step, Belady's anomaly, frame allocation, thrashing and the working set, copy-on-write, mmap and swap.
7 Q
Disk and SSD characteristics, disk scheduling (FCFS, SSTF, SCAN, C-SCAN, LOOK) worked, file system internals (inodes, directories, links, journaling), RAID levels, the I/O stack, and I/O models — blocking, non-blocking, select/poll/epoll, io_uring, zero-copy.
8 Q