AI-assisted, automatically checked• Updated August 2026

Operating Systems MCQs

Operating Systems MCQs on CPU scheduling, memory management, paging, segmentation, deadlocks, and virtual memory.

47 MCQsComputer ScienceAll Levels
Key Concept Overview & Exam Context

Review core principles of Operating Systems before answering questions. These questions simulate placement technical assessments (TCS, Infosys, Amazon), university exams (CS/IT), and technical certifications.

Target Readiness
Placements & Job Interviews
Question Format
Multiple-Choice with Explanations
Explained Solutions
Written explanations

Operating Systems Practice Test

10 questions · Interactive timed test · Instant score & review

Operating Systems MCQ Questions

Page 1 of 1 (47 total)
Q1

What is the main difference between a process and a thread?

medium
View Answer & Explanation
Correct Answer: A process has its own memory space, while threads within the same process share memory
Explanation:
Each process gets its own isolated address space, while threads that belong to the same process share that memory space, which makes communication between threads faster but also introduces the risk of race conditions.
Q2

Which CPU scheduling algorithm can lead to starvation of longer processes?

hard
View Answer & Explanation
Correct Answer: Priority scheduling without aging
Explanation:
In priority scheduling, a low-priority process can wait indefinitely if higher-priority processes keep arriving. Aging is a technique used to gradually increase the priority of waiting processes to prevent this.
Q3

What is a race condition?

medium
View Answer & Explanation
Correct Answer: A situation where the outcome of a program depends on the unpredictable timing of concurrent operations accessing shared data
Explanation:
Race conditions typically occur when multiple threads or processes access shared data without proper synchronization, and the final result can differ depending on the exact order in which operations happen to execute.
Q4

What is the purpose of a semaphore in operating systems?

medium
View Answer & Explanation
Correct Answer: To control access to a shared resource by multiple processes or threads using a counter
Explanation:
A semaphore uses an internal counter along with wait and signal operations to coordinate access to a limited resource, preventing too many processes from using it simultaneously.
Q5

What is virtual memory?

medium
View Answer & Explanation
Correct Answer: A memory management technique that gives processes the illusion of a large, continuous address space by using disk storage as an extension of RAM
Explanation:
Virtual memory lets a system run programs that need more memory than is physically available by swapping pages between RAM and disk, using techniques like paging.
Q6

What is thrashing in the context of operating systems?

hard
View Answer & Explanation
Correct Answer: A state where the system spends more time swapping pages in and out of memory than executing actual processes
Explanation:
Thrashing typically happens when too many processes are competing for too little physical memory, causing constant page faults and a sharp drop in overall system performance.
Q7

What is the purpose of the Banker's Algorithm?

hard
View Answer & Explanation
Correct Answer: To avoid deadlock by only granting resource requests that leave the system in a safe state
Explanation:
The Banker's Algorithm simulates resource allocation before actually granting it, checking whether the system would still be able to satisfy all processes eventually, and only proceeds if the answer is yes.
Q8

What distinguishes preemptive scheduling from non-preemptive scheduling?

medium
View Answer & Explanation
Correct Answer: Preemptive scheduling can interrupt a running process to give the CPU to another process, while non-preemptive scheduling cannot
Explanation:
Under preemptive scheduling, the operating system can forcibly take the CPU away from a running process, typically to give priority to a more urgent task, while non-preemptive scheduling waits for the current process to finish or voluntarily yield.
Q9

What is a page fault?

medium
View Answer & Explanation
Correct Answer: An event that occurs when a program accesses a page that is not currently loaded in physical memory
Explanation:
When a page fault occurs, the operating system pauses the process and loads the required page from disk into RAM before letting execution continue, which is normal behavior in a virtual memory system rather than necessarily an error.
Q10

What is the primary purpose of a context switch?

medium
View Answer & Explanation
Correct Answer: To save the state of a currently running process and load the state of another process so the CPU can switch between them
Explanation:
Context switching allows a single CPU to give the appearance of running multiple processes simultaneously by rapidly saving and restoring process states, though the switch itself carries some performance overhead.
Q11

What is the difference between a mutex and a semaphore?

