Operating Systems Basics MCQs (Part-6)

What is deadlock in an operating system?

A Resource Allocation
B Mutual Resource Blocking
C Process Termination
D Process Overload

Which of the following is a necessary condition for a deadlock to occur?

A Mutual Exclusion
B Task Synchronization
C Process Scheduling
D Resource Allocation

Which technique is used by operating systems to prevent deadlock?

A CPU Scheduling
B Swapping
C Priority Scheduling
D Resource Allocation Graph

What is a semaphore in the context of operating systems?

A File Management Tool
B Task Management Tool
C Synchronization Mechanism
D Memory Management Tool

Which of the following is an advantage of using a mutex for synchronization?

A Avoids Race Conditions
B Increases CPU Usage
C Simple to Implement
D Faster Memory Access

Which of the following is a primary method for avoiding deadlock in an operating system?

A Priority Scheduling
B Deadlock Detection
C Resource Pre-allocation
D Process Synchronization

What is the function of the “wait” operation in a semaphore?

A Synchronize Threads
B Request Resource Access
C Process Scheduling
D Release Resource

What is the purpose of the “signal” operation in a semaphore?

A Terminate Process
B Allocate Memory
C Synchronize Processes
D Release Resource

In which situation is deadlock detection most commonly used?

A Post-Deadlock Recovery
B Resource Allocation
C Process Synchronization
D Preemptive Scheduling

Which of the following is a method for recovering from deadlock in an operating system?

A Task Preemption
B Memory Swapping
C Process Termination
D Priority Scheduling

Which of the following conditions must be satisfied for deadlock to occur in an operating system?

A Circular Wait
B High Resource Demand
C Task Scheduling
D Multiple Processes

What is the main purpose of using a resource allocation graph (RAG)?

A Detect Deadlocks
B Allocate Memory
C Track Process States
D Manage CPU Scheduling

What does the term “race condition” refer to in concurrent programming?

A Task Scheduling Issue
B Resource Contention
C Memory Access Conflict
D Multiple Processes

What is the main difference between a mutex and a semaphore?

A Semaphore restricts thread access
B Mutex is for thread synchronization
C Mutex allows multiple threads
D Semaphore uses priority scheduling

Which of the following algorithms is used to prevent deadlock?

A First-Come, First-Served
B Shortest Job First
C Banker’s Algorithm
D Round Robin