Operating System MCQs with Answers
Practice important Operating System MCQs with answers and explanations.
Chapter: 26
Q681:
Starvation in dining philosophers means ________.
A. philosopher never gets to eat
B. philosopher sleeps
C. philosopher always eats first
D. philosopher eats once
Correct Answer:
A
Chapter: 26
Q682:
If all philosophers pick the right chopstick first, ________ occurs.
A. starvation
B. deadlock
C. parallelism
D. preemption
Correct Answer:
B
Chapter: 26
Q683:
In resource allocation graphs, what does an edge from Rj to Pi signify?
A. Pi waiting for Rj
B. Rj allocated to Pi
C. Pi denied Rj
D. Rj deleted by Pi
Correct Answer:
B
Chapter: 26
Q684:
A system model must satisfy ________ to ensure correct resource handling.
A. resource preemption
B. resource partition
C. process duplication
D. unlimited resource request
Correct Answer:
B
Chapter: 26
Q685:
System resources like CPU cycles and disk drives are examples of ________.
A. resource classes
B. instances
C. deadlocks
D. preemption
Correct Answer:
A
Chapter: 26
Q686:
The sequence used by a process when utilizing a resource is _______.
A. Use → Request → Release
B. Request → Use → Release
C. Release → Request → Use
D. Use → Release → Request
Correct Answer:
B
Chapter: 26
Q687:
In deadlock characterization, the "Hold and Wait" condition implies _______.
A. processes hold one resource only
B. processes wait without holding any resource
C. processes hold one and wait for others
D. processes release all resources while waiting
Correct Answer:
C
Chapter: 26
Q688:
The initial state of all philosophers in init() function is _______.
A. eating
B. thinking
C. hungry
D. waiting
Correct Answer:
B
Chapter: 26
Q689:
In the deadlock example with semaphores, which two semaphores are used?
A. A and C
B. A and B
C. B and D
D. A and D
Correct Answer:
B
Chapter: 26
Q690:
In the dining philosophers monitor code, the function pickup(int i) does what?
A. Releases chopsticks
B. Picks up one chopstick
C. Tries to eat or waits
D. Signals neighbor
Correct Answer:
C
Chapter: 26
Q691:
A philosopher can set state[i] = eating only if _________.
A. neighbors are eating
B. both neighbors are not eating
C. right neighbor is eating
D. at least one neighbor is eating
Correct Answer:
B
Chapter: 26
Q692:
In resource allocation graphs, nodes represent _______.
A. only processes
B. only resources
C. processes and resources
D. only CPU states
Correct Answer:
C
Chapter: 26
Q693:
In deadlock prevention, ensuring no circular wait is called _______.
A. preemption
B. resource ordering
C. starvation
D. mutual exclusion
Correct Answer:
B
Chapter: 26
Q694:
Deadlocks involve processes waiting for ________ held by others.
A. unused resources
B. released resources
C. resources
D. destroyed resources
Correct Answer:
C
Chapter: 26
Q695:
In the resource allocation graph example, P2 is waiting for which resource?
A. R1
B. R2
C. R3
D. R4
Correct Answer:
C
Chapter: 26
Q696:
In the deadlock condition "No Preemption", processes _______.
A. forcibly release resources
B. release resources voluntarily
C. never release resources
D. share resources
Correct Answer:
B
Chapter: 26
Q697:
A resource instance is considered identical if _______.
A. it cannot be replaced
B. any instance satisfies a request
C. it’s the only one
D. it must be shared
Correct Answer:
B
Chapter: 26
Q698:
How many types of vertices are there in the resource allocation graph?
A. 1
B. 2
C. 3
D. 4
Correct Answer:
B
Chapter: 26
Q699:
Which is NOT a necessary condition for a deadlock?
A. Hold and wait
B. Circular wait
C. Mutual exclusion
D. Resource duplication
Correct Answer:
D
Chapter: 27
Q700:
What are the three general methods of handling deadlocks?
A. Prevention, Avoidance, Recovery
B. Allocation, Release, Prevention
C. Holding, Waiting, Release
D. Communication, Prevention, Resource Sharing
Correct Answer:
A