Skip to main content

Operating System MCQs with Answers

Practice important Operating System MCQs with answers and explanations.

Chapter: 24
Q621:
wait(mutex); readcount--; if(readcount == 0) signal(wrt); signal(mutex); is the code for ______.
A. reader entry
B. writer entry
C. reader exit
D. writer exit
Correct Answer: C
Chapter: 24
Q622:
In bounded buffer problem, if no empty buffer is available, the producer must ______.
A. wait on full
B. wait on empty
C. signal full
D. signal mutex
Correct Answer: B
Chapter: 24
Q623:
In readers-writers problem, if a writer is writing, readers must ______.
A. continue reading
B. wait
C. signal mutex
D. increment readcount
Correct Answer: B
Chapter: 24
Q624:
Which of the following causes deadlock in Dining Philosophers?
A. random access
B. picking both chopsticks simultaneously
C. picking one chopstick at a time without release
D. picking chopstick randomly
Correct Answer: C
Chapter: 24
Q625:
In Dining Philosophers, what happens if all philosophers pick up left chopstick simultaneously?
A. eat together
B. starvation
C. deadlock
D. free chopsticks
Correct Answer: C
Chapter: 24
Q626:
Semaphores are primarily used for ______.
A. memory allocation
B. mutual exclusion and synchronization
C. data processing
D. sorting arrays
Correct Answer: B
Chapter: 24
Q627:
If a counting semaphore’s C < 0 after wait operation, the process must ______.
A. signal S2
B. wait S2
C. signal S1
D. wait S1
Correct Answer: B
Chapter: 24
Q628:
In bounded buffer problem, 'full' semaphore is incremented when ______.
A. item is consumed
B. item is produced
C. buffer is cleared
D. buffer is destroyed
Correct Answer: B
Chapter: 24
Q629:
Dining philosophers problem is a representation of ______.
A. concurrency problems
B. memory leaks
C. code duplication
D. sorting issues
Correct Answer: A
Chapter: 24
Q630:
The structure ‘do { wait(chopstick[i]); wait(chopstick[(i+1)%5]); eat; signal(chopstick[i]); signal(chopstick[(i+1)%5]); think; }’ belongs to ______.
A. Reader process
B. Writer process
C. Philosopher process
D. Producer process
Correct Answer: C
Chapter: 24
Q631:
Which synchronization primitive is used in the readers-writers solution?
A. Lock
B. Barrier
C. Semaphore
D. Monitor
Correct Answer: C
Chapter: 25
Q632:
In the Dining Philosophers problem, allowing at most how many philosophers to sit simultaneously helps avoid deadlock?
A. 3
B. 4
C. 5
D. 6
Correct Answer: B
Chapter: 25
Q633:
In the asymmetric solution to the Dining Philosophers problem, odd philosophers pick up their ________ chopstick first.
A. right
B. left
C. either
D. both
Correct Answer: B
Chapter: 25
Q634:
High-level synchronization constructs help solve problems related to ________.
A. memory management
B. process scheduling
C. deadlock and starvation
D. file management
Correct Answer: C
Chapter: 25
Q635:
In critical region synchronization, the shared variable is declared with the keyword ________.
A. public
B. shared
C. private
D. global
Correct Answer: B
Chapter: 25
Q636:
The syntax to access a critical region includes the keyword ________.
A. sector
B. domain
C. region
D. area
Correct Answer: C
Chapter: 25
Q637:
In a critical region, the boolean expression B governs the ________.
A. speed of execution
B. access to the region
C. memory allocation
D. CPU time
Correct Answer: B
Chapter: 25
Q638:
In the critical region, if B is false, what happens?
A. Process enters the region
B. Process waits
C. Process terminates
D. Process duplicates
Correct Answer: B
Chapter: 25
Q639:
What type of variable structure is used in the bounded buffer solution?
A. stack
B. queue
C. struct buffer
D. array
Correct Answer: C
Chapter: 25
Q640:
The producer inserts a new item into the shared buffer when ________.
A. count = n
B. count < n
C. count > n
D. count = 0
Correct Answer: B

Test Your Knowledge

Take a timed quiz on Operating System

🚀 Start Quiz Now