Operating System Notes for Placements and Interviews

Operating system notes for placement interviews: processes, threads, CPU scheduling, deadlocks, paging, virtual memory and file systems, with worked examples.

  • Notes: 12
  • Reading time: about 3 hours
  • Cost: Free, no sign-in needed

Processes, threads, CPU scheduling, synchronization, deadlocks, memory, virtual memory, file systems and disk scheduling.

Read in this order

  1. Introduction to Operating Systems — What an operating system does, kernel mode vs user mode, how a system call works, the types of OS from batch to real-time, and monolithic vs microkernel.
  2. Processes and Threads — What a process and a thread are, what a PCB holds, the process state diagram, how a context switch works, fork() and exec(), and the multithreading models.
  3. CPU Scheduling Algorithms — CPU scheduling in operating systems: FCFS, SJF, SRTF, priority with aging, Round Robin and multilevel queues, all run on one example with Gantt charts.
  4. Process Synchronization — Race conditions, the critical section problem and its three requirements, Peterson's solution, test-and-set, mutex locks, semaphores and monitors in the OS.
  5. Classic Synchronization Problems — Classic OS synchronization problems with semaphores: bounded-buffer producer-consumer, readers-writers starvation, dining philosophers without deadlock.
  6. Deadlocks in Operating Systems — Deadlocks in OS: the four Coffman conditions, resource allocation graphs, prevention, avoidance with a worked Banker's algorithm, detection and recovery.
  7. Memory Management — Memory management in OS: logical vs physical addresses, the MMU, first, best and worst fit worked out, fragmentation, paging and segmentation.
  8. Virtual Memory and Demand Paging — Virtual memory in operating systems: demand paging, how a page fault is handled, TLB effective access time worked out, multi-level page tables and thrashing.
  9. Page Replacement Algorithms — Page replacement algorithms in OS: FIFO, Optimal, LRU and clock worked frame by frame, their fault counts, and Belady's anomaly with 3 vs 4 frames.
  10. File Systems — File systems in OS: attributes, access methods, directory structures, contiguous, linked and indexed allocation, inodes worked out, free space and FAT.
  11. Disk Scheduling Algorithms — Disk scheduling in OS: seek time and rotational latency, then FCFS, SSTF, SCAN, C-SCAN, LOOK and C-LOOK on one queue with total head movement.
  12. Inter-Process Communication — Inter-process communication in OS: shared memory vs message passing, pipes and FIFOs, message queues, sockets and signals, compared, with C examples.

Test yourself

Other subjects