Sign Up Sign Up


Have an account? Sign In Now

Sign In Sign In


Forgot Password?

Don't have account, Sign Up Here

Forgot Password Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.


Have an account? Sign In Now

You must login to ask a question.


Forgot Password?

Need An Account, Sign Up Here

You must login to add post.


Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

RTSALL Logo RTSALL Logo
Sign InSign Up

RTSALL

RTSALL Navigation

  • Home
  • Tutorials
    • All Subjects & Branches (90+)
    • C Programming MCQs
    • Python Programming MCQs
    • Data Structures MCQs
    • DBMS & SQL MCQs
    • Computer Networks MCQs
    • Operating Systems MCQs
    • Quantitative Aptitude MCQs
  • Interview
    • Interview Preparation Portal
    • Web API & REST API
    • SQL Server
    • System Design
    • C# (.NET 8/9)
    • ASP.NET MVC & Core
    • DSA (Data Structures)
    • Cyber Security
    • Burp Suite (AppSec)
  • Tools
    • Run Code
    • JSON Beautifier
    • Regex Tester
    • Diff Checker
    • JWT Decoder
    • UUID Generator
    • .htaccess Generator
    • YAML/JSON Converter
    • SQL Formatter
    • Cron Generator
    • JSON to CSV/Excel
    • System Design Estimator
    • Chmod Calculator
    • Duplicate Line Remover
  • DSA
    • All DSA Problems
    • Online C++ Runner
    • Arrays, Strings & Cache
    • Two Pointers & Sliding Window
    • Linked Lists & Custom Allocators
    • Stacks, Queues & Ring Buffers
    • Trees, BSTs & Indexes
    • Tries & Prefix Search
    • Heaps & Priority Schedulers
    • Hashing & Collision Resolution
    • Graphs & Network Topologies
    • Dynamic Programming
    • Advanced Bitmask & Tree DP
    • Greedy & Resource Allocation
    • Binary Search & State Spaces
    • Bit Manipulation & Low-Level
    • System-Scale & Probabilistic
  • AI Utilities
    • Token Counter
    • JSON Schema Compiler
    • Fine-Tuning JSONL Converter
    • Vector RAG Playground
    • Prompt Optimizer & Architect
    • LLM GPU VRAM Calculator
    • .NET AI Roadmap
  • Finance Tools
    • Compound Interest Calculator
    • SIP Calculator
    • Simple Interest Calculator
    • EMI Calculator
    • Present Value (PV) Calculator
    • Compound Interest Calculator
    • Future Value (FV) Calculator
    • NPV Calculator
    • IRR Calculator
    • CAGR Calculator
    • Dividend Income Calculator
    • Yield on Cost Calculator
    • Dividend Payout Ratio
    • WACC Calculator
    • CAPM & Cost of Equity
    • Cost of Debt Calculator
    • DCF Valuation Calculator
    • Enterprise Value Calculator
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Tutorials
    • All Subjects & Branches (90+)
    • C Programming MCQs
    • Python Programming MCQs
    • Data Structures MCQs
    • DBMS & SQL MCQs
    • Computer Networks MCQs
    • Operating Systems MCQs
    • Quantitative Aptitude MCQs
  • Interview
    • Interview Preparation Portal
    • Web API & REST API
    • SQL Server
    • System Design
    • C# (.NET 8/9)
    • ASP.NET MVC & Core
    • DSA (Data Structures)
    • Cyber Security
    • Burp Suite (AppSec)
  • Tools
    • Run Code
    • JSON Beautifier
    • Regex Tester
    • Diff Checker
    • JWT Decoder
    • UUID Generator
    • .htaccess Generator
    • YAML/JSON Converter
    • SQL Formatter
    • Cron Generator
    • JSON to CSV/Excel
    • System Design Estimator
    • Chmod Calculator
    • Duplicate Line Remover
  • DSA
    • All DSA Problems
    • Online C++ Runner
    • Arrays, Strings & Cache
    • Two Pointers & Sliding Window
    • Linked Lists & Custom Allocators
    • Stacks, Queues & Ring Buffers
    • Trees, BSTs & Indexes
    • Tries & Prefix Search
    • Heaps & Priority Schedulers
    • Hashing & Collision Resolution
    • Graphs & Network Topologies
    • Dynamic Programming
    • Advanced Bitmask & Tree DP
    • Greedy & Resource Allocation
    • Binary Search & State Spaces
    • Bit Manipulation & Low-Level
    • System-Scale & Probabilistic
  • AI Utilities
    • Token Counter
    • JSON Schema Compiler
    • Fine-Tuning JSONL Converter
    • Vector RAG Playground
    • Prompt Optimizer & Architect
    • LLM GPU VRAM Calculator
    • .NET AI Roadmap
  • Finance Tools
    • Compound Interest Calculator
    • SIP Calculator
    • Simple Interest Calculator
    • EMI Calculator
    • Present Value (PV) Calculator
    • Compound Interest Calculator
    • Future Value (FV) Calculator
    • NPV Calculator
    • IRR Calculator
    • CAGR Calculator
    • Dividend Income Calculator
    • Yield on Cost Calculator
    • Dividend Payout Ratio
    • WACC Calculator
    • CAPM & Cost of Equity
    • Cost of Debt Calculator
    • DCF Valuation Calculator
    • Enterprise Value Calculator
  • About Us
  • Blog
  • Contact Us
Home/RTSALL Educational Academy: Subject MCQs, Practice Tests & Detailed Explanations/Operating Systems: 5-Chapter Comprehensive Practice & 75 Verified MCQs

Operating Systems: 5-Chapter Comprehensive Practice & 75 Verified MCQs

Home / Learning Platform / Computer Science & IT / Operating Systems & System Architecture MCQs
Computer Science & IT 🟢 75 Verified MCQs • 5 Complete Chapters Active ⭐ Interview & Exam Grade

Operating Systems: 5-Chapter Comprehensive Practice & 75 Verified MCQs

Master Operating Systems & System Architecture with our complete 5-chapter question bank. Each verified MCQ provides four distinct options, verified solution keys, step-by-step technical rationale, and high-yield conceptual rules.