hard
View Answer & Explanation
Correct Answer: A mutex allows only one thread to access a resource at a time, while a semaphore can allow a fixed number of threads based on its count
Explanation:
A mutex is essentially a binary lock with ownership tied to the thread that acquired it, whereas a counting semaphore can permit several threads to access a resource simultaneously, up to a set limit.
Q12

What is the role of the kernel in an operating system?

easy
View Answer & Explanation
Correct Answer: It is the core component that manages hardware resources and provides essential services to other parts of the system
Explanation:
The kernel operates in a privileged mode and handles tasks like process scheduling, memory management, and device communication, acting as the bridge between hardware and the software running on top of it.
Q13

Which disk scheduling algorithm selects the request closest to the current head position?

hard
View Answer & Explanation
Correct Answer: Shortest Seek Time First (SSTF)
Explanation:
SSTF reduces average seek time by always choosing the pending request nearest to the disk head's current position, though this can cause starvation for requests that are physically far away.
Q14

What is the purpose of an interrupt in operating systems?

medium
View Answer & Explanation
Correct Answer: To signal the CPU that an event requiring immediate attention has occurred, pausing the current task temporarily
Explanation:
Interrupts can come from hardware, such as a keyboard press, or software, and they let the CPU respond quickly to events without constantly polling every device for changes.
Q15

What is the difference between internal and external fragmentation?

hard
View Answer & Explanation
Correct Answer: Internal fragmentation wastes space within an allocated block, while external fragmentation wastes space between allocated blocks
Explanation:
Internal fragmentation happens when a fixed sized block is larger than what is actually needed, leaving unused space inside it, while external fragmentation happens when free memory is scattered in small chunks that are individually too small to satisfy new requests.
Q16

What is the main advantage of multithreading within a single process?

medium
View Answer & Explanation
Correct Answer: Threads can share memory and resources, making communication between them faster than between separate processes
Explanation:
Because threads within a process share the same address space, passing data between them avoids the overhead of inter-process communication mechanisms that separate processes would need to use.
Q17

What is the function of a device driver in an operating system?

easy
View Answer & Explanation
Correct Answer: It acts as a translator between the operating system and a specific piece of hardware
Explanation:
A device driver exposes a standard interface to the operating system while internally handling the specific commands and quirks of the actual hardware device it controls.
Q18

What does it mean for an operating system to be 'multitasking'?

easy
View Answer & Explanation
Correct Answer: It can execute multiple processes concurrently by rapidly switching the CPU between them
Explanation:
On a system with a single CPU core, multitasking is achieved through fast context switching, which creates the illusion that several programs are running at the same time even though only one is executing at any given instant.
Q19

What is the primary difference between paging and segmentation as memory management techniques?

hard
View Answer & Explanation
Correct Answer: Paging divides memory into fixed size blocks, while segmentation divides memory into variable sized logical units
Explanation:
Paging splits memory into equal sized pages regardless of what they contain, which avoids external fragmentation, while segmentation splits memory based on logical program units like functions or arrays, which can vary in size and cause external fragmentation.
Q20

What happens during a system call?

medium
View Answer & Explanation
Correct Answer: A user program requests a service from the operating system kernel, such as reading a file
Explanation:
System calls provide the controlled interface through which user level programs can access privileged operations like file I/O or process creation, since they cannot access hardware directly.
Q21

What is the purpose of a process control block (PCB) in an operating system?

medium
View Answer & Explanation
Correct Answer: It stores all the information needed to manage a process, such as its state, program counter, and register values
Explanation:
The PCB acts like an identity card for a process, letting the operating system save its context during a switch and restore it later exactly where it left off.
Q22

What is the difference between a long term scheduler and a short term scheduler?

hard
View Answer & Explanation
Correct Answer: The long term scheduler decides which jobs enter the system, while the short term scheduler decides which ready process runs next on the CPU
Explanation:
The long term scheduler controls the degree of multiprogramming by admitting new processes, while the short term scheduler, also called the CPU scheduler, runs very frequently to pick the next process from the ready queue.
Q23

What is a zombie process?

