Os Fundamentals & Architecture
Explain the difference between Kernel Mode and User Mode. Why is this dual-mode operation necessary for system security?
What is the primary purpose of an Operating System, and what are its core functions?
What are privileged instructions, and why can they only run in kernel mode?
What are the different types of operating systems (batch, time-sharing, real-time, distributed, embedded)?
What is multiprogramming, and how does it improve CPU utilization?
Explain the difference between Type 1 (Bare Metal) and Type 2 (Hosted) Hypervisors.
Explain the Bootstrapping process. What is the role of the BIOS/UEFI and the bootloader in handing control to the OS?
What is the difference between symmetric multiprocessing (SMP) and asymmetric multiprocessing?
What is the difference between protection and security in an operating system?
Compare Monolithic Kernels and Microkernels. What are the tradeoffs regarding performance, modularity, and system stability?
What is the conceptual difference between a Virtual Machine and a Container, focusing on the OS mechanisms like Namespaces and Cgroups that enable containerization?
How do OS-level Namespaces and Cgroups enable the isolation required for containers?
Explain the difference between a Type-1 and Type-2 hypervisor. How do containers using namespaces/cgroups differ conceptually from Virtual Machines?
Compare layered, modular, and hybrid kernel architectures.
Processes & Threads
Describe the Process State Transition Diagram. What triggers a process to move from Running to Waiting vs. Ready?
Explain the fundamental differences between a process and a thread. How do they differ in terms of memory sharing and overhead?
What is a Process Control Block (PCB), and what specific information does the OS store in it to manage a process?
What resources are shared between threads of the same process, and what are kept private?
Explain the difference between a Program, a Process, and a Thread.
What are the benefits and costs of multithreading an application?
What is a zombie process, and how does it differ from an orphan process? Why is it important for a parent to 'wait' on its child?
Explain the 'copy-on-write' mechanism used during a fork() system call. Why is it efficient?
What is the difference between a user-level thread and a kernel-level thread, and what are the tradeoffs of each model?
Explain the fork() and exec() model of process creation. What happens to the address space during a fork()?
Why is context switching between threads generally faster than between processes?
When would you choose a multithreaded architecture over a multiprocess one for a single-machine application?
What is a Thread Control Block (TCB), and how does it differ from a PCB?
How do the many-to-one, one-to-one, and many-to-many multithreading models differ?
System Calls Interrupts & Kernel Interaction
What is a system call, and how does it differ from a standard library function call?
What is the difference between an Interrupt and a Trap (or Exception)? Give an example of when each would occur.
What is the role of the Interrupt Vector Table in handling hardware signals?
Explain the difference between Polling, Interrupt-driven I/O, and Direct Memory Access (DMA).
What exactly happens during a System Call? Walk through the transition from user space to kernel space.
Cpu Scheduling
Explain the difference between preemptive and non-preemptive scheduling. When would you prefer one over the other?
What is the difference between Throughput, Turnaround Time, and Response Time?
How does a round robin scheduler handle a process that requires more time than the allocated time quantum?
How does priority scheduling work, and how are priorities assigned to processes?
What is a Context Switch? Describe the steps the OS takes during a switch and explain why it is considered overhead.
What is Starvation in the context of priority scheduling, and how does Aging solve it?
What is the convoy effect in FCFS scheduling, and how do algorithms like Round Robin mitigate it?
How does a Multi-level Feedback Queue work to balance the needs of I/O-bound and CPU-bound processes?
What are the primary goals of a CPU scheduler? Explain the tradeoffs between throughput, turnaround time, and response time.
How does the Round Robin algorithm work, and how does the choice of time quantum size affect response time vs. throughput?
Explain the difference between a short-term, medium-term, and long-term scheduler.
Compare and contrast Round Robin and Shortest Job First scheduling. In what scenario would Round Robin be preferred?
What is swapping, and how does the medium-term scheduler use it to manage memory?
What is the role of the Dispatcher, and what is meant by dispatch latency?
Explain the difference between Shortest Job First (SJF) and Shortest Remaining Time First (SRTF) scheduling.
How does Multilevel Queue scheduling work, and how does it differ from Multilevel Feedback Queue?
Process Synchronization
What is a Race Condition? Provide a conceptual example of how it can lead to data inconsistency.
What is the conceptual difference between a mutex and a semaphore? When would you use a counting semaphore instead of a binary one?
Explain the critical section problem and the three requirements for a valid solution.
What is the difference between a spinlock and a blocking lock? When would you prefer one over the other?
Describe the Producer-Consumer (Bounded Buffer) problem and how semaphores are used to solve it.
How do the wait() and signal() operations of a semaphore work internally, and why must they be atomic?
What is a monitor, and how do condition variables with wait() and signal() differ from semaphores?
Explain Peterson's solution to the critical-section problem. What assumptions does it rely on?
How do hardware instructions like Test-and-Set and Compare-and-Swap help implement synchronization primitives?
Describe the Dining Philosophers problem. What solutions prevent deadlock in it?
What is Priority Inversion, and how does Priority Inheritance mitigate it?
Explain the readers-writers problem and the trade-offs between reader-preference and writer-preference solutions.
Deadlocks
What are the four Coffman Conditions necessary for a deadlock to occur?
Compare Deadlock, Livelock, and Starvation.
What is a Resource Allocation Graph, and how can it be used to detect a deadlock?
What is the Ostrich approach to handling deadlocks, and why do general-purpose OSs often use it?
Explain the difference between Deadlock Prevention and Deadlock Avoidance. How does the Banker's Algorithm ensure a Safe State?
How does the Banker's Algorithm determine if a system is in a Safe State?
How does deadlock detection and recovery work when the OS allows deadlocks to occur?
Memory Management & Virtual Memory
What is Virtual Memory, and how does it allow a program to run even if it is larger than the available physical RAM?
What is Virtual Memory, and what are the primary benefits it provides to a programmer?
What is the Translation Lookaside Buffer (TLB), and how does it speed up address translation?
What is 'thrashing' in an OS? What are the primary causes, and how can the OS detect or prevent it?
Explain the difference between Internal and External Fragmentation. Which occurs in Paging and which in Contiguous Allocation?
Compare paging and segmentation. What are the advantages of a segmented paging approach?
What is a Page Fault? Walk through the steps the OS takes to resolve one.
Explain the difference between Logical (Virtual) and Physical addresses. What is the role of the MMU?
What is Paging, and how does it solve the problem of External Fragmentation?
Compare the FIFO, LRU, and Optimal page-replacement algorithms. Why is Optimal impossible to implement in practice?
What is the difference between compile-time, load-time, and execution-time address binding?
What is memory compaction, and what problem does it solve in contiguous allocation?
What are memory-mapped files, and what advantages do they offer over regular read/write I/O?
How does the Clock (Second-Chance) page-replacement algorithm approximate LRU?
Explain Belady's Anomaly. Why does it occur in FIFO page replacement but not in LRU?
Compare the LRU and FIFO page replacement algorithms, and what is Belady's Anomaly?
What is a Page Table, and why do modern systems use Multi-level Page Tables instead of a single flat table?
Explain the Working Set Model. How is the working set window used to estimate the degree of multiprogramming?
What is an inverted page table, and what problem does it solve compared to a per-process page table?
How do you compute the Effective Access Time in a paged system with a TLB?
How do LFU and MFU page-replacement algorithms work, and what are their drawbacks?
What is the Page-Fault Frequency (PFF) scheme for controlling thrashing?
How does the OS decide how many frames to allocate to each process (global vs local allocation)?
File Systems
Compare the different directory structures (single-level, two-level, tree, acyclic-graph).
What are the different file access methods (sequential, direct, indexed)?
What is an 'inode' in a Unix-like file system? What kind of information does it store and what does it not store?
Explain the difference between a hard link and a symbolic (soft) link. What happens to the file if the original link is deleted in each case?
What is a File Descriptor, and how does the OS use the Open-File Table to manage file access across processes?
How does free-space management work using a bit vector versus a linked list?
What is the FAT (File Allocation Table), and how does it track file blocks?
What does it mean to mount a file system, and what does the OS do during mounting?
What is the purpose of Journaling in a file system, and how does it help with recovery after a system crash?
Compare contiguous, linked, and indexed file allocation methods. Which one is most efficient for random access?
Explain the concept of a Virtual File System (VFS) layer.
Inter Process Communication
What is a Pipe, and what is the difference between a Named and Unnamed pipe?
Explain how pipes work for communication between a parent and child process.
What are the primary mechanisms for Inter-Process Communication? Compare Shared Memory vs. Message Passing in terms of speed and ease of implementation.
What are signals in a Unix-like OS, and how are they used for inter-process communication?
How do sockets function as an IPC mechanism at the OS level?
I O Systems
What is a device driver, and what role does it play in the OS I/O subsystem?
Explain the difference between Polling and Interrupt-driven I/O. In what scenario would Polling actually be more efficient?
What is DMA, and why is it critical for high-speed data transfer between devices and memory?
Explain the difference between blocking, non-blocking, and asynchronous I/O.
Compare Buffering and Spooling. Give a real-world example of each.
What is the role of buffering and caching in the I/O subsystem?
Storage & Disk Management
Explain Disk Scheduling algorithms like SCAN and C-LOOK. How do they reduce seek time compared to FCFS?
What are RAID levels, and how do RAID 0, 1, and 5 differ in terms of performance and redundancy?
What are the key differences between an SSD and an HDD from the OS's storage-management perspective?
How does the SSTF disk-scheduling algorithm work, and what problem (starvation) can it cause?
What is the difference between SCAN, C-SCAN, LOOK, and C-LOOK disk-scheduling algorithms?
What is the OS page cache (buffer cache), and how does it improve file I/O performance?
Protection & Real Time Systems
What is the principle of least privilege, and how does the OS enforce it using Access Control Lists or capabilities?
What defines a 'Real-Time Operating System' (RTOS)? What is the difference between 'hard' and 'soft' real-time constraints?
What is a Real-Time Operating System (RTOS), and how does its scheduler differ from a standard OS?
Explain the Access Matrix model of protection. How do ACLs and Capability Lists represent different views of this matrix?