Operating Systems MCQ 60 Tests With Answers (2026)

Operating Systems MCQ practice is essential for GATE CS, university exams, and technical interviews at product-based companies. This comprehensive MCQ test provides 60 carefully curated practice questions spanning OS architecture, process management, CPU scheduling algorithms, memory management, concurrency, and virtualization β every concept examiners test.
Questions are organized into three progressive difficulty levels: Basics (20 Qs on kernel, shell, OS types, bootstrapping, and dual-mode), Concepts (20 Qs on processes, threads, scheduling, virtual memory, paging, and IPC), and Advanced (20 Qs on deadlocks, synchronization primitives, Linux CFS, NUMA, Copy-on-Write, and hypervisors). Each carries a detailed explanation covering not just the correct answer but why the distractors are wrong.
Use Study Mode to reveal explanations instantly as you go β ideal for first-pass learning. Switch to Exam Mode for a timed, scored simulation that mirrors GATE CS and technical interview conditions. The engine tracks your performance across all three levels so you can identify and close specific knowledge gaps.
Contents
- 1.Basics (20 Questions)OS definition Β· kernel Β· shell Β· bootstrapping Β· dual-mode Β· OS types
- 2.Concepts (20 Questions)process vs. program Β· PCB Β· threads Β· scheduling Β· virtual memory Β· paging Β· TLB
- 3.Advanced (20 Questions)race conditions Β· deadlocks Β· mutex Β· semaphore Β· CFS Β· NUMA Β· hypervisors
- 4.Conclusionsummary Β· next steps Β· study tips
- 5.Key Takeawaysquick-fire bullet recap of essential facts
- 6.Quick Review Summaryconcept Β· definition Β· key fact table
- 7.FAQcommon questions answered
Introduction to Operating Systems β Basics
1What is the primary purpose of an Operating System?
CorrectA: To act as an intermediary between the user of a computer and the computer hardware, managing resources efficiently
An Operating System acts as an intermediary between users and hardware. It manages CPU, memory, storage, and I/O resources, providing a stable, consistent interface so applications can run without directly manipulating hardware.
IncorrectA: To act as an intermediary between the user of a computer and the computer hardware, managing resources efficiently
An Operating System acts as an intermediary between users and hardware. It manages CPU, memory, storage, and I/O resources, providing a stable, consistent interface so applications can run without directly manipulating hardware.
2What is a "Kernel" in the context of an Operating System?
CorrectC: The core component of the operating system that remains in main memory and directly controls hardware resources
The kernel is the heart of the OS β the one component that remains permanently resident in RAM. It directly manages CPU time, memory allocation, device I/O, and system calls, forming the boundary between user applications and hardware.
IncorrectC: The core component of the operating system that remains in main memory and directly controls hardware resources
The kernel is the heart of the OS β the one component that remains permanently resident in RAM. It directly manages CPU time, memory allocation, device I/O, and system calls, forming the boundary between user applications and hardware.
3Which of the following best defines "Multiprogramming"?
CorrectD: Keeping multiple jobs in main memory simultaneously to maximize CPU utilization by switching between them during I/O waits
Multiprogramming keeps several jobs loaded in RAM at once. Whenever the active job performs an I/O operation (blocking the CPU), the OS switches to another ready job. This eliminates idle CPU time and dramatically increases throughput.
IncorrectD: Keeping multiple jobs in main memory simultaneously to maximize CPU utilization by switching between them during I/O waits
Multiprogramming keeps several jobs loaded in RAM at once. Whenever the active job performs an I/O operation (blocking the CPU), the OS switches to another ready job. This eliminates idle CPU time and dramatically increases throughput.
4What is the function of the "Shell" in an Operating System?
CorrectB: A command interpreter or graphical interface that allows users to interact with the operating system
The shell is the outermost layer of the OS visible to the user β either a CLI (like Bash or PowerShell) or a GUI (like Windows Explorer). It accepts user commands, parses them, and invokes the appropriate system calls or programs.
IncorrectB: A command interpreter or graphical interface that allows users to interact with the operating system
The shell is the outermost layer of the OS visible to the user β either a CLI (like Bash or PowerShell) or a GUI (like Windows Explorer). It accepts user commands, parses them, and invokes the appropriate system calls or programs.
5Which statement accurately describes a "Time-sharing" operating system?
CorrectC: A logical extension of multiprogramming where the CPU switches tasks so frequently that users can interact with each program while it is running
Time-sharing extends multiprogramming into interactive computing. The CPU cycles across all active users so quickly (typically 10β100 ms slices) that each user perceives their own dedicated machine, enabling interactive terminals and multi-user systems.
IncorrectC: A logical extension of multiprogramming where the CPU switches tasks so frequently that users can interact with each program while it is running
Time-sharing extends multiprogramming into interactive computing. The CPU cycles across all active users so quickly (typically 10β100 ms slices) that each user perceives their own dedicated machine, enabling interactive terminals and multi-user systems.
6What is the defining characteristic of a Real-Time Operating System (RTOS)?
CorrectB: It is designed to process data and respond to events within strictly defined, deterministic time constraints
An RTOS guarantees that critical tasks complete within a bounded deadline. Hard RTOS systems (aerospace, medical devices, industrial controllers) treat a missed deadline as a system failure, while soft RTOS (multimedia) tolerate occasional latency.
IncorrectB: It is designed to process data and respond to events within strictly defined, deterministic time constraints
An RTOS guarantees that critical tasks complete within a bounded deadline. Hard RTOS systems (aerospace, medical devices, industrial controllers) treat a missed deadline as a system failure, while soft RTOS (multimedia) tolerate occasional latency.
7What occurs during the "Bootstrapping" process of a computer?
CorrectA: The initial execution of a small program (bootstrap loader) stored in ROM that locates and loads the operating system kernel into memory
Bootstrapping (booting) begins with the BIOS/UEFI ROM running POST, then locating and executing the boot loader (e.g., GRUB). The boot loader in turn locates the OS kernel on disk, loads it into RAM, and transfers control β pulling the system up by its own bootstraps.
IncorrectA: The initial execution of a small program (bootstrap loader) stored in ROM that locates and loads the operating system kernel into memory
Bootstrapping (booting) begins with the BIOS/UEFI ROM running POST, then locating and executing the boot loader (e.g., GRUB). The boot loader in turn locates the OS kernel on disk, loads it into RAM, and transfers control β pulling the system up by its own bootstraps.
8What is the primary purpose of a "Device Driver"?
CorrectD: To act as a software translator, allowing the generic OS to communicate with specific, proprietary hardware devices
A device driver is a software module that translates the generic OS commands (read, write, ioctl) into the vendor-specific command sequences a particular hardware device understands. Without a driver, the OS cannot communicate with that device.
IncorrectD: To act as a software translator, allowing the generic OS to communicate with specific, proprietary hardware devices
A device driver is a software module that translates the generic OS commands (read, write, ioctl) into the vendor-specific command sequences a particular hardware device understands. Without a driver, the OS cannot communicate with that device.
9What is a "System Call"?
CorrectC: The programmatic method by which a user-level process requests a privileged service or resource from the operating system kernel
A system call is the controlled API between user space and kernel space. When a program needs a privileged operation (file I/O, memory allocation, process creation), it issues a system call. The CPU switches from user mode to kernel mode, the OS executes the request, then control returns to user mode.
IncorrectC: The programmatic method by which a user-level process requests a privileged service or resource from the operating system kernel
A system call is the controlled API between user space and kernel space. When a program needs a privileged operation (file I/O, memory allocation, process creation), it issues a system call. The CPU switches from user mode to kernel mode, the OS executes the request, then control returns to user mode.
10How does a GUI (Graphical User Interface) fundamentally differ from a CLI (Command Line Interface)?
CorrectB: GUI allows interaction through visual indicators and clicking, whereas CLI requires users to type specific text commands
A GUI uses windows, icons, and a pointing device for interaction, making the OS accessible to non-technical users. A CLI requires users to type precise text commands, offering more power and scriptability at the cost of a steeper learning curve. Both are shells β different interfaces to the same kernel.
IncorrectB: GUI allows interaction through visual indicators and clicking, whereas CLI requires users to type specific text commands
A GUI uses windows, icons, and a pointing device for interaction, making the OS accessible to non-technical users. A CLI requires users to type precise text commands, offering more power and scriptability at the cost of a steeper learning curve. Both are shells β different interfaces to the same kernel.
11Which of the following describes a "Distributed Operating System"?
CorrectA: An OS that manages a collection of independent, physically separated computers and makes them appear to the user as a single, coherent system
A Distributed OS coordinates a network of autonomous computers β each with its own CPU and memory β presenting them as one unified system. It handles transparent resource sharing, fault tolerance, and load balancing across geographically separated nodes.
IncorrectA: An OS that manages a collection of independent, physically separated computers and makes them appear to the user as a single, coherent system
A Distributed OS coordinates a network of autonomous computers β each with its own CPU and memory β presenting them as one unified system. It handles transparent resource sharing, fault tolerance, and load balancing across geographically separated nodes.
12What does "Spooling" (Simultaneous Peripheral Operations On-Line) achieve?
CorrectD: Temporarily holding data in a buffer (like disk or memory) to be used and processed by a slower peripheral device, like a printer
Spooling decouples fast CPUs from slow peripherals. Print jobs, for example, are written to a disk spool queue. The CPU returns to other work immediately, while the print daemon feeds jobs to the printer at its own pace β eliminating CPU idle time waiting for I/O.
IncorrectD: Temporarily holding data in a buffer (like disk or memory) to be used and processed by a slower peripheral device, like a printer
Spooling decouples fast CPUs from slow peripherals. Print jobs, for example, are written to a disk spool queue. The CPU returns to other work immediately, while the print daemon feeds jobs to the printer at its own pace β eliminating CPU idle time waiting for I/O.
13What is the technical distinction between Multi-processing and Multiprogramming?
CorrectC: Multiprocessing involves two or more physical CPUs executing instructions simultaneously, while multiprogramming interleaves multiple tasks on a single CPU
Multiprocessing means true parallelism β two or more physical processors running instructions at the exact same instant. Multiprogramming is concurrency on a single CPU β rapid interleaving of multiple processes to keep the CPU busy. Multiprocessing inherently provides both parallelism and multiprogramming.
IncorrectC: Multiprocessing involves two or more physical CPUs executing instructions simultaneously, while multiprogramming interleaves multiple tasks on a single CPU
Multiprocessing means true parallelism β two or more physical processors running instructions at the exact same instant. Multiprogramming is concurrency on a single CPU β rapid interleaving of multiple processes to keep the CPU busy. Multiprocessing inherently provides both parallelism and multiprogramming.
14What is the primary objective of "Dual-Mode" operation in modern operating systems?
CorrectB: To protect the OS and vital system components from errant or malicious user programs by separating user mode from kernel mode
Dual-mode operation enforces a hardware-enforced privilege boundary. In user mode, processes cannot execute privileged instructions or directly access hardware. Only the kernel runs in kernel mode. A user program attempting a privileged action triggers a trap, preventing it from crashing or corrupting the system.
IncorrectB: To protect the OS and vital system components from errant or malicious user programs by separating user mode from kernel mode
Dual-mode operation enforces a hardware-enforced privilege boundary. In user mode, processes cannot execute privileged instructions or directly access hardware. Only the kernel runs in kernel mode. A user program attempting a privileged action triggers a trap, preventing it from crashing or corrupting the system.
15What does the term "Firmware" refer to?
CorrectA: Software instructions permanently or semi-permanently programmed directly into a hardware device's non-volatile memory (like ROM or flash)
Firmware is software embedded directly into hardware β burned into ROM, EEPROM, or flash chips on circuit boards. The BIOS/UEFI is the most well-known firmware. It initializes hardware before the OS loads and cannot be modified by regular software execution.
IncorrectA: Software instructions permanently or semi-permanently programmed directly into a hardware device's non-volatile memory (like ROM or flash)
Firmware is software embedded directly into hardware β burned into ROM, EEPROM, or flash chips on circuit boards. The BIOS/UEFI is the most well-known firmware. It initializes hardware before the OS loads and cannot be modified by regular software execution.
16Which of the following is a primary characteristic of a "Batch Operating System"?
CorrectD: It collects similar jobs together and processes them sequentially as a single group without any user interaction
Batch OSes (the earliest form of OS, on mainframes) collect jobs with similar requirements, group them into batches, and execute them sequentially with no user interaction mid-run. This maximizes throughput for payroll or scientific computation workloads at the cost of high turnaround time.
IncorrectD: It collects similar jobs together and processes them sequentially as a single group without any user interaction
Batch OSes (the earliest form of OS, on mainframes) collect jobs with similar requirements, group them into batches, and execute them sequentially with no user interaction mid-run. This maximizes throughput for payroll or scientific computation workloads at the cost of high turnaround time.
17What is "Graceful Degradation" (Fault Tolerance) in OS design?
CorrectA: The ability of an operating system to continue functioning at a reduced level of performance rather than failing completely when a hardware component fails
Graceful degradation means the system degrades gracefully under partial failure β losing a disk in a RAID array reduces capacity but does not stop the system; losing a CPU in an SMP system reduces throughput but other CPUs continue. This is foundational to high-availability and fault-tolerant OS design.
IncorrectA: The ability of an operating system to continue functioning at a reduced level of performance rather than failing completely when a hardware component fails
Graceful degradation means the system degrades gracefully under partial failure β losing a disk in a RAID array reduces capacity but does not stop the system; losing a CPU in an SMP system reduces throughput but other CPUs continue. This is foundational to high-availability and fault-tolerant OS design.
18What does "POSIX" refer to in operating systems?
CorrectB: A family of standards specified by the IEEE to maintain compatibility between different operating systems, particularly Unix variants
POSIX (Portable Operating System Interface) is an IEEE standard (IEEE 1003) defining a common API β system calls, shell utilities, C library interfaces β so software written for one POSIX-compliant OS (Linux, macOS, FreeBSD) can be ported to another with minimal modification.
IncorrectB: A family of standards specified by the IEEE to maintain compatibility between different operating systems, particularly Unix variants
POSIX (Portable Operating System Interface) is an IEEE standard (IEEE 1003) defining a common API β system calls, shell utilities, C library interfaces β so software written for one POSIX-compliant OS (Linux, macOS, FreeBSD) can be ported to another with minimal modification.
19What defines a "Microkernel" architecture?
CorrectC: An OS design that strips the kernel to its absolute minimum, moving most services (like file systems and drivers) into user space to enhance stability
A microkernel keeps only the absolute essentials in kernel space (IPC, basic scheduling, memory mapping). File systems, device drivers, and network stacks run as user-space servers. A crash in a driver cannot bring down the kernel, improving stability β at the cost of extra IPC overhead compared to monolithic designs like Linux.
IncorrectC: An OS design that strips the kernel to its absolute minimum, moving most services (like file systems and drivers) into user space to enhance stability
A microkernel keeps only the absolute essentials in kernel space (IPC, basic scheduling, memory mapping). File systems, device drivers, and network stacks run as user-space servers. A crash in a driver cannot bring down the kernel, improving stability β at the cost of extra IPC overhead compared to monolithic designs like Linux.
20What happens during a "Context Switch"?
CorrectD: The process of saving the state of the currently running process and loading the state of the next process to be executed by the CPU
A context switch saves the full CPU state of the outgoing process (program counter, registers, stack pointer, memory maps) into its PCB, then restores the saved state of the incoming process. The CPU then resumes execution of the new process exactly where it left off. Context switches have a real overhead cost.
IncorrectD: The process of saving the state of the currently running process and loading the state of the next process to be executed by the CPU
A context switch saves the full CPU state of the outgoing process (program counter, registers, stack pointer, memory maps) into its PCB, then restores the saved state of the incoming process. The CPU then resumes execution of the new process exactly where it left off. Context switches have a real overhead cost.
Introduction to Operating Systems β Concepts
1What is the fundamental difference between a "Program" and a "Process"?
CorrectB: A program is a passive entity (a file containing executable code), while a process is an active entity representing that code in execution
A program is simply a static binary file on disk β passive and inert. A process is that program brought to life: it has a Program Counter, an allocated stack, open file descriptors, memory segments, and an entry in the OS process table. One program can spawn many concurrent processes.
IncorrectB: A program is a passive entity (a file containing executable code), while a process is an active entity representing that code in execution
A program is simply a static binary file on disk β passive and inert. A process is that program brought to life: it has a Program Counter, an allocated stack, open file descriptors, memory segments, and an entry in the OS process table. One program can spawn many concurrent processes.
2What is a Process Control Block (PCB)?
CorrectA: A data structure maintained by the OS that contains all vital information about a specific process, such as its state, program counter, and CPU registers
The PCB (also called a Task Control Block) is the OS's complete dossier on a process. It stores state (ready/running/blocked), program counter, CPU register values, memory management info, open file list, I/O status, and scheduling priority. It is the data structure that enables context switches.
IncorrectA: A data structure maintained by the OS that contains all vital information about a specific process, such as its state, program counter, and CPU registers
The PCB (also called a Task Control Block) is the OS's complete dossier on a process. It stores state (ready/running/blocked), program counter, CPU register values, memory management info, open file list, I/O status, and scheduling priority. It is the data structure that enables context switches.
3How is a "Thread" defined in operating system environments?
CorrectD: The smallest sequence of programmed instructions that can be managed independently by a scheduler, often referred to as a lightweight process
A thread is the unit of CPU utilization β it has its own program counter, register set, and stack, but shares the code, data, and open files of its parent process. Multiple threads within one process share memory, enabling cheap concurrent execution without the overhead of spawning separate processes.
IncorrectD: The smallest sequence of programmed instructions that can be managed independently by a scheduler, often referred to as a lightweight process
A thread is the unit of CPU utilization β it has its own program counter, register set, and stack, but shares the code, data, and open files of its parent process. Multiple threads within one process share memory, enabling cheap concurrent execution without the overhead of spawning separate processes.
4What distinguishes "Preemptive" scheduling from "Non-preemptive" scheduling?
CorrectC: In preemptive scheduling, the OS can forcefully pause a running process to allocate the CPU to another; in non-preemptive, a process yields the CPU voluntarily
In preemptive scheduling, the OS can forcibly evict a running process when a higher-priority one becomes ready or its time quantum expires β enabled by the hardware timer interrupt. Non-preemptive (cooperative) scheduling requires processes to voluntarily release the CPU via system calls or I/O, making it unsuitable for interactive systems.
IncorrectC: In preemptive scheduling, the OS can forcefully pause a running process to allocate the CPU to another; in non-preemptive, a process yields the CPU voluntarily
In preemptive scheduling, the OS can forcibly evict a running process when a higher-priority one becomes ready or its time quantum expires β enabled by the hardware timer interrupt. Non-preemptive (cooperative) scheduling requires processes to voluntarily release the CPU via system calls or I/O, making it unsuitable for interactive systems.
5How does the Round Robin (RR) scheduling algorithm operate?
CorrectB: It assigns a fixed time quantum to each process in the ready queue, cycling through them equally to ensure fair CPU allocation
Round Robin assigns each process a fixed time quantum (typically 10β100 ms). After its quantum expires, the process is preempted and placed at the back of the circular ready queue. This ensures fairness and bounded response time, making it the standard algorithm for time-sharing systems.
IncorrectB: It assigns a fixed time quantum to each process in the ready queue, cycling through them equally to ensure fair CPU allocation
Round Robin assigns each process a fixed time quantum (typically 10β100 ms). After its quantum expires, the process is preempted and placed at the back of the circular ready queue. This ensures fairness and bounded response time, making it the standard algorithm for time-sharing systems.
6What causes "Starvation" in process scheduling?
CorrectA: A situation where a low-priority process is perpetually denied CPU time because higher-priority processes continuously arrive and execute
Starvation occurs in priority-based or SJF scheduling when an endless stream of higher-priority/shorter jobs keeps arriving, indefinitely blocking a lower-priority process. The solution is "aging" β gradually increasing the priority of a waiting process over time until it eventually gets scheduled.
IncorrectA: A situation where a low-priority process is perpetually denied CPU time because higher-priority processes continuously arrive and execute
Starvation occurs in priority-based or SJF scheduling when an endless stream of higher-priority/shorter jobs keeps arriving, indefinitely blocking a lower-priority process. The solution is "aging" β gradually increasing the priority of a waiting process over time until it eventually gets scheduled.
7What is the primary concept of "Virtual Memory"?
CorrectD: A memory management technique that creates an illusion of a very large main memory by seamlessly swapping data between RAM and secondary storage
Virtual memory gives each process its own private, large address space (e.g., 4 GB on 32-bit, terabytes on 64-bit) regardless of physical RAM size. Pages not currently needed are stored on disk (swap). The MMU transparently translates virtual to physical addresses, allowing programs larger than RAM to run.
IncorrectD: A memory management technique that creates an illusion of a very large main memory by seamlessly swapping data between RAM and secondary storage
Virtual memory gives each process its own private, large address space (e.g., 4 GB on 32-bit, terabytes on 64-bit) regardless of physical RAM size. Pages not currently needed are stored on disk (swap). The MMU transparently translates virtual to physical addresses, allowing programs larger than RAM to run.
8How does the "Paging" memory mechanism function?
CorrectC: A memory management scheme that eliminates the need for contiguous allocation by dividing physical memory into frames and logical memory into blocks of the same size called pages
Paging divides physical RAM into fixed-size frames and a process's logical address space into same-size pages. The page table maps each virtual page to its physical frame. This eliminates external fragmentation β any free frame can hold any page regardless of location, enabling non-contiguous physical allocation.
IncorrectC: A memory management scheme that eliminates the need for contiguous allocation by dividing physical memory into frames and logical memory into blocks of the same size called pages
Paging divides physical RAM into fixed-size frames and a process's logical address space into same-size pages. The page table maps each virtual page to its physical frame. This eliminates external fragmentation β any free frame can hold any page regardless of location, enabling non-contiguous physical allocation.
9What is a Translation Lookaside Buffer (TLB)?
CorrectA: A specialized, high-speed hardware cache within the MMU that stores recent virtual-to-physical address translations to drastically speed up memory access
Without the TLB, every memory access would require at least one additional page-table lookup in RAM β halving performance. The TLB is a small, fully-associative hardware cache (typically 64β1024 entries) inside the MMU that stores recent virtualβphysical mappings. A TLB hit requires zero extra RAM accesses; a miss triggers a page table walk.
IncorrectA: A specialized, high-speed hardware cache within the MMU that stores recent virtual-to-physical address translations to drastically speed up memory access
Without the TLB, every memory access would require at least one additional page-table lookup in RAM β halving performance. The TLB is a small, fully-associative hardware cache (typically 64β1024 entries) inside the MMU that stores recent virtualβphysical mappings. A TLB hit requires zero extra RAM accesses; a miss triggers a page table walk.
10What is the difference between Internal and External Fragmentation?
CorrectC: Internal fragmentation is unused memory within an allocated block; external fragmentation is total free memory space that is too scattered (non-contiguous) to satisfy a request
Internal fragmentation: wasted space inside an allocated partition (e.g., a 10 KB block assigned to a 6 KB process wastes 4 KB internally). External fragmentation: enough total free memory exists to satisfy a request, but it is scattered in small non-contiguous chunks. Paging eliminates external fragmentation but retains internal fragmentation.
IncorrectC: Internal fragmentation is unused memory within an allocated block; external fragmentation is total free memory space that is too scattered (non-contiguous) to satisfy a request
Internal fragmentation: wasted space inside an allocated partition (e.g., a 10 KB block assigned to a 6 KB process wastes 4 KB internally). External fragmentation: enough total free memory exists to satisfy a request, but it is scattered in small non-contiguous chunks. Paging eliminates external fragmentation but retains internal fragmentation.
11What is the File Allocation Table (FAT) in legacy file systems?
CorrectB: A file system architecture that uses a linked list structure pointing to the physical clusters where a file's data resides on the disk
FAT is a simple table β one entry per disk cluster β where each entry either indicates the cluster is free, holds EOF, or holds the index of the next cluster in the file's chain. FAT12/16/32 differ by the bit-width of cluster indices. Its simplicity made it universal on embedded systems despite lacking permissions and journaling.
IncorrectB: A file system architecture that uses a linked list structure pointing to the physical clusters where a file's data resides on the disk
FAT is a simple table β one entry per disk cluster β where each entry either indicates the cluster is free, holds EOF, or holds the index of the next cluster in the file's chain. FAT12/16/32 differ by the bit-width of cluster indices. Its simplicity made it universal on embedded systems despite lacking permissions and journaling.
12What is "Belady's Anomaly"?
CorrectD: A phenomenon in page replacement algorithms (like FIFO) where increasing the number of physical page frames actually increases the number of page faults
Discovered by LΓ‘szlΓ³ BΓ©lΓ‘dy in 1969, BΓ©lΓ‘dy's Anomaly shows that FIFO page replacement can produce more page faults with more frames β counterintuitively. The classic example: accessing pages 1,2,3,4,1,2,5 with 3 frames gives 9 faults, but with 4 frames gives 10 faults. LRU and Optimal algorithms do not suffer this anomaly.
IncorrectD: A phenomenon in page replacement algorithms (like FIFO) where increasing the number of physical page frames actually increases the number of page faults
Discovered by LΓ‘szlΓ³ BΓ©lΓ‘dy in 1969, BΓ©lΓ‘dy's Anomaly shows that FIFO page replacement can produce more page faults with more frames β counterintuitively. The classic example: accessing pages 1,2,3,4,1,2,5 with 3 frames gives 9 faults, but with 4 frames gives 10 faults. LRU and Optimal algorithms do not suffer this anomaly.
13What does the term "Thrashing" describe in memory management?
CorrectA: A state where the system spends significantly more time swapping pages between RAM and disk than executing actual instructions, severely crippling performance
Thrashing occurs when the OS over-commits memory β allowing so many concurrent processes that no process has enough frames for its working set. Every few instructions trigger a page fault, disk I/O dominates, CPU utilization plummets to near zero, and the system appears unresponsive. The Working Set Model prevents thrashing.
IncorrectA: A state where the system spends significantly more time swapping pages between RAM and disk than executing actual instructions, severely crippling performance
Thrashing occurs when the OS over-commits memory β allowing so many concurrent processes that no process has enough frames for its working set. Every few instructions trigger a page fault, disk I/O dominates, CPU utilization plummets to near zero, and the system appears unresponsive. The Working Set Model prevents thrashing.
14What is the purpose of Inter-Process Communication (IPC)?
CorrectB: Mechanisms (like shared memory or message passing) provided by the OS allowing independent processes to exchange data and synchronize their actions
IPC provides mechanisms for cooperating processes (which have separate address spaces) to communicate. Two fundamental models: shared memory (processes map a common region β fast but requires explicit synchronization) and message passing (processes exchange structured messages via OS β cleaner but involves kernel overhead on each call).
IncorrectB: Mechanisms (like shared memory or message passing) provided by the OS allowing independent processes to exchange data and synchronize their actions
IPC provides mechanisms for cooperating processes (which have separate address spaces) to communicate. Two fundamental models: shared memory (processes map a common region β fast but requires explicit synchronization) and message passing (processes exchange structured messages via OS β cleaner but involves kernel overhead on each call).
15What is the advantage of Direct Memory Access (DMA)?
CorrectD: A hardware feature that allows certain subsystems (like disk controllers) to access main system memory independently of the CPU, freeing the CPU for other tasks
Without DMA, the CPU must supervise every byte of a disk or network transfer β PIO mode wastes enormous CPU cycles. With DMA, the CPU programs the DMA controller (source, destination, count), then continues other work. The DMA controller performs the bulk transfer autonomously and sends a single interrupt when done.
IncorrectD: A hardware feature that allows certain subsystems (like disk controllers) to access main system memory independently of the CPU, freeing the CPU for other tasks
Without DMA, the CPU must supervise every byte of a disk or network transfer β PIO mode wastes enormous CPU cycles. With DMA, the CPU programs the DMA controller (source, destination, count), then continues other work. The DMA controller performs the bulk transfer autonomously and sends a single interrupt when done.
16What is the primary characteristic of the Shortest Job First (SJF) scheduling algorithm?
CorrectC: It is provably optimal in that it yields the minimum average waiting time for a given set of processes, but predicting the exact length of the next CPU burst is practically difficult
SJF is provably optimal for minimizing average waiting time β by always serving the shortest remaining job first, longer waits are incurred by fewer processes. The critical practical limitation is that the next CPU burst length is unknown; implementations use exponential averaging of past burst lengths to estimate future ones.
IncorrectC: It is provably optimal in that it yields the minimum average waiting time for a given set of processes, but predicting the exact length of the next CPU burst is practically difficult
SJF is provably optimal for minimizing average waiting time β by always serving the shortest remaining job first, longer waits are incurred by fewer processes. The critical practical limitation is that the next CPU burst length is unknown; implementations use exponential averaging of past burst lengths to estimate future ones.
17What defines a "Zombie Process" in Unix/Linux operating systems?
CorrectD: A process that has completed execution but still has an entry in the process table because its parent process has not yet read its exit status
When a child process exits, it becomes a zombie β the OS releases its resources but retains its PCB entry until the parent calls wait() to collect its exit status. A good parent always reaps its children. If a parent exits without reaping, init (PID 1) adopts and reaps the orphans. Accumulating zombies can exhaust the process table.
IncorrectD: A process that has completed execution but still has an entry in the process table because its parent process has not yet read its exit status
When a child process exits, it becomes a zombie β the OS releases its resources but retains its PCB entry until the parent calls wait() to collect its exit status. A good parent always reaps its children. If a parent exits without reaping, init (PID 1) adopts and reaps the orphans. Accumulating zombies can exhaust the process table.
18How does "Demand Paging" operate?
CorrectA: A virtual memory technique where pages are only loaded into physical memory when they are explicitly referenced or needed during execution, rather than loading the entire program at launch
With demand paging, process startup is nearly instant β no pages are pre-loaded. When the CPU references a page not in RAM, a page fault occurs. The OS locates the page on disk, loads it into a free frame, updates the page table, and resumes the instruction. Only the pages actually needed ever consume physical RAM.
IncorrectA: A virtual memory technique where pages are only loaded into physical memory when they are explicitly referenced or needed during execution, rather than loading the entire program at launch
With demand paging, process startup is nearly instant β no pages are pre-loaded. When the CPU references a page not in RAM, a page fault occurs. The OS locates the page on disk, loads it into a free frame, updates the page table, and resumes the instruction. Only the pages actually needed ever consume physical RAM.
19What is an "Inode" (Index Node) in Unix/Linux file systems?
CorrectB: A data structure that stores all critical metadata about a file (size, permissions, timestamps, physical block addresses), except for the file's actual name and data
Every file in a Unix file system has exactly one inode. It stores file type, permissions (rwxrwxrwx), UID/GID, size, timestamps (atime/mtime/ctime), link count, and pointers to the actual data blocks (direct, singly indirect, doubly indirect). Directories are simply files that map filenames to inode numbers.
IncorrectB: A data structure that stores all critical metadata about a file (size, permissions, timestamps, physical block addresses), except for the file's actual name and data
Every file in a Unix file system has exactly one inode. It stores file type, permissions (rwxrwxrwx), UID/GID, size, timestamps (atime/mtime/ctime), link count, and pointers to the actual data blocks (direct, singly indirect, doubly indirect). Directories are simply files that map filenames to inode numbers.
20What triggers a "Page Fault"?
CorrectC: A software exception raised by the hardware when a running program attempts to access a memory page that is currently not loaded into physical RAM
When the CPU translates a virtual address and finds the page table entry's "present" bit is 0 (page not in RAM), the MMU raises a page fault interrupt. The OS page fault handler locates the page in swap space, loads it into a free frame (evicting another page if necessary), updates the page table, and restarts the faulting instruction.
IncorrectC: A software exception raised by the hardware when a running program attempts to access a memory page that is currently not loaded into physical RAM
When the CPU translates a virtual address and finds the page table entry's "present" bit is 0 (page not in RAM), the MMU raises a page fault interrupt. The OS page fault handler locates the page in swap space, loads it into a free frame (evicting another page if necessary), updates the page table, and restarts the faulting instruction.
Introduction to Operating Systems β Advanced
1In concurrent programming, what is a "Race Condition"?
CorrectD: A timing-dependent flaw where the output or state of a system depends on the unpredictable sequence or timing of uncontrollable events, often leading to data corruption if threads access shared resources simultaneously
A race condition arises when correctness depends on the relative timing of events that the programmer cannot control. Classic example: two threads simultaneously execute counter++ (read, increment, write). If they interleave β both read the same value β one increment is lost. Race conditions are notoriously hard to reproduce and require proper synchronization primitives to prevent.
IncorrectD: A timing-dependent flaw where the output or state of a system depends on the unpredictable sequence or timing of uncontrollable events, often leading to data corruption if threads access shared resources simultaneously
A race condition arises when correctness depends on the relative timing of events that the programmer cannot control. Classic example: two threads simultaneously execute counter++ (read, increment, write). If they interleave β both read the same value β one increment is lost. Race conditions are notoriously hard to reproduce and require proper synchronization primitives to prevent.
2What constitutes a "Critical Section" in a process?
CorrectC: A specific segment of code where a process accesses and modifies shared variables, tables, or files, requiring strict mutual exclusion to prevent data inconsistency
Any code that reads or writes shared mutable state is a critical section. A correct critical section implementation must satisfy three properties: Mutual Exclusion (only one process inside at a time), Progress (a process outside cannot block entry), and Bounded Waiting (a process waiting to enter must eventually succeed).
IncorrectC: A specific segment of code where a process accesses and modifies shared variables, tables, or files, requiring strict mutual exclusion to prevent data inconsistency
Any code that reads or writes shared mutable state is a critical section. A correct critical section implementation must satisfy three properties: Mutual Exclusion (only one process inside at a time), Progress (a process outside cannot block entry), and Bounded Waiting (a process waiting to enter must eventually succeed).
3What is a "Mutex" (Mutual Exclusion Object)?
CorrectA: A synchronization primitive used to strictly serialize access to a shared resource, acting as a locking mechanism where only the thread that acquired the lock can release it
A mutex is a binary synchronization primitive with ownership semantics: only the thread that successfully called lock() can later call unlock(). Attempting to lock an already-locked mutex causes the calling thread to block. This ownership model prevents accidental release by the wrong thread, distinguishing mutexes from binary semaphores.
IncorrectA: A synchronization primitive used to strictly serialize access to a shared resource, acting as a locking mechanism where only the thread that acquired the lock can release it
A mutex is a binary synchronization primitive with ownership semantics: only the thread that successfully called lock() can later call unlock(). Attempting to lock an already-locked mutex causes the calling thread to block. This ownership model prevents accidental release by the wrong thread, distinguishing mutexes from binary semaphores.
4What is the core difference between a Semaphore and a Mutex?
CorrectB: A mutex is an ownership-based locking mechanism used for mutual exclusion, whereas a semaphore is a signaling mechanism (often an integer) used to manage access to a finite pool of multiple identical resources
A mutex enforces mutual exclusion with strict ownership β only the locker can unlock. A semaphore is a signaling counter: a counting semaphore initialized to N allows N threads concurrent access (managing N identical resources like database connections). A binary semaphore (0/1) can be used for mutual exclusion, but lacks the ownership constraint of a mutex.
IncorrectB: A mutex is an ownership-based locking mechanism used for mutual exclusion, whereas a semaphore is a signaling mechanism (often an integer) used to manage access to a finite pool of multiple identical resources
A mutex enforces mutual exclusion with strict ownership β only the locker can unlock. A semaphore is a signaling counter: a counting semaphore initialized to N allows N threads concurrent access (managing N identical resources like database connections). A binary semaphore (0/1) can be used for mutual exclusion, but lacks the ownership constraint of a mutex.
5Which of the following best defines a "Deadlock"?
CorrectD: A state where a set of processes are permanently blocked because each process is holding a resource and waiting to acquire a resource held by another process in the set
A deadlock is a circular wait among processes: P1 holds R1 and wants R2; P2 holds R2 and wants R1. Neither can proceed without the other releasing first β resulting in permanent blockage. This is not livelock (processes keep changing state but make no progress) nor starvation (indefinitely delayed but still eligible).
IncorrectD: A state where a set of processes are permanently blocked because each process is holding a resource and waiting to acquire a resource held by another process in the set
A deadlock is a circular wait among processes: P1 holds R1 and wants R2; P2 holds R2 and wants R1. Neither can proceed without the other releasing first β resulting in permanent blockage. This is not livelock (processes keep changing state but make no progress) nor starvation (indefinitely delayed but still eligible).
6Which four conditions (known as Coffman Conditions) must hold simultaneously for a deadlock to arise?
CorrectC: Mutual Exclusion, Hold and Wait, No Preemption, and Circular Wait
All four Coffman conditions must coexist: (1) Mutual Exclusion β resources are non-shareable; (2) Hold and Wait β processes hold resources while requesting more; (3) No Preemption β resources cannot be forcibly taken; (4) Circular Wait β a cycle exists in the resource-allocation graph. Breaking any one condition prevents deadlock.
IncorrectC: Mutual Exclusion, Hold and Wait, No Preemption, and Circular Wait
All four Coffman conditions must coexist: (1) Mutual Exclusion β resources are non-shareable; (2) Hold and Wait β processes hold resources while requesting more; (3) No Preemption β resources cannot be forcibly taken; (4) Circular Wait β a cycle exists in the resource-allocation graph. Breaking any one condition prevents deadlock.
7What is the purpose of the "Banker's Algorithm"?
CorrectB: A deadlock avoidance algorithm that simulates the allocation of predetermined maximum possible resource requests, ensuring the system remains in a "safe state" before formally granting a request
Dijkstra's Banker's Algorithm prevents deadlock by simulating resource allocation before committing. It checks whether granting a request leaves the system in a "safe state" β one from which a sequence exists to run all processes to completion. If unsafe, the request is deferred. The name comes from a bank that only lends if it can still satisfy all potential maximum customer withdrawals.
IncorrectB: A deadlock avoidance algorithm that simulates the allocation of predetermined maximum possible resource requests, ensuring the system remains in a "safe state" before formally granting a request
Dijkstra's Banker's Algorithm prevents deadlock by simulating resource allocation before committing. It checks whether granting a request leaves the system in a "safe state" β one from which a sequence exists to run all processes to completion. If unsafe, the request is deferred. The name comes from a bank that only lends if it can still satisfy all potential maximum customer withdrawals.
8What is the "Priority Inversion" problem in process scheduling?
CorrectA: A scenario where a high-priority task is indirectly preempted by a lower-priority task effectively "inverting" the assigned priorities, often because a medium-priority task preempted a low-priority task holding a shared lock
Priority inversion: High-H waits for Low-L to release a mutex. Medium-M (needing no mutex) preempts L, blocking L indefinitely β so H is indirectly blocked by M, inverting their priorities. This famously crashed the Mars Pathfinder rover. The fix is Priority Inheritance: L temporarily inherits H's priority until it releases the lock.
IncorrectA: A scenario where a high-priority task is indirectly preempted by a lower-priority task effectively "inverting" the assigned priorities, often because a medium-priority task preempted a low-priority task holding a shared lock
Priority inversion: High-H waits for Low-L to release a mutex. Medium-M (needing no mutex) preempts L, blocking L indefinitely β so H is indirectly blocked by M, inverting their priorities. This famously crashed the Mars Pathfinder rover. The fix is Priority Inheritance: L temporarily inherits H's priority until it releases the lock.
9What is a "Monitor" in the context of process synchronization?
CorrectB: A high-level synchronization construct that encapsulates shared data structures, procedures, and synchronization variables within a single abstract data type, inherently enforcing mutual exclusion
A monitor (introduced by Hoare and Hansen) is a programming-language construct that bundles shared data and the procedures that operate on it. The language runtime guarantees that only one thread executes inside the monitor at a time β mutual exclusion is automatic. Condition variables (wait/signal) handle more nuanced synchronization within the monitor.
IncorrectB: A high-level synchronization construct that encapsulates shared data structures, procedures, and synchronization variables within a single abstract data type, inherently enforcing mutual exclusion
A monitor (introduced by Hoare and Hansen) is a programming-language construct that bundles shared data and the procedures that operate on it. The language runtime guarantees that only one thread executes inside the monitor at a time β mutual exclusion is automatic. Condition variables (wait/signal) handle more nuanced synchronization within the monitor.
10What is the "Working Set Model" designed to accomplish?
CorrectD: A memory management strategy that tracks the set of pages a process is actively using over a specific time window, helping the OS prevent thrashing by allocating enough frames to cover this set
Denning's Working Set Model defines W(t, Ξ) as the set of pages referenced by a process in the past Ξ time units. The OS allocates at least |W(t, Ξ)| frames to each process. If total demand exceeds physical RAM, some processes are suspended (swapped out) rather than allowing all to thrash. This keeps the system in a productive, non-thrashing state.
IncorrectD: A memory management strategy that tracks the set of pages a process is actively using over a specific time window, helping the OS prevent thrashing by allocating enough frames to cover this set
Denning's Working Set Model defines W(t, Ξ) as the set of pages referenced by a process in the past Ξ time units. The OS allocates at least |W(t, Ξ)| frames to each process. If total demand exceeds physical RAM, some processes are suspended (swapped out) rather than allowing all to thrash. This keeps the system in a productive, non-thrashing state.
11How does the LRU (Least Recently Used) page replacement algorithm make decisions?
CorrectC: It replaces the page that has not been accessed for the longest period of time, based on the assumption that pages used heavily in the past will likely be used again soon
LRU exploits temporal locality β pages recently accessed are likely to be needed again soon. It evicts the page with the largest time since last use. LRU is optimal among practical algorithms and does not suffer BΓ©lΓ‘dy's Anomaly. True hardware LRU is expensive; approximations like the Clock Algorithm (second-chance) are used in real systems.
IncorrectC: It replaces the page that has not been accessed for the longest period of time, based on the assumption that pages used heavily in the past will likely be used again soon
LRU exploits temporal locality β pages recently accessed are likely to be needed again soon. It evicts the page with the largest time since last use. LRU is optimal among practical algorithms and does not suffer BΓ©lΓ‘dy's Anomaly. True hardware LRU is expensive; approximations like the Clock Algorithm (second-chance) are used in real systems.
12What is the role of an "Interrupt Vector Table"?
CorrectA: A data structure located in lower memory that holds the memory addresses (pointers) of specific Interrupt Service Routines (ISRs), allowing the CPU to quickly context switch and handle specific hardware or software interrupts
The IVT (or IDT on x86-64) is an array indexed by interrupt number. Each entry holds the address of the corresponding ISR. When an interrupt fires, the CPU saves its state, looks up the ISR address in the IVT for that interrupt number, and jumps to it. This enables deterministic, O(1) dispatch to the correct handler for each of up to 256 interrupt types.
IncorrectA: A data structure located in lower memory that holds the memory addresses (pointers) of specific Interrupt Service Routines (ISRs), allowing the CPU to quickly context switch and handle specific hardware or software interrupts
The IVT (or IDT on x86-64) is an array indexed by interrupt number. Each entry holds the address of the corresponding ISR. When an interrupt fires, the CPU saves its state, looks up the ISR address in the IVT for that interrupt number, and jumps to it. This enables deterministic, O(1) dispatch to the correct handler for each of up to 256 interrupt types.
13How does the Completely Fair Scheduler (CFS) operate in modern Linux kernels?
CorrectB: It utilizes a red-black tree data structure to track the "virtual runtime" of processes, consistently picking the task with the lowest virtual runtime to ensure an equitable distribution of CPU power
Linux CFS (introduced in 2.6.23) tracks "virtual runtime" (vruntime) β effectively the CPU time a process has consumed, weighted by its nice value. All runnable tasks are stored in a red-black tree sorted by vruntime. The scheduler always picks the leftmost node (lowest vruntime). This provides O(log N) scheduling and guarantees mathematically fair CPU distribution.
IncorrectB: It utilizes a red-black tree data structure to track the "virtual runtime" of processes, consistently picking the task with the lowest virtual runtime to ensure an equitable distribution of CPU power
Linux CFS (introduced in 2.6.23) tracks "virtual runtime" (vruntime) β effectively the CPU time a process has consumed, weighted by its nice value. All runnable tasks are stored in a red-black tree sorted by vruntime. The scheduler always picks the leftmost node (lowest vruntime). This provides O(log N) scheduling and guarantees mathematically fair CPU distribution.
14What is a "Spurious Interrupt"?
CorrectC: A hardware interrupt generated by electrical noise or a glitching device, where the CPU is signaled but no valid device is actually requesting service when the OS polls the bus
A spurious interrupt is a phantom interrupt caused by hardware noise, bus glitches, or certain 8259 PIC chip behaviors during edge-triggered interrupt handling. When the OS's ISR polls to identify the requesting device, no device acknowledges. The handler must silently acknowledge and discard it to prevent an interrupt storm or system hang.
IncorrectC: A hardware interrupt generated by electrical noise or a glitching device, where the CPU is signaled but no valid device is actually requesting service when the OS polls the bus
A spurious interrupt is a phantom interrupt caused by hardware noise, bus glitches, or certain 8259 PIC chip behaviors during edge-triggered interrupt handling. When the OS's ISR polls to identify the requesting device, no device acknowledges. The handler must silently acknowledge and discard it to prevent an interrupt storm or system hang.
15What does "Memory-Mapped I/O" allow an operating system to do?
CorrectA: A technique where device registers and I/O buffers are mapped directly into the same physical address space as standard main memory, allowing the CPU to interact with peripherals using standard memory read/write instructions
In memory-mapped I/O (MMIO), device registers occupy ranges in the normal address space. The CPU accesses them with ordinary load/store instructions β no special I/O instructions needed. This simplifies driver code, allows C code to directly manipulate device registers, and is the dominant I/O architecture in modern systems (as opposed to the legacy Port-mapped I/O of x86 IN/OUT instructions).
IncorrectA: A technique where device registers and I/O buffers are mapped directly into the same physical address space as standard main memory, allowing the CPU to interact with peripherals using standard memory read/write instructions
In memory-mapped I/O (MMIO), device registers occupy ranges in the normal address space. The CPU accesses them with ordinary load/store instructions β no special I/O instructions needed. This simplifies driver code, allows C code to directly manipulate device registers, and is the dominant I/O architecture in modern systems (as opposed to the legacy Port-mapped I/O of x86 IN/OUT instructions).
16How does the "Copy-on-Write" (CoW) technique optimize process creation (like the `fork()` system call)?
CorrectD: An optimization technique where parent and child processes initially share the exact same memory pages; a separate physical copy of a page is only created when one of the processes attempts to modify it
CoW makes fork() nearly instantaneous: instead of duplicating gigabytes of memory, the kernel marks all parent pages as read-only and shares them. The first write to any shared page triggers a protection fault; the kernel then creates a private copy of just that page for the writing process. Pages never written stay shared forever, saving both time and RAM.
IncorrectD: An optimization technique where parent and child processes initially share the exact same memory pages; a separate physical copy of a page is only created when one of the processes attempts to modify it
CoW makes fork() nearly instantaneous: instead of duplicating gigabytes of memory, the kernel marks all parent pages as read-only and shares them. The first write to any shared page triggers a protection fault; the kernel then creates a private copy of just that page for the writing process. Pages never written stay shared forever, saving both time and RAM.
17What is the operational difference between a "Spinlock" and a standard Mutex?
CorrectD: A spinlock causes a thread to continuously execute a loop (busy-waiting) to check if the lock is available, whereas a mutex typically puts the waiting thread to sleep, yielding the CPU
A spinlock burns CPU cycles continuously polling the lock bit β wasteful if the critical section is long, but eliminates sleep/wake overhead. A mutex causes a blocked thread to be descheduled (context switch overhead, ~1β2 Β΅s). Spinlocks are preferred in kernel code and SMP scenarios where the critical section is shorter than a context switch and the lock holder is running on another core.
IncorrectD: A spinlock causes a thread to continuously execute a loop (busy-waiting) to check if the lock is available, whereas a mutex typically puts the waiting thread to sleep, yielding the CPU
A spinlock burns CPU cycles continuously polling the lock bit β wasteful if the critical section is long, but eliminates sleep/wake overhead. A mutex causes a blocked thread to be descheduled (context switch overhead, ~1β2 Β΅s). Spinlocks are preferred in kernel code and SMP scenarios where the critical section is shorter than a context switch and the lock holder is running on another core.
18What does NUMA (Non-Uniform Memory Access) refer to in hardware architecture managed by an OS?
CorrectA: A multiprocessor architecture where a specific CPU has faster access to its own local memory node than to memory nodes attached to other CPUs, creating variable memory access times
In a NUMA system (common in multi-socket servers), each CPU socket has local RAM it can access in ~50 ns, while accessing another socket's RAM takes ~100β200 ns. NUMA-aware schedulers (like Linux's) try to keep threads on the NUMA node containing their data. Ignoring NUMA topology can cause severe performance degradation on large servers.
IncorrectA: A multiprocessor architecture where a specific CPU has faster access to its own local memory node than to memory nodes attached to other CPUs, creating variable memory access times
In a NUMA system (common in multi-socket servers), each CPU socket has local RAM it can access in ~50 ns, while accessing another socket's RAM takes ~100β200 ns. NUMA-aware schedulers (like Linux's) try to keep threads on the NUMA node containing their data. Ignoring NUMA topology can cause severe performance degradation on large servers.
19What advantage does journaling provide in file systems like ext4 or NTFS?
CorrectB: It maintains a specialized log (journal) of impending file system changes before they are committed to the main disk structure, allowing for rapid and reliable recovery in the event of a sudden power loss or crash
A journaling file system writes a transaction record (journal entry) to a dedicated circular log before applying changes to the main file system. If power is lost mid-write, the OS replays or rolls back the journal on next mount β recovering in seconds rather than running a full fsck that could take hours on large volumes. ext4, NTFS, HFS+, and XFS all use journaling.
IncorrectB: It maintains a specialized log (journal) of impending file system changes before they are committed to the main disk structure, allowing for rapid and reliable recovery in the event of a sudden power loss or crash
A journaling file system writes a transaction record (journal entry) to a dedicated circular log before applying changes to the main file system. If power is lost mid-write, the OS replays or rolls back the journal on next mount β recovering in seconds rather than running a full fsck that could take hours on large volumes. ext4, NTFS, HFS+, and XFS all use journaling.
20What is a "Hypervisor" (Virtual Machine Monitor)?
CorrectC: A critical layer of software, firmware, or hardware that creates, runs, and manages virtual machines by abstracting and distributing the host's physical hardware resources among them
A Type-1 (bare-metal) hypervisor (VMware ESXi, Microsoft Hyper-V, Xen) runs directly on hardware, hosting guest OSes. A Type-2 (hosted) hypervisor (VirtualBox, VMware Workstation) runs on top of a host OS. Hardware virtualization extensions (Intel VT-x, AMD-V) allow hypervisors to run guest VMs with near-native performance by trapping privileged instructions.
IncorrectC: A critical layer of software, firmware, or hardware that creates, runs, and manages virtual machines by abstracting and distributing the host's physical hardware resources among them
A Type-1 (bare-metal) hypervisor (VMware ESXi, Microsoft Hyper-V, Xen) runs directly on hardware, hosting guest OSes. A Type-2 (hosted) hypervisor (VirtualBox, VMware Workstation) runs on top of a host OS. Hardware virtualization extensions (Intel VT-x, AMD-V) allow hypervisors to run guest VMs with near-native performance by trapping privileged instructions.
Conclusion: Mastering Operating Systems
These 60 MCQs cover the full breadth of Operating Systems β from foundational kernel architecture and process lifecycle through CPU scheduling algorithms, virtual memory management, and advanced concurrency primitives. Completing them gives you a structured, testable command of every OS topic examiners and interviewers probe.
The key to mastering OS questions is building a mental model: Kernel = hardware manager, Process = program in execution, Virtual Memory = illusion of infinite RAM, Deadlock = circular wait. Once these mental models are internalised, scenario-based questions become predictable rather than guesswork.
After completing this MCQ set, deepen your knowledge with the full Introduction to OS Theory Notes and practice with System Calls MCQs to see these kernel concepts applied at the syscall interface level.
π Key Takeaways β Introduction to Operating Systems
- The OS acts as the intermediary between user and hardware β managing CPU, memory, I/O, and file systems via a privileged kernel mode.
- Dual-mode protection (user mode / kernel mode) is hardware-enforced β the CPU traps any user-mode attempt to execute privileged instructions.
- Virtual memory allows programs to exceed physical RAM size via demand paging β only referenced pages are loaded; the rest stay on the swap partition.
- Round Robin guarantees fair CPU allocation; SJF minimizes average waiting time but requires knowing the next CPU burst length in advance.
- All four Coffman conditions must hold simultaneously for deadlock: Mutual Exclusion, Hold & Wait, No Preemption, and Circular Wait.
- The TLB is a hardware cache in the MMU that stores recent virtualβphysical address mappings β a TLB hit requires zero extra memory accesses.
- Copy-on-Write makes fork() near-instant β pages are shared until a write occurs, at which point only the modified page is copied.
- Linux CFS uses a red-black tree sorted by virtual runtime β the leftmost node (least CPU time consumed) always runs next, guaranteeing fairness.
Quick Review & Summary
Use this reference table to consolidate the most-tested OS concepts before or after attempting the questions above.
| Concept | What It Means | Real-World Example |
|---|---|---|
| Kernel | Core OS component permanently resident in RAM; directly controls hardware | Linux kernel managing CPU scheduling and memory allocation |
| Process vs. Program | A program is static code on disk; a process is that code actively executing with its own PCB and resources | Chrome.exe on disk vs. a running Chrome browser tab |
| Context Switch | Saving outgoing process state (PC, registers) and restoring incoming process state | OS timer interrupt preempting a video encoder to schedule a user keystroke |
| Virtual Memory | Illusion of large address space via demand paging + disk swap | Windows pagefile.sys extending effective RAM |
| TLB | Hardware cache of recent virtualβphysical address translations in the MMU | ~96% of memory accesses served from TLB with no page-table walk |
| Deadlock | Circular wait where each process holds a resource and waits for one held by another | P1 holds mutex A, wants B; P2 holds mutex B, wants A |
| Semaphore | Integer counter controlling access to N identical shared resources | Limiting a connection pool to 10 concurrent database connections |
| Demand Paging | Pages loaded into RAM only when first referenced β none pre-loaded at process start | Linux memory-mapped file opened instantly; pages faulted in on first read |
| Belady's Anomaly | FIFO page replacement: adding more frames can increase page faults | Classic 3-frame vs. 4-frame FIFO example with reference string 1,2,3,4,1,2,5 |
| Hypervisor | Software layer that creates and manages VMs, abstracting physical hardware | VMware ESXi (Type-1) running 50 guest OSes on a single server |
Frequently Asked Questions
Q. How many Operating Systems MCQs are available on this page?
Q. What topics are covered in these OS MCQs?
Q. Are these MCQs suitable for GATE CS and university exams?
Q. What is the difference between Study Mode and Exam Mode?
Q. What is the difference between a monolithic kernel and a microkernel?
Q. What is dual-mode operation in operating systems?
Struggling with some questions? Re-read the full Theory Guide: Introduction to Operating Systems