Operating System MCQ (Multiple Choice Questions and Answers)

31. What is the kernel in an operating system?

  1. A user-level application that manages graphical interfaces
  2. The core component of an operating system that has complete control over the system, managing hardware resources, memory, processes, and system calls between hardware and software
  3. A secondary storage management program that runs on demand
  4. The user interface component of an operating system

Answer : B
Explanation: The kernel is the heart of the operating system — it runs with the highest privileges and directly interacts with hardware. It manages: Process Management (creating, scheduling, terminating processes), Memory Management (allocating and deallocating memory), Device Management (communicating with hardware devices through drivers), File System Management, and System Calls (providing an interface for user programs to request OS services). Types of kernels include: Monolithic Kernel (all OS services in one large kernel — Linux), Microkernel (minimal kernel with services in user space — Minix), and Hybrid Kernel (combination — Windows, macOS).

32. What is the difference between a process and a thread in an operating system?

  1. A process is faster than a thread; a thread uses more memory than a process
  2. A process is an independent program in execution with its own memory space; a thread is a lightweight unit of execution within a process that shares the process’s memory and resources
  3. Threads are used only in multi-core systems; processes work on single-core systems
  4. A process and a thread are identical — both terms describe the same concept

Answer : B
Explanation: A Process is an independent program in execution with its own address space, code, data, heap, and stack. Creating a process is expensive — it requires allocating separate memory. A Thread is a lightweight unit of execution within a process — multiple threads share the same process address space (code, data, heap) but each has its own stack and registers. Threads are faster to create and switch between than processes. Context switching between threads is cheaper than between processes. Threads within the same process can communicate easily through shared memory. This makes multithreaded programs more efficient for concurrent tasks.

33. What are the different states of a process in an operating system?

  1. Start, Run, Pause, and End
  2. New, Ready, Running, Waiting (Blocked), and Terminated — representing the full lifecycle of a process from creation to completion
  3. Created, Active, Idle, and Destroyed
  4. Loading, Executing, Waiting, and Unloading

Answer : B
Explanation: The five process states: New (process is being created), Ready (process is loaded in memory, waiting for CPU assignment), Running (process is currently executing on the CPU), Waiting/Blocked (process is waiting for an I/O operation or event to complete — not using the CPU), and Terminated (process has finished execution). Transitions: New → Ready (admitted), Ready → Running (CPU assigned by scheduler), Running → Ready (preempted/time slice expired), Running → Waiting (I/O request), Waiting → Ready (I/O completion), Running → Terminated (process exits). Understanding these states and transitions is a core OS topic tested in GATE and placement exams.

34. What is the difference between preemptive and non-preemptive scheduling?

  1. Preemptive scheduling runs only on multi-core processors; non-preemptive runs on single-core
  2. In preemptive scheduling, the OS can forcibly take the CPU away from a running process; in non-preemptive scheduling, a process runs until it voluntarily releases the CPU
  3. Non-preemptive scheduling is faster than preemptive for all workloads
  4. Preemptive scheduling gives priority to longer processes; non-preemptive favors shorter ones

Answer : B
Explanation: Preemptive Scheduling allows the OS to interrupt a running process and assign the CPU to another process — typically because a higher-priority process arrived or the time quantum expired. Examples: Round Robin, Priority Scheduling (preemptive), SRTF (Shortest Remaining Time First). It is used in time-sharing systems and ensures no process monopolizes the CPU. Non-Preemptive Scheduling lets a process run until it voluntarily releases the CPU (by completing or blocking for I/O). Examples: FCFS, SJF (non-preemptive), Priority (non-preemptive). It is simpler but can cause long waiting times (convoy effect in FCFS).

35. What is Round Robin (RR) scheduling in operating systems?

  1. A scheduling algorithm that allocates CPU in order of process arrival time only
  2. A preemptive CPU scheduling algorithm that assigns each process a fixed time quantum in circular order, cycling through all processes until they complete
  3. A priority-based scheduling algorithm that rotates between high-priority processes only
  4. A disk scheduling algorithm that services requests in a round pattern

Answer : B
Explanation: Round Robin (RR) is the most widely used preemptive scheduling algorithm designed for time-sharing systems. Each process gets a fixed time slot (time quantum, typically 10-100 milliseconds). After its quantum expires, the process is preempted and moved to the back of the ready queue. The CPU is then assigned to the next process. Performance depends heavily on time quantum size: too small = too many context switches (high overhead); too large = degenerates to FCFS. RR provides fairness (no starvation) and good response time for interactive systems. It is the default scheduling algorithm in most general-purpose operating systems.

