π― Operating Systems β Complete Zero-to-Interview Roadmap
Goal: Master Operating Systems from absolute zero to interview-ready level for top-tier SDE roles (FAANG, Juspay, Uber, Stripe, Microsoft, Startups).
Approach: Deep-dive theoretical rigor + low-level internals + multi-threading/concurrency mastery + practical code + numerical problems + 100+ interview Q&As.
Total Estimated Time: 3-4 weeks of focused study (2-3 hours/day).
πΊοΈ Visual Learning Path
Phase 1: OS Core Architecture & Execution Model
βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ
β 01 - OS Basics & Core β ββββββΊβ 02 - Process & Thread β
β Kernel vs User Mode, β β Management, Lifecycle, β
β Syscalls, Interrupts β β PCB/TCB, IPC, Models β
βββββββββββββββββββββββββββ ββββββββββββββ¬βββββββββββββ
β
Phase 2: Scheduling & Concurrency Engine βΌ
βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ
β 04 - Synchronization β βββββββ 03 - CPU Scheduling β
β & Concurrency Mastery β β Algorithms, Metrics, β
β Locks, Semaphores, β β Gantt Charts, MLFQ, β
β Deadlocks, Tree-Lockingβ β CFS & Multicore β
ββββββββββββββ¬βββββββββββββ βββββββββββββββββββββββββββ
β
Phase 3: Resource Subsystems (Memory & Storage)
βΌ
βββββββββββββββββββββββββββ βββββββββββββββββββββββββββ
β 05 - Memory Management β ββββββΊβ 06 - File Systems & β
β Paging, TLB, Virtual β β Disk Storage β
β Memory, Allocation, β β Inodes, Disk Sched, β
β Page Replacement, COW β β VFS, RAID Levels β
βββββββββββββββββββββββββββ ββββββββββββββ¬βββββββββββββ
β
Phase 4: Battle Testing & Interview Readiness βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 07 - Interview Prep, Scenarios & 100+ Question Bank β
β Tricky edge cases, real-world high concurrency scenarios β
β (epoll, zero-copy, false sharing, LeetCode concurrency) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββπ Module Overview
| # | Module File | Core Topics Covered | Practical Focus | Est. Time |
|---|---|---|---|---|
| 01 | OS Basics & Core Architecture | What is an OS, Dual-Mode CPU execution (Ring 0 vs Ring 3), System Calls under the hood (trap, dispatch table), Hardware vs Software Interrupts, IDT, Polling vs Interrupt-driven I/O, Boot sequence (BIOS/UEFI β Kernel init). | Writing assembly syscalls, understanding kernel mode transitions, tracing syscalls with strace. | 2 days |
| 02 | Process Management & IPC | Process memory layout (Text, Data, BSS, Heap, Stack), PCB, 5/7-State process lifecycle, Multiprogramming vs Multitasking vs Multiprocessing vs Multithreading, Thread models (1:1, N:1, M:N), Context Switching internals, fork(), COW, exec(), wait(), Zombie vs Orphan processes, IPC (Pipes, Shared Memory, Message Queues, Unix Domain Sockets). | Implementing IPC channels in C/C++, building process supervisors, handling zombie reapers. | 3 days |
| 03 | CPU Scheduling Algorithms | CPU/IO burst cycles, Preemptive vs Non-preemptive scheduling, Scheduling metrics (TAT, WT, RT), FCFS & Convoy Effect, SJF, SRTF, Priority Scheduling & Aging, Round Robin (Quantum tuning), HRRN, Multilevel Feedback Queue (MLFQ), Linux Completely Fair Scheduler (CFS, vruntime, Red-Black tree), Multicore scheduling (NUMA, affinity, cache balancing). | Solving numerical Gantt chart problems, implementing RR & MLFQ simulators. | 3 days |
| 04 | Synchronization & Concurrency Mastery | Race conditions, Critical section requirements (Mutual Exclusion, Progress, Bounded Waiting), Hardware primitives (CAS, Test-And-Set, Memory Barriers, MESI cache coherence), Peterson's Algorithm, Mutex vs Semaphore (Binary/Counting), Spinlocks vs Sleep locks, Monitors & Condition Variables, Read-Write Locks (Reader vs Writer preference), Classical problems (Producer-Consumer, Readers-Writers, Dining Philosophers, Sleeping Barber), Deadlocks (4 Coffman conditions, Prevention, Banker's Algorithm avoidance, RAG detection, Recovery), Priority Inversion & PIP, Juspay Tree-of-Space fine-grained locking & Lock-Free concurrency. | Implementing thread-safe queues, custom locks from scratch, lock-free stacks, multi-threaded tree locking. | 5 days |
| 05 | Memory Management & Virtual Memory | Logical vs Physical addressing, MMU, Base/Limit registers, Contiguous allocation (First/Best/Worst Fit), Internal vs External fragmentation, Buddy Allocator & Slab Allocator, Paging internals (Page tables, Multi-level page tables, Inverted page tables, PTBR), TLB (Hit/Miss, EAT calculations, TLB Shootdown), Segmentation, Virtual Memory & Demand Paging, Page Fault Handling cycle, Page Replacement (FIFO, Belady's Anomaly, LRU, Optimal, Clock/Second-Chance, LFU/MFU), Thrashing & Working Set Model, Copy-On-Write (COW), mmap. | Numerical page table & EAT calculations, implementing LRU/Clock algorithms, debugging memory leaks. | 4 days |
| 06 | File Systems & Storage Management | File concepts & Inode data structure (Direct/Indirect pointers), Hard links vs Soft/Symbolic links, Directory implementations, File allocation methods (Contiguous, Linked list, FAT, Indexed, Inode-based), Free space management (Bitmaps, Linked Lists), Virtual File System (VFS) abstraction, Journaling & WAL crash recovery (ext3/ext4), Disk geometry, Disk Scheduling (FCFS, SSTF, SCAN, C-SCAN, LOOK, C-LOOK), RAID levels (0, 1, 5, 6, 10, Parity math, rebuild overhead). | Calculating disk head movements, file allocation block pointers, designing basic file system metadata. | 3 days |
| 07 | Interview Prep, Scenarios & 100+ Q&A Bank | 100+ categorised high-yield SDE questions with deep answers, High-concurrency system internals (select/poll/epoll/kqueue, Reactor pattern, Zero-copy sendfile, CPU cache line false sharing, Goroutines vs Java Virtual Threads vs Native threads), What happens when you press a key/run a command/stream music while compiling, LeetCode Concurrency problem solutions with online links & GATE numerical practice bank. | Mock interview drills, high-concurrency debugging, LeetCode concurrency problems. | 4 days |
ποΈ The Core Pillars of Operating Systems
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OPERATING SYSTEM CORE PILLARS β
βββββββββββββββββββββ¬βββββββββββββββββββββ¬βββββββββββββββββββββ¬βββββββββββββββββββββββββββ€
β VIRTUALIZATION β CONCURRENCY β PERSISTENCE β SECURITY & ISOLATION β
βββββββββββββββββββββΌβββββββββββββββββββββΌβββββββββββββββββββββΌβββββββββββββββββββββββββββ€
β Virtual CPU β Multi-threading β File Systems β Dual-Mode Rings (0 & 3) β
β (Time-sharing, β Synchronization β Inodes & Buffers β Page Table Permissions β
β Scheduling, β Mutual Exclusion β Journaling / WAL β Sandboxing / Namespaces β
β Context Switch) β Deadlock Handling β Disk Scheduling β Memory Isolation β
β β Lock-Free & Atomicsβ RAID Redundancy β System Call Gateways β
β Virtual Memory β β β β
β (Paging, TLB, β β β β
β Address Spaces) β β β β
βββββββββββββββββββββ΄βββββββββββββββββββββ΄βββββββββββββββββββββ΄βββββββββββββββββββββββββββπ‘ How to Master This Material
- Active Coding & Tracing: Don't just read definitions. Trace every system call, draw memory maps, and write multi-threaded code snippets locally.
- Solve Every Numerical: CPU scheduling tables, EAT calculations, Page table size math, and Disk head movements are guaranteed easy points in interviews if you practice the step-by-step arithmetic.
- Master the "Why" and "Trade-offs":
- Why not have infinite time slices in Round Robin?
- Why does Belady's Anomaly happen with FIFO but never with LRU?
- Why does fine-grained locking increase throughput but risk deadlocks?
- Why does epoll scale to 100k connections while select degrades at 1024?
- Special Focus on High-Concurrency & Multi-Threading:
- If preparing for Juspay, Uber, HFTs, or High-Scale Backend teams, dedicate 40% of your time to Module 04 (Synchronization) and Module 07 (Scenarios & Concurrency). You will be asked to design thread-safe trees, implement custom locks without library mutexes, and prevent race conditions at scale.
π Interview Readiness Checklist
Track your progress across all core competencies:
π° Architecture & Process Fundamentals
- Can explain User Mode vs Kernel Mode and why the CPU hardware mode bit is critical
- Can trace a System Call step-by-step: trap instruction β dispatch table β kernel handler β
sysret - Understand hardware interrupts vs software traps vs exceptions
- Can diagram the process memory layout (Text, Data, BSS, Heap, Stack)
- Understand Process Control Block (PCB) fields and the exact steps of a Context Switch
- Know the difference between Multiprogramming, Multitasking, Multiprocessing, and Multithreading
- Can explain
fork(), Copy-on-Write (COW),exec(), and how Zombie and Orphan processes occur - Understand all IPC mechanisms (Pipes, Shared Memory, Message Queues, Sockets) and their performance trade-offs
β‘ CPU Scheduling
- Can calculate Turnaround Time, Waiting Time, and Response Time across FCFS, SJF, SRTF, RR, Priority, HRRN
- Understand the Convoy Effect in FCFS and how to mitigate it
- Can explain the Round Robin time quantum dilemma (too small = context switch overhead, too large = FCFS)
- Know how Multilevel Feedback Queue (MLFQ) prevents starvation and penalizes CPU-heavy tasks
- Understand how Linux CFS uses
vruntimeand Red-Black trees for $O(\log N)$ / $O(1)$ scheduling
π Concurrency, Synchronization & Deadlocks
- Can define a Race Condition and Critical Section with real-world code examples
- Know the 3 requirements for critical section solutions: Mutual Exclusion, Progress, Bounded Waiting
- Understand atomic hardware instructions:
Compare-And-Swap(CAS),Test-And-Set, Memory Barriers - Deeply understand Mutex vs Semaphore (Binary vs Counting) and who is allowed to unlock/signal
- Can implement and explain solutions for Producer-Consumer, Readers-Writers, and Dining Philosophers
- Know the 4 Coffman Deadlock conditions and how to prevent each one
- Can run Banker's Algorithm by hand to find safe sequences and evaluate allocation requests
- Understand Priority Inversion and how Priority Inheritance Protocol (PIP) resolves it
- Can design fine-grained per-node locking strategies (Juspay Tree-of-Space style)
π§ Memory Management & Virtual Memory
- Understand Logical vs Physical addresses, MMU address translation, and Base/Limit registers
- Know the difference between Internal and External fragmentation and how Paging eliminates external fragmentation
- Can calculate Page Table sizes for single-level and multi-level paging schemes
- Understand TLB Hit/Miss mechanics, Effective Access Time (EAT), and TLB shootdowns
- Can walk through a Page Fault interrupt cycle from page-table invalid bit to disk fetch to restart
- Can solve Page Replacement problems using FIFO, LRU, Optimal, and Clock algorithms
- Understand Belady's Anomaly and why Stack algorithms (like LRU) are immune to it
- Know what Thrashing is, what causes it, and how the Working Set Model prevents it
- Understand how
mmapand Copy-on-Write (COW) optimize process creation and file I/O
πΎ File Systems & Disk I/O
- Understand Inodes, direct/indirect data block pointers, and file allocation methods
- Know the exact difference between Hard Links and Soft (Symbolic) Links
- Understand Journaling (Write-Ahead Logging) and how file systems recover from sudden power loss
- Can calculate total head movement for Disk Scheduling algorithms (SSTF, SCAN, C-SCAN, LOOK, C-LOOK)
- Know RAID levels (0, 1, 5, 6, 10), their redundancy guarantees, performance, and rebuild overheads
π Advanced Engineering Scenarios
- Can explain how I/O multiplexing works:
selectvspollvsepoll($O(N)$ vs $O(1)$ readiness notifications) - Understand Zero-Copy data transfers (
sendfile(), DMA, bypassing user-space buffer copies) - Can identify False Sharing in CPU L1/L2 cache lines and how to fix it with cache line padding
- Know the exact sequence of events when typing a shell command, pressing a keyboard key, or streaming audio while compiling
Let's begin with Module 01: OS Basics & Core Architecture!