Q.1 Which of the following is a classic problem of process synchronization?
Reader-Writer Problem
File Allocation Problem
Page Replacement Problem
Deadlock Detection
Explanation - The Reader-Writer problem is a classic synchronization issue where multiple processes attempt to read and write from a shared resource concurrently.
Correct answer is: Reader-Writer Problem
Q.2 A semaphore is primarily used to:
Allocate memory
Achieve synchronization
Detect deadlocks
Improve CPU scheduling
Explanation - Semaphores are synchronization primitives used to manage concurrent access to shared resources.
Correct answer is: Achieve synchronization
Q.3 Which of the following conditions is NOT necessary for deadlock?
Mutual Exclusion
Hold and Wait
Preemption
Circular Wait
Explanation - Preemption is actually the absence of preemption that contributes to deadlock; preemption itself prevents deadlock.
Correct answer is: Preemption
Q.4 In the Dining Philosophers problem, deadlock can occur if:
All philosophers pick up left fork first
Forks are unlimited
A philosopher eats alone
One philosopher leaves the table
Explanation - If all philosophers pick up the left fork first, they all wait indefinitely for the right fork, leading to deadlock.
Correct answer is: All philosophers pick up left fork first
Q.5 Which synchronization mechanism uses a counter variable with wait() and signal() operations?
Monitor
Mutex
Semaphore
Critical Section
Explanation - Semaphores use wait() and signal() operations to synchronize access to resources using an internal counter.
Correct answer is: Semaphore
Q.6 The 'hold and wait' condition in deadlock means:
Processes request all resources at once
Processes hold some resources while waiting for others
Processes cannot release resources
Processes wait forever
Explanation - In hold and wait, a process is holding allocated resources and simultaneously waiting for additional resources.
Correct answer is: Processes hold some resources while waiting for others
Q.7 Which method can be used to prevent deadlock?
Ignore the problem
Resource allocation graph
Banker's algorithm
Mutual exclusion
Explanation - The Banker's algorithm is a deadlock avoidance algorithm that ensures safe resource allocation.
Correct answer is: Banker's algorithm
Q.8 Critical section problems occur in:
Sequential processes
Multiprogramming systems
Distributed file systems
Single-task systems
Explanation - Critical section problems arise when multiple processes execute concurrently and share resources.
Correct answer is: Multiprogramming systems
Q.9 Which of these is NOT a solution to the critical section problem?
Peterson’s Algorithm
Test-and-Set Lock
Dekker’s Algorithm
Virtual Memory
Explanation - Virtual memory handles memory management, not synchronization. Peterson’s, Dekker’s, and TSL are synchronization solutions.
Correct answer is: Virtual Memory
Q.10 Which of the following is a non-blocking synchronization mechanism?
Semaphore
Spinlock
Monitor
Mutex
Explanation - Spinlocks use busy waiting, making them non-blocking in terms of kernel intervention.
Correct answer is: Spinlock
Q.11 Deadlock prevention ensures that:
Deadlock is impossible
Deadlock is detected and resolved
Deadlock occurs occasionally
Processes are rolled back after deadlock
Explanation - Prevention techniques ensure that one or more necessary conditions for deadlock cannot occur.
Correct answer is: Deadlock is impossible
Q.12 The wait() operation in semaphore:
Increments the counter
Decrements the counter
Releases resources
Allocates new memory
Explanation - wait() decreases the semaphore count and may block a process if the value becomes negative.
Correct answer is: Decrements the counter
Q.13 A system is said to be in a safe state if:
It avoids deadlock by killing processes
It can allocate resources to all processes without leading to deadlock
It preempts resources forcibly
It detects circular wait
Explanation - A safe state ensures that the system can satisfy all resource requests without deadlock.
Correct answer is: It can allocate resources to all processes without leading to deadlock
Q.14 Monitors are a synchronization construct that:
Use hardware support
Encapsulate shared variables and synchronization
Rely on spinlocks
Prevent memory fragmentation
Explanation - Monitors bundle shared resources and synchronization methods, ensuring safe access.
Correct answer is: Encapsulate shared variables and synchronization
Q.15 Which of the following is true about deadlock detection?
It prevents deadlock
It avoids deadlock
It allows deadlock and then resolves it
It uses Banker's algorithm
Explanation - Deadlock detection permits deadlocks to occur and then detects and resolves them.
Correct answer is: It allows deadlock and then resolves it
Q.16 Busy waiting occurs in:
Mutex locks
Semaphores
Spinlocks
Monitors
Explanation - Spinlocks repeatedly check for lock availability, leading to busy waiting.
Correct answer is: Spinlocks
Q.17 Which of the following is NOT a condition of critical section problem?
Mutual Exclusion
Progress
Bounded Waiting
Starvation
Explanation - Starvation is an issue but not a formal condition of the critical section problem.
Correct answer is: Starvation
Q.18 Deadlock avoidance requires:
Knowledge of future resource requests
Killing processes immediately
Using only semaphores
No mutual exclusion
Explanation - Avoidance requires prior knowledge of processes’ maximum resource requirements.
Correct answer is: Knowledge of future resource requests
Q.19 Peterson’s algorithm is used for:
Deadlock detection
Page replacement
Critical section handling
Disk scheduling
Explanation - Peterson’s algorithm provides a software-based solution for critical section synchronization.
Correct answer is: Critical section handling
Q.20 Circular wait can be prevented by:
Ordering resources
Using semaphores
Mutual exclusion
Process starvation
Explanation - Imposing a strict ordering on resources prevents circular wait.
Correct answer is: Ordering resources
Q.21 The signal() operation in semaphore:
Decrements the counter
Increments the counter
Blocks a process
Terminates a process
Explanation - signal() increases the semaphore value and may wake up a blocked process.
Correct answer is: Increments the counter
Q.22 Which of the following is an example of non-preemptive resource allocation?
CPU scheduling
Mutex locks
Memory paging
Round Robin
Explanation - Mutex locks cannot be preempted; they must be released voluntarily by the process.
Correct answer is: Mutex locks
Q.23 The 'no preemption' condition means:
Resources cannot be forcibly taken
Resources can be shared freely
Processes can be paused
Only one process runs at a time
Explanation - In deadlock conditions, once a process acquires a resource, it cannot be preempted.
Correct answer is: Resources cannot be forcibly taken
Q.24 Which of these is a hardware solution to the critical section problem?
Test-and-Set
Peterson’s Algorithm
Semaphores
Monitors
Explanation - Test-and-Set is a hardware instruction used to achieve mutual exclusion.
Correct answer is: Test-and-Set
Q.25 Which scheduling approach may cause starvation?
FIFO
Round Robin
Priority Scheduling
Banker’s Algorithm
Explanation - In priority scheduling, lower-priority processes may starve if higher-priority ones always arrive.
Correct answer is: Priority Scheduling