hard
View Answer & Explanation
Correct Answer: A process that has finished execution but still has an entry in the process table because its exit status has not been read by its parent
Explanation:
Once the parent process reads the exit status using a system call like wait, the zombie entry is finally cleaned up and removed from the process table.
Q24

What does the term 'starvation' mean in the context of process scheduling?

medium
View Answer & Explanation
Correct Answer: A situation where a process waits indefinitely because higher priority processes keep getting selected first
Explanation:
Aging is a common technique used to prevent starvation, where the priority of a waiting process is gradually increased the longer it waits, eventually letting it run.
Q25

What is the purpose of the Least Recently Used (LRU) page replacement algorithm?

medium
View Answer & Explanation
Correct Answer: It replaces the page that has not been used for the longest period of time when a new page needs to be loaded
Explanation:
LRU is based on the idea that pages used recently are likely to be used again soon, so it tries to keep those in memory while evicting pages that have been idle the longest.
Q26

What is the main purpose of spooling in an operating system?

medium
View Answer & Explanation
Correct Answer: It allows a slower device, such as a printer, to be used by multiple processes by temporarily storing data on disk until the device is ready
Explanation:
Spooling lets a fast process hand off output to a queue on disk instead of waiting on a slow device directly, so the process can continue with other work.
Q27

What is the difference between a hard real time system and a soft real time system?

hard
View Answer & Explanation
Correct Answer: A hard real time system must meet its deadlines without exception, while a soft real time system tolerates occasional missed deadlines
Explanation:
Missing a deadline in a hard real time system, like an aircraft control system, can be catastrophic, while a soft real time system, like video streaming, might just show a brief glitch.
Q28

What is the purpose of a swap space on disk?

medium
View Answer & Explanation
Correct Answer: It temporarily holds pages or processes moved out of main memory when RAM is full
Explanation:
When physical memory is under pressure, the operating system can move less active pages to swap space, freeing up RAM for processes that need it right now.
Q29

What is the belady's anomaly in page replacement algorithms?

hard
View Answer & Explanation
Correct Answer: A situation where increasing the number of page frames results in more page faults instead of fewer
Explanation:
This counterintuitive behavior can occur with the FIFO page replacement algorithm, and it is one reason FIFO is generally considered less effective than algorithms like LRU.
Q30

What is the purpose of an operating system's shell?

easy
View Answer & Explanation
Correct Answer: It provides an interface, either command line or graphical, that lets users interact with the operating system
Explanation:
The shell interprets commands typed by the user or clicks made through a GUI and translates them into system calls the kernel can act on.
Q31

What is the main difference between a monolithic kernel and a microkernel?

hard
View Answer & Explanation
Correct Answer: A monolithic kernel runs most operating system services in a single large kernel space, while a microkernel keeps the kernel minimal and runs services in user space
Explanation:
Because a microkernel keeps less code running with full privileges, it can be more stable and secure, though communication between separated services can add some overhead.
Q32

What is the purpose of the fork() system call in Unix-like operating systems?

medium
View Answer & Explanation
Correct Answer: It creates a new child process that is a copy of the calling parent process
Explanation:
After fork(), both the parent and the newly created child continue executing from the same point in the code, and the return value of fork() is used to tell them apart.
Q33

What is the difference between paging and swapping?

medium
View Answer & Explanation
Correct Answer: Paging moves individual fixed-size blocks of memory, while swapping moves an entire process in or out of memory
Explanation:
Swapping an entire process can be slow and disruptive, which is one reason modern systems favor paging, moving only the parts of a process that are actually needed at a given time.
Q34

What is the purpose of the Round Robin CPU scheduling algorithm?

medium
View Answer & Explanation
Correct Answer: It gives each process a fixed time slice to run before moving to the next process in a cyclic order
Explanation:
Round Robin is designed for time sharing systems since it ensures every process gets a fair turn on the CPU, though performance depends heavily on choosing an appropriate time slice.
Q35

What is a critical section in operating systems?

