

CS fundamentals
Operating Systems Essentials
Processes, threads, scheduling, memory, files and deadlocks explained for interviews and real systems.
- Handwritten-style
- Diagrams and tables
- Worked examples
Who this notebook is for
Students and freshers preparing for campus and off-campus rounds, and engineers who want the operating system basics behind real systems. No prior knowledge is assumed.
What you will be able to do
- Explain how a process differs from a thread and what a context switch costs
- Work out CPU scheduling and page replacement answers by hand
- Spot the four conditions of a deadlock and say how to break each one
- Describe how virtual memory, paging and file systems work in simple words
What's inside
Pick a chapter and the notebook opens right there.
- Architecture, Dual-Mode & SyscallsKernel vs user mode (Ring 0 vs 3), hardware traps & interrupts, interrupt vector table, fast syscall assembly, monolithic vs microkernel architecturesStart here
- Process Lifecycle, PCB & Context Switch5-state process lifecycle, PCB task_struct anatomy, register saving, fork() Copy-on-Write, execve() memory overlay, TLB flush context switch costsStart here
- Threads & Concurrency ModelsProcess vs thread memory layouts, user-level vs kernel- level threads, M:1, 1:1, M:N threading, POSIX pthreads lifecycle, thread pool architecturesStart here
- CPU Scheduling AlgorithmsPreemptive vs non-preemptive scheduling, FCFS convoy effect, SJF & SRTF proof of optimality, Round Robin quantum tuning, MLFQ & Linux CFS virtual runtimeStart here
- Synchronization, Mutexes & SemaphoresRace conditions, critical section problem, Peterson's algorithm, atomic Test-and-Set & CAS, counting vs binary semaphores, futex kernel mechanicsStart here
- Deadlocks & Banker's Algorithm4 Coffman conditions, Resource Allocation Graphs (RAG), Banker's algorithm safety verification, deadlock prevention, detection & recoveryStart here
- Memory Management & PagingContiguous allocation vs fragmentation, Paging hardware, MMU translation, Two-level page tables, TLB hit/miss latency math, Inverted page tablesStart here
- Virtual Memory & Page ReplacementDemand paging, Page fault hardware exception sequence, FIFO replacement & Belady's Anomaly, Optimal replacement, Clock algorithmStart here
- Thrashing & Working Set DynamicsThrashing root causes, Effective Memory Access Time (EMAT) degradation, Working Set Model, Page Fault Frequency (PFF) control, Swap managementStart here
- Secondary Storage & Disk SchedulingMagnetic HDD mechanics, NVMe SSD flash wear leveling, FCFS, SSTF, SCAN (Elevator), C-SCAN, and Linux blk-mq multi-queue I/O schedulersStart here
- File Systems & Inode ArchitectureVFS abstraction layer, Unix Inode anatomy, direct/indirect block pointers, directory hash trees, Ext4 journaling vs XFS allocationsStart here
- I/O Subsystems & Event-Driven ArchitectureProgrammed I/O vs DMA controllers, select() vs poll() vs epoll() O(1) event loops, Level vs Edge triggered I/O notificationStart here
- Kernel Memory: Buddy & Slab AllocationPhysically contiguous memory requirements, Buddy System power-of-two coalescing, Slab Allocator object caches (SLUB), zero external fragmentationStart here
- Page Cache, Writeback & SwappingLinux Page Cache unified buffering, dirty page writeback daemons, pdflush/flusher threads, swap space mechanics, swappiness tuningStart here
- Real-Time OS & Multiprocessor SystemsHard vs soft real-time constraints, Rate Monotonic & Earliest Deadline First (EDF), Priority Inversion & PIP, SMP vs NUMA memoryStart here
- Virtualization & Container InternalsType-1 vs Type-2 Hypervisors, 7 Linux Namespaces (PID, NET, MNT, USER), Cgroups v2 resource regulation, OverlayFS union filesystems, OCI runtime runcStart here
- Security, Permissions & System ProgrammingPOSIX permissions & umask math, SUID/SGID privilege escalation, Buffer overflow attacks & ASLR/DEP mitigations, Signals & IPCStart here
- FAANG OS Drills & Master Cheat SheetTop 10 High-frequency interview drills, complete mathematical formula cheat sheet, Linux syscall reference, diagnostics (top/vmstat/strace), readiness matrixStart here
Practice this
Put it to work on LakeBench.
Common questions
- Do I need to know programming before this notebook?
- Basic programming helps, but every idea starts from a plain example. You will see small diagrams and traces before any formula.
- Is this enough for the operating systems questions in placements?
- It covers the topics those rounds ask most, with worked numerical examples for scheduling, paging and disk scheduling, and a final chapter of interview drills.
- Can I read a sample before I commit?
- Yes. The contents pages and the first pages of every notebook can be read online, so you can judge the style before going further.