36. What is the Shortest Job First (SJF) scheduling algorithm?

  1. A scheduling algorithm that selects the process with the longest burst time first
  2. A CPU scheduling algorithm that selects the process with the smallest CPU burst time next — minimizing average waiting time but requires knowledge of burst times in advance
  3. A real-time scheduling algorithm that prioritizes jobs with the shortest deadline
  4. A disk scheduling algorithm that serves the shortest seek distance request first

Answer : B
Explanation: SJF (Shortest Job First) selects the process with the minimum CPU burst time from the ready queue. It is provably optimal for minimizing average waiting time among all non-preemptive algorithms. Two variants: Non-preemptive SJF (once CPU assigned, process runs to completion), Preemptive SJF — called SRTF (Shortest Remaining Time First) — new shorter jobs can preempt the running process. Main problem: requires knowledge of future CPU burst times, which is not practically available. Estimation techniques (exponential averaging) are used to predict burst times. SJF can cause starvation — long processes may wait indefinitely if short processes keep arriving.

37. What is Priority Scheduling in an operating system?

  1. A scheduling algorithm that assigns CPU time based on the order processes arrive
  2. A scheduling algorithm where each process is assigned a priority number and the CPU is allocated to the highest-priority process — lower priority processes may suffer starvation
  3. An algorithm that prioritizes I/O-bound processes over CPU-bound ones automatically
  4. A scheduling method that gives priority only to system processes over user processes

Answer : B
Explanation: Priority Scheduling assigns a priority number to each process (either internal — based on time limits, memory requirements, I/O usage, or external — manually assigned). The CPU is allocated to the highest-priority ready process. Can be preemptive (new higher-priority process preempts current process) or non-preemptive. Major problem: Starvation — low-priority processes may never execute if high-priority processes keep arriving. Solution: Aging — gradually increasing the priority of waiting processes over time. Priority scheduling is used in real-time OS, operating systems kernels (kernel threads get higher priority), and embedded systems where response time for critical tasks matters.

38. What is virtual memory in an operating system?

  1. Memory that is physically installed but not yet activated by the operating system
  2. A memory management technique that allows processes to use more memory than physically available by using disk space as an extension of RAM, with only needed portions kept in physical memory
  3. A separate memory chip installed alongside RAM for high-performance computing
  4. Memory that is shared between multiple users in a time-sharing system

Answer : B
Explanation: Virtual Memory gives each process the illusion of having a large, contiguous address space, while physically only the actively used pages reside in RAM. Inactive pages are stored on disk (swap space/page file). When a process accesses a page not in RAM, a page fault occurs — the OS loads the required page from disk into RAM (possibly swapping out another page). Benefits: allows programs larger than physical RAM to run, enables isolation between processes (each has its own virtual address space), and allows memory sharing. The Memory Management Unit (MMU) translates virtual addresses to physical addresses using page tables.

39. What is paging in an operating system and how does it work?

  1. A technique of dividing memory into variable-sized segments based on logical program divisions
  2. A memory management technique that divides physical memory into fixed-sized frames and logical memory into fixed-sized pages — eliminating external fragmentation by allowing non-contiguous allocation
  3. A process scheduling technique that swaps entire processes to disk
  4. A file management technique that divides files into pages for faster disk access

Answer : B
Explanation: Paging divides: Physical memory into fixed-sized blocks called frames. Logical memory (process address space) into fixed-sized blocks called pages (same size as frames). A page table maps each page to its corresponding frame in physical memory. The CPU generates a logical address consisting of a page number and page offset. The OS translates this using the page table: physical address = frame number × frame size + offset. Paging eliminates external fragmentation (since any free frame can hold any page) but causes internal fragmentation (last page may not be full). TLB (Translation Lookaside Buffer) is a hardware cache that speeds up page table lookups.

40. What is a page fault in operating systems?

  1. An error that occurs when a page table entry is corrupt or missing
  2. An interrupt that occurs when a process tries to access a page that is not currently in physical memory, requiring the OS to load it from disk (swap space)
  3. A critical system error that forces an immediate system restart
  4. An error that occurs when two processes simultaneously access the same memory page

Answer : B
Explanation: A page fault occurs when a process references a page that is marked as not present in the page table (the valid/present bit is 0 — page is on disk). Page fault handling: OS traps (interrupt), saves process state, finds the page on disk, finds a free frame (or selects a victim page to replace), loads the page from disk into the frame, updates the page table, resumes the process. High page fault rate (thrashing) severely degrades performance. Page replacement algorithms (FIFO, LRU, Optimal) decide which page to evict when RAM is full. Demand paging loads pages only when needed, minimizing initial I/O.