Curriculum Roadmap & Chapters Covered (All Live & Unlocked):
✓ Chapter 1: OS Architecture, System Calls & Process Control Blocks (Q1 – Q15)
✓ Chapter 2: CPU Scheduling (FCFS, SJF, Round Robin & Multilevel Feedback) (Q16 – Q30)
✓ Chapter 3: Process Synchronization, Semaphores, Mutexes & Monitors (Q31 – Q45)
✓ Chapter 4: Deadlocks, Prevention, Avoidance (Banker’s) & Recovery (Q46 – Q60)
✓ Chapter 5: Virtual Memory, Paging, Page Faults, TLB & Replacement Algorithms (Q61 – Q75)
📝 Total Questions: 75 Verified MCQs
📚 Modules: 5 Complete Chapters
⏱️ Est. Practice Time: ~90 minutes
🎯 Target Benchmark: 80% (60/75 Correct)
Select Chapter to Practice:
Interactive Practice Dashboard
Answered: 0 / 75 Correct: 0 Accuracy: 0% Streak: 🔥 0
Currently Displaying: All 75 Questions across Chapters 1 to 5. Click any option for instant evaluation and in-depth explanations.
Curriculum Track • Module 1 of 5
Chapter 1: OS Architecture, System Calls & Process Control Blocks (Q1 – Q15)
Question 1 of 75 Chapter 1
What data structure does the operating system kernel use to store all execution state, program counter, CPU registers, and scheduling metadata for an individual process?
A. Inode Table
B. Process Control Block (PCB)
C. Translation Lookaside Buffer (TLB)
D. Virtual File System (VFS)
✔ Correct Answer: Option B
Detailed Explanation: The Process Control Block (PCB) is the central data structure in the OS kernel representing a process. It maintains the Process ID (PID), process state, program counter, CPU register snapshot, memory management limits, and open file descriptors.
🎯 Key Learning Point: A CPU context switch involves saving the current process’s hardware register state into its PCB and restoring the state of the newly scheduled process from its PCB.
Question 2 of 75 Chapter 1
Which CPU scheduling algorithm is mathematically proven to produce the minimal average waiting time for a given set of stationary processes?
A. First-Come, First-Served (FCFS)
B. Shortest Job First (SJF) / Shortest Remaining Time First (SRTF)
C. Round Robin with large time quantum
D. Priority Scheduling with static weights
✔ Correct Answer: Option B
Detailed Explanation: Shortest Job First (SJF) is provably optimal in terms of minimizing average waiting time because scheduling shorter jobs ahead of long jobs reduces the wait time of all subsequent processes more rapidly than any other order.
🎯 Key Learning Point: The primary practical limitation of SJF in general-purpose operating systems is predicting the exact CPU burst duration of upcoming processes in advance.
Question 3 of 75 Chapter 1
What phenomenon occurs in Round Robin CPU scheduling when the time quantum is chosen to be extremely small (e.g., 1 microsecond)?
A. The system mimics First-Come, First-Served scheduling.
B. Excessive CPU time is wasted on context switching overhead rather than executing useful user instructions.
C. Processes enter permanent starvation.
D. Memory thrashing occurs in swap space.
✔ Correct Answer: Option B
Detailed Explanation: If the Round Robin time slice (quantum) is too small relative to context switch overhead (which takes 1–5 microseconds for register saving, cache invalidation, and TLB flushes), the CPU spends a substantial fraction of its cycles switching between processes rather than performing actual computation.
🎯 Key Learning Point: In production operating systems, the time quantum is typically calibrated so that 80% of CPU bursts finish within a single time slice.
Question 4 of 75 Chapter 1
Which of the following conditions is NOT one of Coffman's four necessary conditions for a deadlock to occur?
A. Mutual Exclusion
B. Hold and Wait
C. Preemption Allowed
D. Circular Wait
✔ Correct Answer: Option C
Detailed Explanation: The four Coffman conditions required for deadlock are: 1) Mutual Exclusion, 2) Hold and Wait, 3) NO Preemption (resources cannot be forcibly confiscated from a process), and 4) Circular Wait. If preemption IS allowed, deadlock is broken.
🎯 Key Learning Point: Preventing deadlock requires invalidating at least one of the four Coffman conditions.
Question 5 of 75 Chapter 1
What is 'Priority Inversion' in concurrent real-time systems, and how is it resolved?
A. High priority processes take over all CPU time; resolved by process termination.
B. A higher-priority process is blocked waiting for a lock held by a lower-priority process, while an intermediate-priority process preempts the lower one; resolved by Priority Inheritance.
C. The OS reverses priority levels every minute; resolved by Round Robin.
D. Low priority threads execute faster due to smaller instruction footprints.
✔ Correct Answer: Option B
Detailed Explanation: Priority Inversion occurred famously on the Mars Pathfinder spacecraft. A low-priority thread acquired a mutex. Before releasing it, a medium-priority thread preempted it. A high-priority thread needing the mutex was indefinitely blocked behind the medium thread. The solution is ‘Priority Inheritance’: the low-priority thread temporarily inherits the high priority until releasing the mutex.
🎯 Key Learning Point: Priority Inheritance prevents intermediate priority tasks from starving critical high-priority real-time threads.
Question 6 of 75 Chapter 1
What are the three mandatory requirements that any valid solution to the Critical Section problem must satisfy?
A. Mutual Exclusion, Progress, and Bounded Waiting
B. Atomicity, Consistency, and Durability
C. Speed, Low Memory, and Encryption
D. Preemption, Aging, and Non-blocking I/O
✔ Correct Answer: Option A
Detailed Explanation: A critical section solution must guarantee: 1) Mutual Exclusion (only one process in the critical section at a time), 2) Progress (if no process is in the critical section, only processes wishing to enter participate in deciding who enters next), and 3) Bounded Waiting (a bound exists on the number of times others can enter after a process requests entry, preventing starvation).
🎯 Key Learning Point: Peterson’s Algorithm satisfies all three requirements for two-process mutual exclusion in software.
Question 7 of 75 Chapter 1
How does a Counting Semaphore initialized to value K differ functionally from a Binary Semaphore (Mutex)?
A. A counting semaphore can only be used by recursive algorithms.
B. A counting semaphore controls access to a finite resource pool containing K identical resource units, allowing up to K concurrent threads.
C. A counting semaphore automatically increments upon every CPU clock tick.
D. Counting semaphores do not block threads.
✔ Correct Answer: Option B
Detailed Explanation: A counting semaphore is initialized with integer value K representing the number of available identical resources. Calling wait() (P) decrements the counter; if the counter drops below 0, the thread blocks. Calling signal() (V) increments the counter and unblocks waiting threads. A binary semaphore is restricted to values 0 and 1.
🎯 Key Learning Point: A binary semaphore enforces strict mutual exclusion (1 thread); a counting semaphore coordinates resource pool allocation (K threads).
Question 8 of 75 Chapter 1
What is the primary role of the Translation Lookaside Buffer (TLB) in virtual memory architectures?
A. It swaps processes between RAM and hard disk during thrashing.
B. It is a high-speed hardware associative cache that stores recent virtual-to-physical page number translations, bypassing multi-level page table lookups in RAM.
C. It calculates parity checksums for ECC memory.
D. It stores kernel system call vectors.
✔ Correct Answer: Option B
Detailed Explanation: Translating virtual addresses to physical frames across multi-level page tables requires multiple memory accesses per instruction. The TLB caches recently accessed page table entries in hardware. A TLB hit resolves the physical frame address in under 1 nanosecond, avoiding multiple memory bus round-trips.
🎯 Key Learning Point: A high TLB hit rate (typically >98%) is critical for near-native virtual memory performance.
Question 9 of 75 Chapter 1
What counter-intuitive anomaly occurs with the First-In, First-Out (FIFO) page replacement algorithm, known as Bélády’s Anomaly?
A. Page faults drop to zero when RAM is full.
B. Allocating MORE physical memory page frames can actually INCREASE the total number of page faults for certain reference strings.
C. The algorithm runs in exponential time on 64-bit systems.
D. Pages are evicted before they are ever read.
✔ Correct Answer: Option B
Detailed Explanation: Bélády’s Anomaly demonstrates that under the FIFO replacement policy, allocating a larger frame allocation (e.g., increasing frames from 3 to 4) can result in an increased number of page faults on specific reference strings. Algorithms belonging to the ‘stack algorithms’ class (such as LRU and Optimal) never suffer from Bélády’s Anomaly.
🎯 Key Learning Point: LRU (Least Recently Used) is immune to Bélády’s Anomaly because the set of pages in an N-frame memory is always a subset of pages in an (N+1)-frame memory.
Question 10 of 75 Chapter 1
What algorithm does an operating system execute to detect whether allocating requested resources will leave the system in a 'Safe State' during Deadlock Avoidance?
A. Dijkstra's Shortest Path Algorithm
B. Banker's Algorithm
C. Tarjan's Strongly Connected Components Algorithm
D. Peterson's Algorithm
✔ Correct Answer: Option B
Detailed Explanation: The Banker’s Algorithm tests resource requests by simulating the allocation of predetermined maximum possible amounts of all resources, checking whether a safe sequence exists where all processes can complete without deadlock. If a safe sequence exists, the allocation is granted; otherwise, the requesting process waits.
🎯 Key Learning Point: A safe state guarantees that deadlock is impossible, but maintaining safe states requires processes to declare maximum resource requirements in advance.
Question 11 of 75 Chapter 1
What is the fundamental difference in execution model between User-Level Threads (ULT) and Kernel-Level Threads (KLT)?
A. User-level threads are executed by the CPU; kernel-level threads are executed by the GPU.
B. User-level threads are managed by a runtime library in user space without kernel awareness (meaning one blocking syscall blocks the entire process); Kernel-level threads are managed directly by the OS scheduler, allowing true multi-core parallelism.
C. Kernel threads cannot perform file I/O.
D. User threads consume more memory than processes.
✔ Correct Answer: Option B
Detailed Explanation: User-level threads are scheduled by a user-space library; thread switching requires no kernel mode transitions, making creation extremely lightweight. However, because the kernel sees only one process, if one user thread issues a blocking I/O call, all threads in that process stall. Kernel-level threads allow the OS to schedule separate threads across multiple physical CPU cores simultaneously.
🎯 Key Learning Point: Modern operating systems implement 1:1 threading models (e.g., Linux NPTL, Windows threads) mapping each user thread directly to a kernel thread.
Question 12 of 75 Chapter 1
What is 'Thrashing' in an operating system virtual memory subsystem?
A. When CPU registers overheat due to floating point calculation loops.
B. A condition where the operating system spends more time paging data in and out of swap space than executing application instructions, causing system throughput to collapse to near zero.
C. Deleting files faster than the hard drive can write.
D. High network bandwidth consumption during DDoS attacks.
✔ Correct Answer: Option B
Detailed Explanation: Thrashing occurs when the sum of the working set sizes of all active processes exceeds the available physical RAM. The OS constantly experiences page faults, repeatedly evicting pages only to immediately demand-page them back in from disk, stalling the CPU on disk I/O.
🎯 Key Learning Point: The OS working-set model prevents thrashing by suspending/swapping out entire processes when total working sets exceed physical memory.
Question 13 of 75 Chapter 1
What hardware CPU instruction provides atomic read-modify-write capability to implement mutual exclusion spinlocks without software race conditions?
A. MOV and JMP
B. Test-and-Set (TSL) or Compare-and-Swap (CAS)
C. NOP and HALT
D. PUSH and POP
✔ Correct Answer: Option B
Detailed Explanation: Hardware atomic instructions like Test-and-Set (TSL) or Compare-and-Swap (CAS) execute an read-modify-write cycle as an indivisible operation at the hardware bus/cache coherency level. This prevents any other CPU core from interleaving an access, providing the foundation for spinlocks and lock-free algorithms.
🎯 Key Learning Point: Compare-and-Swap (CAS) takes an expected old value, a new value, and memory address; it updates only if current value equals expected, returning true/false.
Question 14 of 75 Chapter 1
In Linux and Unix operating systems, what is a 'Zombie Process'?
A. A process running malicious cryptocurrency mining software.
B. A process that has completed execution via exit(), but its entry remains in the process table because its parent has not yet read its exit status via wait() / waitpid().
C. A process running with root privileges in background.
D. An orphaned process that has been re-parented to init (PID 1).
✔ Correct Answer: Option B
Detailed Explanation: When a process terminates, its memory space and open files are released, but its entry in the process table remains with status ‘Z’ so the parent process can read its termination exit code. Until the parent calls wait() or waitpid(), the process remains a zombie. If the parent terminates without waiting, the zombie is adopted by systemd/init (PID 1), which reaps it immediately.
🎯 Key Learning Point: Zombies consume no CPU or RAM, but excessive numbers of zombies can exhaust the finite system PID pool.
Question 15 of 75 Chapter 1
What is the primary difference between Hard Real-Time and Soft Real-Time operating systems?
A. Hard real-time systems run only on server hardware; soft real-time runs on mobile phones.
B. In hard real-time systems, missing a deadline constitutes total system failure; in soft real-time systems, missing a deadline degrades service quality but does not cause catastrophic failure.
C. Soft real-time systems do not use priority schedulers.
D. Hard real-time systems do not support multitasking.
✔ Correct Answer: Option B
Detailed Explanation: Hard real-time systems (e.g., pacemakers, anti-lock brakes, avionics flight controllers) require deterministic guarantees that tasks complete before their deadline, where any missed deadline represents catastrophic failure. Soft real-time systems (e.g., video streaming, gaming, VoIP) strive to meet deadlines, but occasional delays merely cause temporary glitching or frame drops without physical catastrophe.
🎯 Key Learning Point: Hard real-time OSs (e.g., FreeRTOS, VxWorks, QNX) guarantee bounded interrupt latency and bounded context switch timings.
Curriculum Track • Module 2 of 5
Chapter 2: CPU Scheduling (FCFS, SJF, Round Robin & Multilevel Feedback) (Q16 – Q30)
Question 16 of 75 Chapter 2
What is the Convoy Effect in First-Come, First-Served (FCFS) CPU scheduling?
A. Multiple processes executing simultaneously on multi-core processors
B. Short CPU-bound processes and I/O-bound processes are forced to wait for long periods behind a heavy CPU-intensive process, resulting in severe degradation of CPU and device utilization
C. Processes losing priority dynamically
D. Deadlocks caused by circular lock requests
✔ Correct Answer: Option B
Detailed Explanation: In non-preemptive FCFS, when a long CPU-burst process gains the CPU, all subsequent shorter processes (even those needing only 1ms) wait in the ready queue, dragging down average turnaround and response times.
🎯 Key Learning Point: Shortest Job First (SJF) or Round Robin eliminates the convoy effect.
Question 17 of 75 Chapter 2
Why is Shortest Job First (SJF) scheduling provably optimal for minimizing average waiting time, and why is it difficult to implement in general-purpose interactive OS kernels?
A. It requires too much memory to store process names
B. It is mathematically optimal for average wait time, but predicting the exact length of the next CPU burst for arriving processes in advance is impossible
C. SJF cannot be used on multi-core systems
D. SJF causes immediate deadlocks
✔ Correct Answer: Option B
Detailed Explanation: Moving shorter jobs ahead reduces waiting time for subsequent jobs more than it increases waiting time for longer jobs. However, the OS cannot know future burst lengths, resorting to exponential smoothing estimations.
🎯 Key Learning Point: Exponential smoothing formula: τ_(n+1) = α * t_n + (1 – α) * τ_n.
Question 18 of 75 Chapter 2
What happens in Shortest Remaining Time First (SRTF) when a new process arrives with a CPU burst shorter than the remaining burst of the currently running process?
A. The new process is placed at the end of the ready queue
B. The currently running process is preempted and returned to the Ready queue; the new process is allocated the CPU immediately
C. Both processes run in lockstep
D. The operating system kernel panics
✔ Correct Answer: Option B
Detailed Explanation: SRTF is the preemptive variant of SJF. Whenever a process arrives with a remaining burst strictly shorter than that of the active process, the CPU scheduler preempts the executing task.
🎯 Key Learning Point: Preemptive scheduling incurs additional context switch overhead compared to non-preemptive algorithms.
Question 19 of 75 Chapter 2
In Round Robin (RR) scheduling, what is the impact of choosing an excessively large vs an excessively small Time Quantum (Time Slice)?
A. Large quantum degrades to FCFS; extremely small quantum causes excessive context switch overhead that consumes substantial CPU capacity
B. Small quantum degrades to FCFS; large quantum causes CPU thrashing
C. Quantum size has zero performance impact
D. Large quantum eliminates all ready queues
✔ Correct Answer: Option A
Detailed Explanation: If quantum q -> infinity, RR behaves as FCFS. If q is comparable to context switch time (e.g. 10 microseconds), the CPU spends a dominant percentage of its time switching process contexts rather than executing instructions.
🎯 Key Learning Point: Rule of thumb: 80% of CPU bursts should be shorter than the time quantum.
Question 20 of 75 Chapter 2
What phenomenon occurs in static Priority Scheduling when high-priority tasks continually enter the system, and what technique resolves it?
A. Priority inversion; resolved by terminating low-priority jobs
B. Starvation (Indefinite Blocking); resolved by Aging (gradually increasing the priority of processes that wait in the ready queue for long periods)
C. Memory fragmentation; resolved by compaction
D. Convoy effect; resolved by round robin
✔ Correct Answer: Option B
Detailed Explanation: Low-priority processes may wait indefinitely if high-priority jobs keep arriving. Aging steadily elevates the priority of waiting processes over time, guaranteeing eventual execution.
🎯 Key Learning Point: Aging prevents starvation in priority-based queuing systems.
Question 21 of 75 Chapter 2
How does a Multilevel Feedback Queue (MLFQ) scheduler dynamically categorize CPU-bound vs I/O-bound processes?
A. By inspecting source code annotations
B. New processes enter the highest priority queue with a short time quantum; if a process uses its entire quantum without relinquishing the CPU, it is demoted to a lower queue; if it yields for I/O, it remains in high priority
C. By tracking RAM consumption only
D. By measuring network ping
✔ Correct Answer: Option B
Detailed Explanation: MLFQ learns process behavior: interactive I/O-bound jobs yield quickly and stay in top-priority low-latency queues, while CPU-intensive batch jobs exhaust quantums and sink to background queues with larger slices.
🎯 Key Learning Point: Periodic priority boosts (resetting all jobs to top queue) prevent starvation in MLFQ.
Question 22 of 75 Chapter 2
What is the Completely Fair Scheduler (CFS) used by the Linux kernel based upon?
A. Standard round-robin linked list
B. A Red-Black Tree that orders tasks according to their virtual runtime (vruntime), always selecting the leftmost node with the least accrued execution time
C. Static FIFO queue
D. Random lottery tickets
✔ Correct Answer: Option B
Detailed Explanation: CFS models an ‘ideal multi-tasking CPU’. Each runnable task has a vruntime scaled by its ‘nice’ priority weight. Tasks are organized in a Red-Black Tree; CFS dispatches the process with minimum vruntime in O(log N) or O(1) cached time.
🎯 Key Learning Point: Linux CFS nice values range from -20 (highest priority) to +19 (lowest priority).
Question 23 of 75 Chapter 2
What is the definition of Turnaround Time for a process?
A. Total time spent waiting in the ready queue
B. The total time elapsed from the moment the process is submitted/created to the moment of its complete termination (Turnaround = Completion Time – Arrival Time)
C. Time taken to respond to the first user input
D. Time taken to execute one context switch
✔ Correct Answer: Option B
Detailed Explanation: Turnaround time measures the entire lifespan of the process in the system: Completion Time – Arrival Time = Waiting Time + Execution (Burst) Time.
🎯 Key Learning Point: Waiting Time = Turnaround Time – Burst Time.
Question 24 of 75 Chapter 2
What is Processor Affinity in symmetric multiprocessing (SMP) operating systems?
A. Binding multiple monitors to one graphics card
B. The tendency of an OS scheduler to keep a process running on the same physical CPU core to capitalize on warm L1/L2 hardware cache state ('cache affinity')
C. Connecting two CPUs over a serial cable
D. Overclocking a processor
✔ Correct Answer: Option B
Detailed Explanation: Migrating a process to another core invalidates cache entries, requiring costly main memory cache-line reloads. Schedulers maintain soft or hard processor affinity to avoid cache thrashing.
🎯 Key Learning Point: Hard affinity (e.g. sched_setaffinity in Linux) binds a process strictly to specified core masks.
Question 25 of 75 Chapter 2
In Real-Time Operating Systems (RTOS), what is Rate Monotonic Scheduling (RMS)?
A. A dynamic priority algorithm that assigns highest priority to the task with the nearest deadline
B. A static priority preemptive algorithm that assigns priority inversely proportional to task period (shorter period = higher frequency = higher priority)
C. A random scheduling scheme
D. A FIFO queue for audio buffers
✔ Correct Answer: Option B
Detailed Explanation: RMS is the optimal static-priority scheduling algorithm for periodic real-time tasks. Tasks with shorter periods (higher rates) receive higher static priorities.
🎯 Key Learning Point: Liu and Layland bound: RMS guarantees schedulability if CPU utilization U <= N * (2^(1/N) - 1) (approx 69.3% as N -> inf).
Question 26 of 75 Chapter 2
How does Earliest Deadline First (EDF) differ from Rate Monotonic Scheduling (RMS)?
A. EDF assigns static priorities based on period
B. EDF dynamically assigns priorities at runtime based on deadlines: the task with the closest absolute deadline receives highest priority, achieving up to 100% theoretical CPU utilization
C. EDF cannot be preemptive
D. EDF runs only on microcontrollers
✔ Correct Answer: Option B
Detailed Explanation: EDF is an optimal dynamic-priority real-time scheduling algorithm. As tasks run, deadlines shift, and priorities adjust dynamically, permitting 100% CPU schedulable utilization without missing deadlines.
🎯 Key Learning Point: EDF achieves full 1.0 (100%) schedulability bound, outperforming RMS static 69.3% bound.
Question 27 of 75 Chapter 2
What is 'Response Time' in interactive operating systems?
A. Time from submission until the process completes and outputs its final result
B. Time elapsed from the submission of a request/process until the very first response or output is produced
C. The latency of keyboard hardware interrupts
D. Time spent in the terminated state
✔ Correct Answer: Option B
Detailed Explanation: In desktop and interactive systems, response time (time to start responding) is far more important to user perception than total turnaround time. Round Robin provides superior response times.
🎯 Key Learning Point: Interactive systems optimize for low Response Time; batch systems optimize for high Throughput.
Question 28 of 75 Chapter 2
What happens during Gang Scheduling in parallel computing environments?
A. Processes are randomly terminated to free memory
B. A group of related parallel threads/processes that communicate frequently are scheduled to run simultaneously across multiple CPU cores at the exact same time quantum
C. Background worker threads are given top priority
D. Threads are locked into a single core
✔ Correct Answer: Option B
Detailed Explanation: When threads in a parallel program synchronize frequently using spinlocks or message passing, scheduling them at different times wastes cycles waiting. Gang scheduling co-schedules them across cores simultaneously.
🎯 Key Learning Point: Gang scheduling prevents synchronization delays in multi-threaded HPC applications.
Question 29 of 75 Chapter 2
What is the primary difference between Preemptive and Non-Preemptive scheduling?
A. Preemptive scheduling allows the OS kernel to forcibly interrupt a running process to allocate the CPU to another task; Non-preemptive allows a process to hold the CPU until it voluntarily yields or terminates
B. Non-preemptive scheduling uses hardware interrupts
C. Preemptive scheduling cannot be used with user accounts
D. Non-preemptive scheduling is faster on modern mobile phones
✔ Correct Answer: Option A
Detailed Explanation: In preemptive scheduling, hardware timer interrupts return control to the OS, which can context switch away. In cooperative/non-preemptive systems, a rogue infinite loop freezes the entire operating system.
🎯 Key Learning Point: Windows 3.1 and classic Mac OS were cooperative; Windows NT, Linux, and macOS are fully preemptive.
Question 30 of 75 Chapter 2
Given 3 processes arriving at time 0 with burst times P1=24ms, P2=3ms, P3=3ms under FCFS. What is the average waiting time?
A. 17 ms ((0 + 24 + 27) / 3 = 17 ms)
B. 3 ms
C. 24 ms
D. 10 ms
✔ Correct Answer: Option A
Detailed Explanation: Execution order: P1 [0-24], P2 [24-27], P3 [27-30]. Waiting times: P1 = 0, P2 = 24, P3 = 27. Average waiting time = (0 + 24 + 27) / 3 = 51 / 3 = 17 ms.
🎯 Key Learning Point: If scheduled with SJF (P2, P3, P1), average waiting time drops to (0 + 3 + 6) / 3 = 3 ms (82% reduction).
Curriculum Track • Module 3 of 5
Chapter 3: Process Synchronization, Semaphores, Mutexes & Monitors (Q31 – Q45)
Question 31 of 75 Chapter 3
What are the three mandatory requirements that any valid solution to the Critical Section Problem must satisfy?
A. Speed, Memory efficiency, and Fault tolerance
B. Mutual Exclusion, Progress, and Bounded Waiting
C. Atomicity, Consistency, and Durability
D. Preemption, Caching, and Thread safety
✔ Correct Answer: Option B
Detailed Explanation: 1) Mutual Exclusion: Only one process can execute in its critical section at a time. 2) Progress: If no process is in critical section, only processes wishing to enter can participate in selection. 3) Bounded Waiting: Bound on number of times other processes enter before a waiting process is granted entry.
🎯 Key Learning Point: E.W. Dijkstra formulated the classic formal criteria for the critical section problem.
Question 32 of 75 Chapter 3
What is a Race Condition in concurrent software?
A. Two threads competing for network bandwidth
B. A situation where multiple concurrent threads access and manipulate shared data, and the final outcome depends unpredictably on the exact order or timing of thread execution
C. A computer running faster than its rated clock speed
D. Context switching occurring too quickly
✔ Correct Answer: Option B
Detailed Explanation: Race conditions occur when non-atomic read-modify-write sequences on shared memory are interleaved by the scheduler, leading to data corruption or silent loss of updates.
🎯 Key Learning Point: Synchronization primitives (mutexes, locks, atomic instructions) serialize critical section access to prevent race conditions.
Question 33 of 75 Chapter 3
How does Peterson's Algorithm achieve mutual exclusion between two processes in software?
A. Using binary semaphores
B. Using two shared variables: a boolean flag[2] array indicating intention to enter, and an integer 'turn' variable indicating whose turn it is, with polite yielding ('turn = other')
C. Disabling all hardware interrupts
D. Using CPU atomic test-and-set instructions
✔ Correct Answer: Option B
Detailed Explanation: Peterson’s algorithm sets flag[i] = true and yields turn = j. Process i waits while ‘flag[j] && turn == j’. This elegantly satisfies Mutual Exclusion, Progress, and Bounded Waiting for 2 processes.
🎯 Key Learning Point: On modern out-of-order execution CPUs, memory barriers (fences) are required to prevent compiler/CPU instruction reordering in Peterson’s algorithm.
Question 34 of 75 Chapter 3
What is the architectural purpose of atomic hardware instructions such as Test-and-Set (TAS) and Compare-and-Swap (CAS)?
A. To accelerate 3D graphics rendering
B. To perform read-modify-write memory operations in a single indivisible bus/cache cycle, providing the building blocks for lock-free data structures and OS mutexes
C. To format hard drive partitions
D. To measure CPU temperature
✔ Correct Answer: Option B
Detailed Explanation: CAS atomically compares the contents of a memory location with a given value and, only if they match, modifies the contents to a new value. This indivisibility prevents race conditions without disabling hardware interrupts.
🎯 Key Learning Point: Java’s java.util.concurrent.atomic and C++ std::atomic rely directly on CPU CMPXCHG instructions.
Question 35 of 75 Chapter 3
What is the difference between a Counting Semaphore and a Binary Semaphore?
A. Counting semaphores are stored in RAM; binary semaphores on disk
B. A binary semaphore's value ranges only between 0 and 1 (acting essentially as a mutex lock); a counting semaphore's value can range over an unrestricted integer domain to control access to a finite pool of N identical resources
C. Binary semaphores cannot block threads
D. Counting semaphores do not support wait() and signal()
✔ Correct Answer: Option B
Detailed Explanation: Dijkstra defined semaphores with P (wait/decrement) and V (signal/increment) operations. Counting semaphores initialize to N available resources; when count reaches 0, subsequent wait() calls block.
🎯 Key Learning Point: Wait (P) decrements semaphore; Signal (V) increments semaphore.
Question 36 of 75 Chapter 3
What is a Spinlock, and in what context is it preferred over a blocking mutex?
A. A lock used exclusively for spinning hard disk platters
B. A lock where a thread waits in a tight busy-waiting loop ('spins') repeatedly testing lock availability; preferred on multi-core systems when the critical section is extremely short, avoiding expensive thread sleep/wakeup context switch overhead
C. A lock that rotates through all CPU registers
D. A lock that can never be unlocked
✔ Correct Answer: Option B
Detailed Explanation: Context switching takes ~1-3 microseconds. If a lock is held for only a few CPU clock cycles, spinning consumes fewer cycles than putting the thread to sleep and rescheduling it later. Spinlocks are forbidden on single-core systems without preemption.
🎯 Key Learning Point: Spinlocks waste CPU cycles if the lock holder is preempted or executes a long critical section.
Question 37 of 75 Chapter 3
What is Priority Inversion and how did the Mars Pathfinder spacecraft encounter this classic synchronization bug in 1997?
A. Solar flares altered CPU voltage
B. A low-priority task held a shared mutex; a high-priority task blocked waiting for it; an intermediate medium-priority task preempted the low-priority task, starving the high-priority task indefinitely; fixed by Priority Inheritance
C. Spacecraft clock ran backwards
D. Radiation flipped memory bits in the ROM
✔ Correct Answer: Option B
Detailed Explanation: Pathfinder’s information bus mutex was held by a low-priority meteorological task. Medium-priority communications tasks preempted it, preventing it from releasing the mutex needed by the critical high-priority attitude control thread, triggering watchdog system resets.
🎯 Key Learning Point: Priority Inheritance temporarily elevates the lock-holding task’s priority to that of the highest waiting process.
Question 38 of 75 Chapter 3
What is a Monitor in programming language concurrency constructs (e.g. Java synchronized methods)?
A. A physical CRT computer screen
B. A high-level synchronization abstraction that encapsulates shared variables and procedures, guaranteeing that only one thread can be active within the monitor at any given moment
C. A hardware device monitoring CPU power draw
D. A network sniffer tool
✔ Correct Answer: Option B
Detailed Explanation: Introduced by Hoare and Brinch Hansen, monitors eliminate error-prone manual semaphore wait/signal placement by automatically providing mutual exclusion to encapsulated methods, supplemented by condition variables (wait/notify).
🎯 Key Learning Point: Java objects act as monitors using intrinsic locks with ‘synchronized’, ‘wait()’, and ‘notify()’.
Question 39 of 75 Chapter 3
In the Classic Dining Philosophers Problem, how can deadlock be eliminated without restricting concurrency?
A. Philosophers never eat
B. Allow an odd-numbered philosopher to pick up their left chopstick first and right second, while an even-numbered philosopher picks up right first and left second (asymmetric solution)
C. Remove all chopsticks
D. Run philosophers in single-threaded mode
✔ Correct Answer: Option B
Detailed Explanation: If all 5 philosophers grab their left chopstick simultaneously, a circular wait deadlock occurs. Introducing asymmetry breaks the circular dependency condition, ensuring at least one philosopher can always eat.
🎯 Key Learning Point: Another solution: allow at most 4 philosophers to sit at the 5-seat table simultaneously.
Question 40 of 75 Chapter 3
What is the Bounded-Buffer (Producer-Consumer) synchronization problem?
A. Video streaming over Wi-Fi
B. Producer threads generate data into a fixed-size buffer while consumer threads remove data; producers must block when buffer is full, consumers must block when buffer is empty, and access must be mutually exclusive
C. Memory leaks in browser JavaScript
D. Buffer overflow security exploits
✔ Correct Answer: Option B
Detailed Explanation: Solved using 3 semaphores: ‘mutex’ (binary, initialized to 1 for exclusive access), ’empty’ (counting, initialized to Buffer Size N), and ‘full’ (counting, initialized to 0).
🎯 Key Learning Point: Producer executes: wait(empty); wait(mutex); …; signal(mutex); signal(full).
Question 41 of 75 Chapter 3
In the Readers-Writers Problem, what is the consequence of giving strict preference/priority to Readers?
A. Readers deadlock with each other
B. Writer starvation: if a continuous stream of reader threads keeps arriving, the shared read-count never drops to 0, leaving writer threads waiting indefinitely
C. Buffer overflow occurs
D. Data corruption in read operations
✔ Correct Answer: Option B
Detailed Explanation: First Readers-Writers problem allows multiple readers to read concurrently. If new readers arrive before older readers finish, the room is never vacated, starving writers. Second Readers-Writers problem prioritizes writers.
🎯 Key Learning Point: Fair Reader-Writer locks use FIFO queues to ensure bounded waiting for both readers and writers.
Question 42 of 75 Chapter 3
What is the difference between Hoare (Signal-and-Wait) and Mesa (Signal-and-Continue) semantics in Monitor Condition Variables?
A. Hoare runs on Intel; Mesa runs on ARM
B. In Hoare semantics, the signaling thread yields CPU immediately to the awakened thread; in Mesa semantics (used in Java/POSIX), the signaling thread continues and awakened threads must re-check conditions in a 'while' loop
C. Mesa semantics do not support condition variables
D. Hoare semantics cause memory leaks
✔ Correct Answer: Option B
Detailed Explanation: Under Mesa semantics, another thread might enter between signal and awakening. Therefore, threads must ALWAYS test conditions inside a while loop: ‘while (!condition) { wait(); }’ rather than an ‘if’ statement.
🎯 Key Learning Point: Always write ‘while (!ready) wait()’ in Java and POSIX pthreads to guard against spurious wakeups.
Question 43 of 75 Chapter 3
What is a Futex (Fast Userspace Mutex) in Linux kernel architecture?
A. A hardware co-processor
B. A synchronization mechanism where uncontended locking/unlocking is executed purely in user-space via atomic instructions (zero system call overhead), only invoking the kernel to sleep/wake threads when lock contention occurs
C. A file-locking protocol for NFS
D. A replacement for POSIX signals
✔ Correct Answer: Option B
Detailed Explanation: Syscalls are expensive. In 90%+ of cases, locks are uncontended. Futexes allow atomic CAS in userspace for uncontended paths, only transitioning to the kernel via sys_futex when a thread must actually sleep or be awakened.
🎯 Key Learning Point: Glibc pthread_mutex_t is implemented on top of Linux futexes.
Question 44 of 75 Chapter 3
What is the ABA Problem in lock-free concurrent programming using Compare-and-Swap (CAS)?
A. Music playback synchronization bug
B. Thread 1 reads value A; Thread 2 changes A to B and back to A; Thread 1 executes CAS(expected=A), which succeeds thinking nothing changed, despite intermediate node recycling and corrupted pointer state
C. Three threads competing for two locks
D. Double-free memory errors
✔ Correct Answer: Option B
Detailed Explanation: CAS checks value equality, not mutation history. If a memory address is freed and reallocated with original value A, CAS erroneously succeeds. Resolved by pairing pointers with monotonic version stamps (Tagged Pointers).
🎯 Key Learning Point: Tagged pointers / atomic stamped references (e.g. AtomicStampedReference in Java) eliminate the ABA problem.
Question 45 of 75 Chapter 3
What is a Memory Barrier (Memory Fence) in multi-core CPU architecture?
A. Physical plastic partition inside laptop RAM slots
B. A CPU instruction that enforces an ordering constraint on memory read and write operations, preventing compilers and out-of-order execution pipelines from reordering operations across the barrier
C. An antivirus memory scanner
D. A virtual memory page boundary
✔ Correct Answer: Option B
Detailed Explanation: Modern superscalar processors reorder independent instructions for performance. In concurrent lock implementations, memory fences (e.g. MFENCE, acquire/release barriers) ensure writes are made visible to other cores before lock release.
🎯 Key Learning Point: Without memory fences, double-checked locking in Java/C++ can return partially constructed objects.
Curriculum Track • Module 4 of 5
Chapter 4: Deadlocks, Prevention, Avoidance (Banker’s) & Recovery (Q46 – Q60)
Question 46 of 75 Chapter 4
What are the Four Coffman Conditions that must hold simultaneously for a Deadlock to occur?
A. High CPU, Low RAM, Network lag, and Disk corruption
B. Mutual Exclusion, Hold and Wait, No Preemption, and Circular Wait
C. Atomicity, Consistency, Isolation, and Durability
D. Read lock, Write lock, Shared lock, and Exclusive lock
✔ Correct Answer: Option B
Detailed Explanation: Edward G. Coffman Jr. proved in 1971 that deadlocks occur if and only if all four conditions hold: 1) Mutual Exclusion, 2) Hold and Wait, 3) No Preemption, 4) Circular Wait. Invalidating any ONE condition prevents deadlock.
🎯 Key Learning Point: Deadlock prevention strategies systematically eliminate one of these four conditions.
Question 47 of 75 Chapter 4
How can the 'Circular Wait' condition be eliminated to prevent deadlocks in complex software systems?
A. Terminate all background processes every 10 seconds
B. Impose a total global linear ordering on all resource types, requiring every process to request resources strictly in increasing numerical order
C. Allocate infinite RAM to all threads
D. Convert all multi-threaded programs to single-threaded
✔ Correct Answer: Option B
Detailed Explanation: Assign each resource R_i a unique integer F(R_i). A process can request resource R_j only if F(R_j) > F(R_i) for all held resources. This mathematically prevents cycles from forming in the Resource Allocation Graph.
🎯 Key Learning Point: Global lock ordering is the standard industry technique to eliminate deadlocks in large codebases.
Question 48 of 75 Chapter 4
In a Resource Allocation Graph (RAG), under what condition is the presence of a directed cycle a definitive, guaranteed indicator of a deadlock?
A. Always, under all circumstances
B. Only when every resource type in the graph has exactly ONE single instance
C. Only when all resources have multiple instances
D. When there are more than 100 processes
✔ Correct Answer: Option B
Detailed Explanation: If each resource type has strictly 1 instance, a cycle is necessary AND sufficient for deadlock. If resource types have multiple instances, a cycle is necessary but NOT sufficient (a cycle may exist without deadlock if outside instances become free).
🎯 Key Learning Point: Single-instance RAG: Cycle <=> Deadlock. Multi-instance RAG: Cycle is a necessary condition, but may not be deadlocked.
Question 49 of 75 Chapter 4
What is the core premise of Dijkstra's Banker's Algorithm for Deadlock Avoidance?
A. It checks bank account balances before allocating memory
B. Before granting any resource allocation request, the OS simulates the allocation to ensure that the system remains in a 'Safe State' (where at least one execution sequence exists that allows all processes to finish)
C. It terminates all processes that request locks
D. It detects deadlocks after they occur
✔ Correct Answer: Option B
Detailed Explanation: The Banker’s Algorithm maintains Max, Allocation, Need (Need = Max – Allocation), and Available vectors/matrices. A request is granted only if granting it leaves the system in a Safe State.
🎯 Key Learning Point: A Safe State guarantees no deadlock can occur; an Unsafe State does NOT guarantee deadlock, but deadlock is possible.
Question 50 of 75 Chapter 4
Given Available = [3, 3, 2] and a process with Need = [1, 2, 2]. Can this process's request be granted under the Banker's Algorithm?
A. No, because 3 is greater than 1
B. Yes, because Need <= Available component-wise ([1<=3, 2<=3, 2<=2] is TRUE)
C. No, because available must be strictly double the need
D. Cannot be determined
✔ Correct Answer: Option B
Detailed Explanation: The safety algorithm checks if Need[i] <= Work. Since [1, 2, 2] <= [3, 3, 2] for all components, the system has sufficient free resources to satisfy the process's peak demand.
🎯 Key Learning Point: Vector comparison in Banker’s algorithm requires every single component condition to hold true.
Question 51 of 75 Chapter 4
What is the 'Ostrich Algorithm' approach to deadlocks, and why is it used by modern commodity OSes (Windows, Linux)?
A. Hiding user files in hidden directories
B. Stick your head in the sand and pretend the problem never happens: ignore deadlocks because the runtime performance cost of continuous avoidance/prevention outweighs the rare occurrence of deadlocks, relying on user restarts
C. An algorithm designed for running on high-speed trains
D. An algorithm that compresses process control blocks
✔ Correct Answer: Option B
Detailed Explanation: Banker’s algorithm requires knowing maximum resource needs upfront and incurs heavy O(M * N^2) runtime overhead on every lock request. Commodity OSes favor speed and let rare deadlocked processes be killed by users or watchdog timers.
🎯 Key Learning Point: Mission-critical/safety-critical real-time OSes use rigorous avoidance; general OSes use the Ostrich algorithm.
Question 52 of 75 Chapter 4
What is the difference between Deadlock Prevention and Deadlock Avoidance?
A. Prevention and Avoidance are identical terms
B. Prevention structurally invalidates one of the 4 Coffman conditions at design time; Avoidance dynamically monitors runtime requests and circumvents entering unsafe states using process claim limits
C. Avoidance kills processes; Prevention reboots the machine
D. Prevention is for hardware; Avoidance is for software
✔ Correct Answer: Option B
Detailed Explanation: Prevention imposes static design rules (e.g. require all locks at once, or lock ordering). Avoidance requires knowledge of future resource demands (e.g. Banker’s algorithm) to avoid unsafe allocations dynamically.
🎯 Key Learning Point: Prevention: static design constraints. Avoidance: dynamic state checks.
Question 53 of 75 Chapter 4
What is Livelock in concurrent systems?
A. A deadlock occurring during live video streaming
B. Two or more processes actively change their execution states in response to each other without making any functional forward progress, continually consuming 100% CPU cycles while effectively remaining stuck
C. A thread sleeping in background
D. Hardware power loss
✔ Correct Answer: Option B
Detailed Explanation: Like two polite people in a hallway repeatedly stepping to the same side simultaneously: unlike deadlock (where threads are blocked asleep), livelocked threads are active and running, but caught in a futile loop.
🎯 Key Learning Point: Randomized backoff algorithms (like Ethernet CSMA/CD backoff) break livelocks.
Question 54 of 75 Chapter 4
When a deadlock detection algorithm identifies a deadlocked cycle, what are the primary recovery mechanisms?
A. Reformatting the hard drive
B. Process Termination (aborting all deadlocked tasks or aborting one-by-one until cycle is broken) and Resource Preemption (successively preempting resources from victim processes and rolling them back to checkpoints)
C. Increasing CPU clock speed
D. Disabling keyboard interrupts
✔ Correct Answer: Option B
Detailed Explanation: Recovery requires breaking the cycle by terminating processes (favoring lowest-cost victims) or preempting resources, rolling victim processes back to a safe checkpoint state.
🎯 Key Learning Point: Victim selection criteria: priority, execution time consumed, resources held, and whether interactive or batch.
Question 55 of 75 Chapter 4
What is the computational complexity of the Banker's Safety Algorithm for N processes and M resource types?
A. O(1)
B. O(M * N^2)
C. O(2^N)
D. O(log N)
✔ Correct Answer: Option B
Detailed Explanation: In the worst case, finding a safe process takes O(M * N) comparisons, and this step may be repeated for all N processes, resulting in O(M * N^2) overall time complexity.
🎯 Key Learning Point: O(M * N^2) cost on every single resource request makes Banker’s algorithm impractical for high-throughput kernels.
Question 56 of 75 Chapter 4
What is a 'Wait-For Graph' (WFG) and how is it derived from a Resource Allocation Graph?
A. A graph showing network download wait times
B. A collapsed variant of a single-instance RAG where resource nodes are removed and directed edges Pi -> Pj directly signify that process Pi is waiting for process Pj to release a needed resource
C. A flowchart of system boot times
D. A tree of child processes
✔ Correct Answer: Option B
Detailed Explanation: By removing resource nodes from a single-unit RAG and drawing direct edges between processes, WFG simplifies deadlock detection to classic cycle-finding algorithms (DFS) in O(V^2) or O(V + E) time.
🎯 Key Learning Point: A cycle in a Wait-For Graph confirms the exact presence of a deadlock.
Question 57 of 75 Chapter 4
Why is 'Resource Preemption' difficult to implement for general computing resources during deadlock recovery?
A. CPUs cannot preempt processes
B. Preempting resources like printers, tape drives, or partially written database tables leaves system state corrupted unless the process can be safely rolled back to a known clean checkpoint
C. Memory cannot be cleared
D. Preemption destroys CPU hardware
✔ Correct Answer: Option B
Detailed Explanation: Unlike CPU cores or RAM pages (which can be saved and restored easily), many devices have stateful, non-resumable physical interactions that cannot be preempted cleanly without checkpoint/rollback mechanisms.
🎯 Key Learning Point: Non-preemptible resources require full transaction logging for recovery.
Question 58 of 75 Chapter 4
How does the 'Hold and Wait' condition prevention protocol work, and what is its operational downside?
A. Require processes to request all needed resources simultaneously before starting execution; downside: severely reduces resource utilization and can cause starvation for processes needing many resources
B. Allow processes to hold infinite resources; downside: runs out of memory
C. Put all processes to sleep for 5 minutes; downside: slow
D. Force processes to release all memory on every instruction
✔ Correct Answer: Option A
Detailed Explanation: If a process must acquire everything upfront (or release current resources before requesting new ones), it never ‘holds and waits’. However, resources allocated for later stages sit idle, wasting system capacity.
🎯 Key Learning Point: Hold and Wait prevention trades off resource utilization for deadlock safety.
Question 59 of 75 Chapter 4
What is 'Starvation' in the context of Deadlock Recovery victim selection?
A. The system running out of electric power
B. If victim selection is based strictly on cost, the exact same low-priority process may be repeatedly chosen as victim and rolled back, never completing its execution
C. Hard drives wearing out from repeated writes
D. Threads locking the kernel
✔ Correct Answer: Option B
Detailed Explanation: To prevent starvation, rollback count must be factored into cost: as a process is rolled back, its priority weight increases so it will not be victimized indefinitely.
🎯 Key Learning Point: Incorporate a rollback counter into victim selection algorithms to avoid starvation.
Question 60 of 75 Chapter 4
Can a system in an Unsafe State still avoid experiencing a deadlock?
A. No, an unsafe state guarantees a deadlock will occur 100% of the time
B. Yes, because an unsafe state merely indicates that the OS can no longer GUARANTEE avoiding deadlock; if running processes do not request their maximum declared resources, no deadlock will occur
C. Unsafe states only happen on Windows
D. Yes, if the computer is turned off
✔ Correct Answer: Option B
Detailed Explanation: An unsafe state means there is at least one sequence of future requests that COULD lead to deadlock. If processes terminate without claiming their theoretical peak Max allocation, the system completes safely.
🎯 Key Learning Point: All deadlocked states are unsafe; not all unsafe states result in deadlocks.
Curriculum Track • Module 5 of 5
Chapter 5: Virtual Memory, Paging, Page Faults, TLB & Replacement Algorithms (Q61 – Q75)
Question 61 of 75 Chapter 5
What is the primary difference between Internal Fragmentation and External Fragmentation in memory management?
A. Internal happens on SSDs; External happens in RAM
B. Internal fragmentation occurs when allocated memory blocks are larger than requested data (wasted space INSIDE allocated partitions, typical in Paging); External fragmentation occurs when total free memory is sufficient but broken into small scattered non-contiguous holes (typical in Segmentation)
C. External fragmentation happens only inside CPU registers
D. They are identical
✔ Correct Answer: Option B
Detailed Explanation: In paging, fixed page size (e.g. 4KB) means a 1-byte allocation wastes 4095 bytes inside the page (internal). In variable partitioning, allocating and freeing varying chunks creates unusable small gaps between allocated spaces (external).
🎯 Key Learning Point: Paging completely eliminates external fragmentation at the cost of slight internal fragmentation on final pages.
Question 62 of 75 Chapter 5
What is the role of the Translation Lookaside Buffer (TLB) in virtual memory address translation?
A. Translates programming language source code into machine code
B. A high-speed hardware associative cache located inside the CPU MMU that caches recent Virtual Page Number (VPN) to Physical Frame Number (PFN) mappings to avoid multi-level page table memory lookups
C. Translates hard drive disk sectors to USB sectors
D. Caches network packets
✔ Correct Answer: Option B
Detailed Explanation: Accessing RAM takes ~50-100ns. With 4-level page tables, translating an address without a cache requires 4 additional RAM accesses (~300ns). TLB lookups take <1ns, achieving 99%+ hit rates.
🎯 Key Learning Point: Effective Access Time (EAT) = TLB_hit_rate * (TLB_time + RAM_time) + (1 – TLB_hit_rate) * (TLB_time + (N+1)*RAM_time).
Question 63 of 75 Chapter 5
What causes a Page Fault interrupt in an operating system?
A. Physical RAM chip failure
B. The CPU attempts to access a virtual memory address whose page table entry has its 'Valid/Present' bit set to 0 (the page is either not allocated or currently swapped out on disk)
C. A syntax error in user code
D. Division by zero in CPU ALU
✔ Correct Answer: Option B
Detailed Explanation: When Present bit = 0, hardware MMU triggers trap to kernel page fault handler. The OS locates the page in swap space, allocates a free physical RAM frame, reads page from disk, updates page table (Valid=1), and restarts instruction.
🎯 Key Learning Point: Page fault handling takes milliseconds due to mechanical/SSD disk I/O latency.
Question 64 of 75 Chapter 5
What is Belady's Anomaly in page replacement algorithms?
A. Increasing RAM size causes system crashes
B. The counter-intuitive phenomenon where increasing the number of physical page frames results in an INCREASE in the number of page faults (observable in FIFO page replacement)
C. LRU running slower than random replacement
D. Virtual memory exceeding hard drive size
✔ Correct Answer: Option B
Detailed Explanation: Discovered by Laszlo Belady in 1969. While one expects more frames to reduce page faults, FIFO can produce MORE page faults with 4 frames than with 3 frames for certain reference strings (e.g. 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5).
🎯 Key Learning Point: Stack algorithms (like LRU and Optimal) are mathematically immune to Belady’s Anomaly because the set of pages in N frames is always a subset of pages in N+1 frames.
Question 65 of 75 Chapter 5
How does the Optimal Page Replacement Algorithm (OPT / Belady's Min) decide which page to evict?
A. Evicts the oldest page in memory
B. Evicts the page that will NOT be used for the longest period of time in the future
C. Evicts the smallest page
D. Randomly evicts a page
✔ Correct Answer: Option B
Detailed Explanation: OPT guarantees the lowest possible page fault rate for any reference string. However, it cannot be implemented in general OSes because it requires clairvoyant future knowledge, serving as an optimal benchmark to evaluate practical algorithms.
🎯 Key Learning Point: OPT provides the theoretical performance ceiling for all page replacement algorithms.
Question 66 of 75 Chapter 5
How does the Clock (Second-Chance) Page Replacement Algorithm approximate LRU in software?
A. It checks system wall clock time every second
B. Arranges frames in a circular queue with a clock hand. Inspects reference bit: if 1, clears bit to 0 and advances hand (second chance); if 0, selects that page for immediate eviction
C. Uses an expensive hardware timer per page frame
D. Replaces pages at midnight
✔ Correct Answer: Option B
Detailed Explanation: True LRU requires hardware timestamps or doubly-linked list moves on every memory access. Clock algorithm uses a simple 1-bit hardware reference flag, achieving near-LRU performance with near-zero runtime overhead.
🎯 Key Learning Point: Enhanced Second-Chance algorithm also examines the Dirty (Modify) bit: preference is given to clean pages to avoid disk write-backs.
Question 67 of 75 Chapter 5
What is 'Thrashing' in an operating system virtual memory subsystem?
A. Physical vibration of hard drive platters
B. A critical collapse in system throughput where the OS spends more time swapping pages into and out of disk than executing instructions, caused by total working sets of active processes exceeding available physical RAM
C. High CPU utilization running games
D. Overheating motherboard chipset
✔ Correct Answer: Option B
Detailed Explanation: When memory is overcommitted, page faults occur constantly. The CPU scheduler sees low CPU utilization (processes waiting on disk I/O) and erroneously brings in MORE processes, causing total system collapse.
🎯 Key Learning Point: Thrashing is resolved by suspending/swapping out processes until total working set fits in physical RAM.
Question 68 of 75 Chapter 5
What is the Working Set Model proposed by Peter Denning for preventing thrashing?
A. A gym exercise routine for developers
B. Defines the Working Set W(t, Δ) as the set of distinct virtual pages referenced by a process during the most recent time window Δ; the OS only schedules a process if its complete working set fits in RAM
C. A model of employee shifts in datacenters
D. A mathematical model for network routing
✔ Correct Answer: Option B
Detailed Explanation: The Locality of Reference principle shows processes access a localized cluster of pages over time. Sum of working set sizes across all active processes must not exceed physical RAM: Σ WSS_i <= Total RAM.
🎯 Key Learning Point: Working Set tracking ensures pages are available in RAM, maintaining high CPU throughput.
Question 69 of 75 Chapter 5
Why do 64-bit operating systems use Multi-Level Page Tables (e.g. 4-level or 5-level paging) instead of a single flat page table?
A. Flat tables cannot support virtual memory
B. A flat page table for a 64-bit address space with 4KB pages would require millions of Gigabytes of RAM per process just to store page table entries; multi-level tables allocate page directory pages on-demand for allocated regions only
C. Multi-level tables are faster to search than flat arrays
D. Single tables cannot be saved to SSD
✔ Correct Answer: Option B
Detailed Explanation: In 64-bit systems, vast swathes of virtual address space are unallocated. Multi-level tree paging allows entire subtree branches to point to NULL, consuming memory only for active virtual address regions.
🎯 Key Learning Point: x86-64 uses 4-level paging (PML4 -> PDPT -> PD -> PT) and 5-level paging (PML5) for 57-bit address spaces.
Question 70 of 75 Chapter 5
What is an Inverted Page Table and what is its primary advantage?
A. A page table stored upside down in RAM
B. A table indexed by physical frame numbers rather than virtual page numbers, containing one entry per physical RAM frame across the entire system, drastically reducing page table memory footprint
C. A table stored on disk
D. A table that swaps virtual and MAC addresses
✔ Correct Answer: Option B
Detailed Explanation: Traditional tables have entries for every virtual page per process. Inverted tables scale strictly with physical RAM size (one entry per frame, storing pid + vpn). Used in PowerPC and UltraSPARC architectures.
🎯 Key Learning Point: Lookup in inverted tables requires hash tables to avoid scanning every frame sequentially.
Question 71 of 75 Chapter 5
What is Copy-on-Write (COW) and how does it optimize the Unix 'fork()' system call?
A. Printing documents to paper on write
B. Parent and child processes initially share the exact same physical memory pages marked as read-only; physical copying of a page occurs ONLY when either process attempts to write/modify that page
C. Making backups of files every hour
D. Duplicating network packets
✔ Correct Answer: Option B
Detailed Explanation: Duplicating an entire multi-gigabyte process memory space during fork() is wasteful, especially when followed immediately by exec(). COW shares pages instantly; a write triggers a page fault that duplicates only the single modified 4KB page.
🎯 Key Learning Point: COW makes process creation in Unix/Linux instantaneous (sub-millisecond).
Question 72 of 75 Chapter 5
What is the Dirty (Modify) Bit in a Page Table Entry?
A. A security flag indicating malware infection
B. A hardware bit set by the MMU whenever a write instruction modifies the page; when evicting the page, the OS checks this bit: if 0, the page is discarded cleanly; if 1, it must be written back to swap disk
C. A bit indicating parity corruption
D. A bit set when memory is zeroed
✔ Correct Answer: Option B
Detailed Explanation: Disk writes are slow. If a page was only read (dirty bit = 0), the copy in swap/filesystem is already up-to-date, so the frame can be overwritten instantly without disk I/O.
🎯 Key Learning Point: Dirty bit tracking cuts disk write I/O in half during page replacement.
Question 73 of 75 Chapter 5
What is the purpose of 'Huge Pages' (e.g. 2MB or 1GB pages in Linux) for high-performance databases (Oracle, PostgreSQL)?
A. To download files faster
B. Reduces the total number of page table entries required for large RAM allocations, dramatically lowering TLB misses and eliminating multi-level page table walk overhead
C. To prevent memory allocation errors
D. Huge pages bypass CPU caches
✔ Correct Answer: Option B
Detailed Explanation: A 64GB database buffer pool using 4KB pages requires 16 million TLB mappings, thrashing the TLB. With 2MB huge pages, only 32,000 entries are needed, keeping hot memory paths resident in CPU TLB caches.
🎯 Key Learning Point: Transparent Huge Pages (THP) and Hugetlbfs accelerate memory-intensive database engines.
Question 74 of 75 Chapter 5
What is the difference between Paging and Segmentation?
A. Paging divides memory into fixed-size physical blocks (transparent to programmer, no external fragmentation); Segmentation divides memory into variable-sized logical modules (code, data, stack, heap) visible to the user/compiler
B. Segmentation uses fixed sizes; Paging uses variable sizes
C. Paging is only used on mobile phones
D. Segmentation was invented for SSDs
✔ Correct Answer: Option A
Detailed Explanation: Paging is a hardware physical memory management technique with fixed sizes (4KB). Segmentation aligns with programmer logical units (functions, symbol tables, stack arrays) with variable lengths.
🎯 Key Learning Point: Modern x86 systems use Segmentation with Paging: segment registers point to descriptors, whose outputs are fed into paging MMU.
Question 75 of 75 Chapter 5
What happens during 'Memory Compaction' in operating systems that suffer from external fragmentation?
A. Memory chips are physically compressed
B. The OS shuffles allocated memory segments to one end of physical memory, consolidating all scattered free holes into a single large contiguous block of free memory
C. Files are converted into .zip format
D. CPU clock frequency is lowered
✔ Correct Answer: Option B
Detailed Explanation: Compaction eliminates external fragmentation by relocating active processes. It is only possible if program addresses are dynamically relocatable at runtime using base/limit registers.
🎯 Key Learning Point: Compaction is CPU-intensive as massive blocks of memory must be copied across RAM buses.

Explore Other Comprehensive 75-Question Subject Tracks

Continue your preparation across our active curriculum tracks. Every track provides 75 verified questions across 5 complete chapters.

🟢 100% Live Track
C Programming
75 Qs • 5 Chapters • Practice Now →
🟢 100% Live Track
Python Programming
75 Qs • 5 Chapters • Practice Now →
🟢 100% Live Track
Data Structures
75 Qs • 5 Chapters • Practice Now →
🟢 100% Live Track
DBMS & SQL
75 Qs • 5 Chapters • Practice Now →
🟢 100% Live Track
Computer Networks
75 Qs • 5 Chapters • Practice Now →
Active Track
📍 Operating Systems
75 Qs • 5 Chapters (You are here)
🟢 100% Live Track
Quantitative Aptitude
75 Qs • 5 Chapters • Practice Now →
📚 View All 92+ Subjects in Master Directory
Share
  • Facebook
Queryiest

Queryiest

Enlightened

Queryiest – Technology Writer | Software Developer | Digital Learning Enthusiast

Queryiest is a technology writer, software developer, and knowledge-sharing enthusiast passionate about simplifying complex technical concepts for students, professionals, and lifelong learners. With expertise in software development, programming, cybersecurity, artificial intelligence, digital tools, and emerging technologies, Queryiest creates practical, research-driven content that helps readers solve real-world problems. As a regular contributor to RTSALL, Queryiest publishes easy-to-understand guides, coding resources, technology news, career advice, and educational tutorials designed for beginners and professionals alike. Every article focuses on accuracy, clarity, and actionable insights to help readers stay informed in the rapidly evolving digital world. Whether it's programming, software engineering, AI, cybersecurity, online platforms, or digital productivity, Queryiest believes that quality knowledge should be accessible to everyone. The goal is to build a trusted learning resource where readers can discover reliable answers, improve their technical skills, and make informed decisions. Areas of Expertise: Software Development, Programming, Cybersecurity, Artificial Intelligence, Technology News, Coding Interview Preparation, Digital Learning, Productivity Tools, and Online Knowledge Sharing.

    Sidebar

    Ask A Question
    • Popular
    • Answers
    • Queryiest

      What is a database?

      • 3 Answers
    • Anonymous

      How to rotate an array in-place with O(1) space and ...

      • 3 Answers
    • hannah

      What steps can businesses take to identify the most valuable ...

      • 2 Answers
    • Vikram
      aarav0 added an answer Direct Technical Solution: Unlike IVFFlat (which partitions vector spaces with… September 11, 2026 at 9:57 pm
    • Abhishek
      Abhishek added an answer Direct Technical Solution: In C++20, range view adaptors (like std::views::filter,… September 11, 2026 at 9:57 pm
    • Sneha Patel
      Anonymous added an answer Direct Technical Solution: torch.cuda.empty_cache() releases only cached (unallocated) blocks back… September 11, 2026 at 9:57 pm

    Top Members

    Queryiest

    Queryiest

    • 201 Questions
    • 295 Points
    Enlightened
    Anonymous

    Anonymous

    • 11 Questions
    • 42 Points
    Begginer
    paperubofficial

    paperubofficial

    • 0 Questions
    • 22 Points
    Begginer

    Trending Tags

    ai asp.net aws basics aws certification aws console aws free tier aws login aws scenario-based questions c++ career cyber security cyber security interview git java javascript jobs jquery net core net core interview questions sql

    Explore

    • Home
    • Add group
    • Groups page
    • Communities
    • Questions
      • DSA Problems
    • Polls
    • Tags
    • Badges
    • Users
    • Help
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions

    Footer

    About Us

    • Meet The Team
    • Blog
    • About Us
    • Contact Us

    Legal Stuff

    • Privacy Policy
    • Disclaimer
    • Terms & Conditions

    Help

    • Knowledge Base
    • Support

    Follow

    © 2023-25 RTSALL. All Rights Reserved