Skip to main content

Operating System MCQs with Answers

Practice important Operating System MCQs with answers and explanations.

Chapter: 25
Q661:
In monitors, while one process is active, others ________.
A. leave the monitor
B. wait outside
C. suspend themselves
D. get terminated
Correct Answer: B
Chapter: 25
Q662:
Deadlock prevention ensures that at least one of the necessary conditions for deadlock is ________.
A. satisfied
B. reinforced
C. removed
D. increased
Correct Answer: C
Chapter: 25
Q663:
In monitors, the ________ rule applies to variables declared within functions.
A. global
B. local scope
C. concurrent
D. parallel
Correct Answer: B
Chapter: 25
Q664:
A semaphore uses ________ operations for synchronization.
A. wait and signal
B. lock and unlock
C. connect and disconnect
D. fetch and update
Correct Answer: A
Chapter: 25
Q665:
If the process waits outside the monitor due to a condition variable, what must happen for it to proceed?
A. Signal is invoked
B. Wait is reset
C. Mutex is removed
D. Deadlock occurs
Correct Answer: A
Chapter: 26
Q666:
In monitor-based solution, a philosopher can pick up chopsticks only if _________.
A. both are available
B. one is available
C. neighbor is hungry
D. monitor allows
Correct Answer: A
Chapter: 26
Q667:
In the dining philosophers problem, a philosopher's state can be _______.
A. thinking, sleeping, eating
B. thinking, hungry, eating
C. eating, coding, sleeping
D. eating, requesting, blocked
Correct Answer: B
Chapter: 26
Q668:
In the code, how many condition variables are declared for philosophers?
A. 2
B. 3
C. 4
D. 5
Correct Answer: D
Chapter: 26
Q669:
What operation must a philosopher call before eating in the monitor-based solution?
A. putdown(i)
B. pickup(i)
C. eat(i)
D. wait(i)
Correct Answer: B
Chapter: 26
Q670:
In deadlock, which condition states a resource is held by one process at a time?
A. Circular Wait
B. No Preemption
C. Hold and Wait
D. Mutual Exclusion
Correct Answer: D
Chapter: 26
Q671:
Deadlock can occur if the system has ________.
A. a cycle in resource allocation graph
B. no cycles
C. starved processes
D. completed processes
Correct Answer: A
Chapter: 26
Q672:
In resource allocation graph, a directed edge from Pi to Rj means ________.
A. Pi is using Rj
B. Pi released Rj
C. Pi requested Rj
D. Pi blocked Rj
Correct Answer: C
Chapter: 26
Q673:
The deadlock problem occurs when ________.
A. all processes complete execution
B. processes wait indefinitely for resources
C. processes release resources early
D. processes do not request resources
Correct Answer: B
Chapter: 26
Q674:
How many instances are there of resource type R2 in the given example?
A. 1
B. 2
C. 3
D. 4
Correct Answer: B
Chapter: 26
Q675:
Which philosopher states are represented in the enum?
A. sleeping, hungry, coding
B. thinking, hungry, eating
C. requesting, thinking, blocked
D. waiting, eating, hungry
Correct Answer: B
Chapter: 26
Q676:
In the monitor dp, which function checks if a philosopher can eat?
A. pickup()
B. putdown()
C. test()
D. init()
Correct Answer: C
Chapter: 26
Q677:
Deadlock can happen if processes are stuck in a ________.
A. simple graph
B. tree
C. circular wait
D. resource pool
Correct Answer: C
Chapter: 26
Q678:
If no cycles are present in the resource allocation graph, then ________.
A. deadlock exists
B. starvation exists
C. deadlock does not exist
D. mutual exclusion fails
Correct Answer: C
Chapter: 26
Q679:
In dining philosophers, philosophers must invoke ________ after eating.
A. pickup
B. putdown
C. wait
D. signal
Correct Answer: B
Chapter: 26
Q680:
In deadlock characterization, resources cannot be forcibly removed due to ________.
A. hold and wait
B. circular wait
C. no preemption
D. mutual exclusion
Correct Answer: C

Test Your Knowledge

Take a timed quiz on Operating System

🚀 Start Quiz Now