medium
View Answer & Explanation
Correct Answer: A part of a program where shared resources are accessed and only one process or thread should execute at a time
Explanation:
Protecting the critical section with mechanisms like mutexes or semaphores prevents race conditions when multiple processes or threads try to access shared data at the same time.
Q36

What is the purpose of the exec() system call in Unix-like systems?

hard
View Answer & Explanation
Correct Answer: It replaces the current process's memory image with a new program
Explanation:
Unlike fork(), which creates a copy of the current process, exec() loads a different program into the existing process, which is why the two are often used together to run new programs.
Q37

What is the purpose of a bootloader in the startup process of a computer?

easy
View Answer & Explanation
Correct Answer: It loads the operating system kernel into memory and hands over control to it
Explanation:
The bootloader runs very early, right after the system firmware, and its job is limited to finding and starting the actual operating system kernel from disk.
Q38

What is the purpose of the Shortest Job First (SJF) scheduling algorithm?

medium
View Answer & Explanation
Correct Answer: It selects the process with the smallest estimated execution time to run next
Explanation:
SJF minimizes average waiting time in theory, but it requires knowing or estimating how long each process will run in advance, which is not always practical.
Q39

What is a livelock, and how does it differ from a deadlock?

hard
View Answer & Explanation
Correct Answer: In a livelock, processes keep changing state in response to each other without making real progress, while in a deadlock processes are completely stuck and unable to change state at all
Explanation:
A common example of livelock is two people repeatedly stepping aside for each other in a hallway, both moving but never actually passing through.
Q40

What is the purpose of memory protection in an operating system?

medium
View Answer & Explanation
Correct Answer: It prevents one process from accessing or modifying the memory belonging to another process
Explanation:
Memory protection is typically enforced with hardware support, such as base and limit registers or page tables, so a faulty or malicious process cannot corrupt another process's data.
Q41

What is the purpose of a file allocation table (FAT) in a file system?

medium
View Answer & Explanation
Correct Answer: It keeps track of which disk blocks belong to each file and where the next block of that file is located
Explanation:
The FAT essentially forms a linked list of blocks for each file, letting the operating system find where a file continues on disk even if it is stored in scattered, non-contiguous blocks.
Q42

What is the difference between a user level thread and a kernel level thread?

hard
View Answer & Explanation
Correct Answer: A user level thread is managed by a library in user space without kernel awareness, while a kernel level thread is managed and scheduled directly by the operating system
Explanation:
Because the kernel does not know about user level threads, if one blocks on a system call, it can end up blocking the entire process, which is a key trade-off compared to kernel level threads.
Q43

What is the purpose of the operating system's I/O scheduler for disk requests?

medium
View Answer & Explanation
Correct Answer: It decides the order in which pending disk read and write requests are serviced to improve efficiency
Explanation:
Algorithms like SCAN or C-SCAN are used by the I/O scheduler to reduce the total movement of the disk head, which cuts down on seek time across many requests.
Q44

What is meant by 'demand paging' in virtual memory management?

medium
View Answer & Explanation
Correct Answer: Pages are loaded into memory only when they are actually referenced by a running process, rather than all at once
Explanation:
This lazy loading approach saves memory since parts of a program that are never actually used during execution are never loaded at all.
Q45

What is the purpose of the operating system's 'nice' value for a process in Unix-like systems?

hard
View Answer & Explanation
Correct Answer: It adjusts the scheduling priority of a process, with higher values generally giving it lower priority
Explanation:
A process with a higher nice value is being more considerate to other processes by asking for a lower share of CPU time, which is where the somewhat playful name comes from.
Q46

Which condition is NOT one of Coffman’s four necessary conditions for deadlock to occur?

medium
View Answer & Explanation
Correct Answer: Preemption enabled
Explanation:
Preemption breaks deadlock. The 4 Coffman conditions are: Mutual Exclusion, Hold and Wait, No Preemption, and Circular Wait.
Q47

Which of the following is NOT one of Coffman’s four necessary conditions for deadlock to occur?

hard
View Answer & Explanation
Correct Answer: Preemption Allowed
Explanation:
Preemption breaks deadlock. The four Coffman conditions are Mutual Exclusion, Hold and Wait, No Preemption, and Circular Wait.