Last Minute Notes

Operating Systems

A beginner to advanced operating systems library: kernel and system calls, processes and threads, CPU scheduling with worked examples, synchronization and deadlocks, virtual memory and page replacement, file systems and durability, epoll and io_uring, containers from namespaces and cgroups, and an interview playbook.

Start here for OS prep, from "what is a process" to "why is my container throttled when the host is idle". Each topic covers the classic theory that campus interviews and written tests ask about, then connects it to what you see on a real Linux machine. All numerical examples (scheduling, page replacement, Banker's algorithm, disk scheduling) were computed with a script, and recent kernel changes (EEVDF scheduler, sched_ext, MGLRU, io_uring, cgroups v2) are included where they matter.

  1. 01
    OS Fundamentals

    Beginner operating system concepts: what an OS does, kernel vs user space, CPU privilege modes, system calls, interrupts and exceptions, kernel architectures (monolithic, microkernel, hybrid), the boot process, virtualization and containers at a glance, and the Linux, Windows, and macOS landscape.

  2. 02
    Processes and Threads

    Processes and threads in depth: process memory layout, the PCB, process states, context switching, fork and exec, zombies and orphans, threads vs processes, user vs kernel threads and threading models, green threads and virtual threads, and inter-process communication (pipes, shared memory, message queues, sockets, signals).

  3. 03
    CPU Scheduling

    CPU scheduling from textbook to Linux: scheduling criteria, preemptive vs non-preemptive, FCFS, SJF, SRTF, priority, round robin, multilevel queues and MLFQ with fully worked Gantt charts, starvation and aging, multiprocessor scheduling and affinity, and how Linux CFS and EEVDF, nice values, and cgroup CPU limits work.

  4. 04
    Synchronization and Deadlocks

    Concurrency control in operating systems: race conditions and critical sections, Peterson's algorithm, hardware atomics (test-and-set, CAS), spinlocks vs mutexes, futexes, semaphores, monitors and condition variables, read-write locks, classic problems (producer-consumer, readers-writers, dining philosophers), memory ordering, and deadlock conditions, prevention, avoidance with the Banker's algorithm, detection, and livelock.

  5. 05
    Memory Management

    Operating system memory management: why virtual memory, address translation, contiguous allocation and fragmentation, segmentation, paging with worked examples, page tables and multi-level paging, the TLB and effective access time, demand paging and page faults, page replacement (FIFO, LRU, Optimal, Clock) with worked counts and Belady's anomaly, thrashing and working sets, huge pages, swap, the OOM killer, and heap allocation.

  6. 06
    File Systems and Storage

    File systems and storage for engineers: files and directories, file descriptors and the open file table, inodes, hard vs soft links, allocation methods, free space, journaling and copy-on-write file systems, the VFS and common file systems (ext4, XFS, Btrfs, ZFS, APFS, NTFS), the page cache and fsync durability, HDD vs SSD, disk scheduling, and RAID.

  7. 07
    I/O and Linux Internals

    How servers really do I/O and how containers really work: blocking vs non-blocking vs async I/O, select, poll, epoll and kqueue, the C10K problem and event loops, io_uring, zero-copy (sendfile, splice), namespaces, cgroups v2, capabilities and seccomp, how a container is built from these, eBPF, and the Linux commands and /proc files every engineer should know.

  8. 08
    OS Interview Playbook

    Operating systems interview rehearsal: a 50-question bank with strong-answer checklists, numerical problem types (scheduling, paging, page replacement, Banker's, disk scheduling) with solving recipes, production scenarios, cheat sheets, common mistakes, and a 7-day study plan.

Reading Path

Pick Your Level

You areRead in this order
New to operating systemsFundamentals, Processes and Threads, CPU Scheduling
Preparing for campus or a written testAdd Synchronization, Memory, and the numerical recipes in the Playbook
Preparing for senior backend or infraAdd File Systems, I/O and Linux Internals
One week leftThe Interview Playbook study plan

On this page