Skip to main content

Operating System MCQs with Answers

Practice important Operating System MCQs with answers and explanations.

Chapter: 25
Q641:
The consumer removes an item from the shared buffer when ________.
A. count = 0
B. count < n
C. count > 0
D. count > n
Correct Answer: C
Chapter: 25
Q642:
In the producer's critical region, the buffer index 'in' is updated using which operation?
A. in = (in+1)%n
B. in = in-1
C. in = in+2
D. in = (in-1)%n
Correct Answer: A
Chapter: 25
Q643:
In the consumer's critical region, the item is retrieved from ________.
A. pool[in]
B. pool[out]
C. pool[count]
D. pool[nextc]
Correct Answer: B
Chapter: 25
Q644:
A monitor ensures that ________ process(es) can be active inside it at a time.
A. two
B. one
C. multiple
D. no
Correct Answer: B
Chapter: 25
Q645:
Monitor local data can be accessed only through ________.
A. global access
B. external functions
C. programmer-defined operators
D. semaphores
Correct Answer: C
Chapter: 25
Q646:
The syntax to declare a monitor begins with the keyword ________.
A. monitor
B. semaphore
C. buffer
D. mutex
Correct Answer: A
Chapter: 25
Q647:
Monitors can solve synchronization problems better when used with ________.
A. mutex variables
B. semaphores
C. condition variables
D. global variables
Correct Answer: C
Chapter: 25
Q648:
In monitors, a process invoking x.wait() will ________.
A. continue immediately
B. be suspended
C. terminate
D. execute signal
Correct Answer: B
Chapter: 25
Q649:
The operation x.signal() in a monitor resumes ________.
A. all waiting processes
B. one suspended process
C. no process
D. two processes
Correct Answer: B
Chapter: 25
Q650:
If no process is suspended, x.signal() has what effect?
A. Increments x
B. Terminates monitor
C. No effect
D. Destroys monitor
Correct Answer: C
Chapter: 25
Q651:
Signal operation on a condition variable differs from semaphore because it ________.
A. always increments
B. has no effect if no process is suspended
C. deletes the variable
D. creates a new monitor
Correct Answer: B
Chapter: 25
Q652:
Dining Philosophers problem is an example of ________.
A. resource allocation problem
B. process scheduling problem
C. memory management problem
D. deadlock handling problem
Correct Answer: D
Chapter: 25
Q653:
What kind of synchronization issue occurs if two fast philosophers repeatedly eat while others cannot?
A. Deadlock
B. Starvation
C. Race condition
D. Memory leak
Correct Answer: B
Chapter: 25
Q654:
In critical regions, if two processes try to access v simultaneously, execution becomes ________.
A. parallel
B. random
C. sequential
D. deadlocked
Correct Answer: C
Chapter: 25
Q655:
________ is a synchronization primitive that requires processes to wait or signal around a shared variable.
A. Semaphore
B. Monitor
C. Buffer
D. Struct
Correct Answer: A
Chapter: 25
Q656:
The expression used to define the bounded buffer struct is ________.
A. struct buffer {item pool[n]; int count,in,out;}
B. struct buffer (item pool[n]; count,in,out;)
C. buffer {item pool[n]; count,in,out;}
D. struct buffer {pool; in; out;}
Correct Answer: A
Chapter: 25
Q657:
A process must execute ________ before entering a critical section.
A. signal(mutex)
B. wait(mutex)
C. check(mutex)
D. monitor(mutex)
Correct Answer: B
Chapter: 25
Q658:
To leave a critical section, a process must execute ________.
A. wait(mutex)
B. signal(mutex)
C. monitor(mutex)
D. lock(mutex)
Correct Answer: B
Chapter: 25
Q659:
________ are errors caused due to improper usage of semaphores.
A. Syntax errors
B. Timing errors
C. Logical errors
D. Memory leaks
Correct Answer: B
Chapter: 25
Q660:
The condition construct in monitors is defined by the keyword ________.
A. state
B. condition
C. signal
D. wait
Correct Answer: B

Test Your Knowledge

Take a timed quiz on Operating System

🚀 Start Quiz Now