Skip to main content

Operating System MCQs with Answers

Practice important Operating System MCQs with answers and explanations.

Chapter: 23
Q581:
Statement B in Pj executes only after statement A in Pi using _______.
A. Memory locks
B. Signal and wait on semaphore
C. Deadlock prevention
D. Resource pooling
Correct Answer: B
Chapter: 23
Q582:
Deadlocks in real life can be seen in _______.
A. Database transactions
B. Traffic jams
C. Network protocols
D. Email communications
Correct Answer: B
Chapter: 23
Q583:
What must happen when a process finishes executing a critical section?
A. Execute wait again
B. Execute signal operation
C. Execute block
D. Free memory
Correct Answer: B
Chapter: 23
Q584:
The violation of mutual exclusion can be prevented by using ______ constructs.
A. Semaphore
B. Critical region
C. Database lock
D. Message passing
Correct Answer: B
Chapter: 23
Q585:
In the wait operation, S.value is ______ before checking if it is less than 0.
A. Increased
B. Decreased
C. Multiplied
D. Cleared
Correct Answer: B
Chapter: 23
Q586:
In a correct semaphore design, wait(S) and signal(S) must be used ______.
A. At random
B. Carefully and consistently
C. Only once
D. In isolation
Correct Answer: B
Chapter: 23
Q587:
In deadlock, each process is waiting for ______.
A. CPU time
B. A resource held by another process
C. Memory allocation
D. Termination signal
Correct Answer: B
Chapter: 23
Q588:
Semaphore 'signal' operation wakes up ______.
A. All processes
B. One blocked process
C. Random process
D. No process
Correct Answer: B
Chapter: 23
Q589:
Starvation can be avoided by ensuring ______.
A. Limited resources
B. Fair resource allocation
C. Critical region violation
D. Semaphore value negative
Correct Answer: B
Chapter: 23
Q590:
The struct for semaphore contains a value and ______.
A. Thread ID
B. List of processes
C. Memory block
D. CPU ID
Correct Answer: B
Chapter: 23
Q591:
Spinlocks are effective when critical sections are held for ______ periods.
A. Long
B. Short
C. Infinite
D. Irregular
Correct Answer: B
Chapter: 23
Q592:
Semaphore struct in code contains an int value and a pointer to ______.
A. Process structure
B. Semaphore lock
C. Critical section
D. Kernel memory
Correct Answer: A
Chapter: 23
Q593:
When a blocked process is awakened, it moves to the ______ queue.
A. Waiting
B. Ready
C. Execution
D. Scheduling
Correct Answer: B
Chapter: 23
Q594:
A process that is blocked must wait until another process executes ______ operation.
A. signal(S)
B. wait(S)
C. block()
D. wakeup()
Correct Answer: A
Chapter: 23
Q595:
In a deadlock example, P0 waits for ______ and P1 waits for ______.
A. Q, S
B. S, Q
C. S, S
D. Q, Q
Correct Answer: A
Chapter: 23
Q596:
Busy waiting is also called ______.
A. Sleeping
B. Spinning
C. Blocking
D. Scheduling
Correct Answer: B
Chapter: 24
Q597:
What are the two types of semaphores?
A. binary and counting
B. mutex and counting
C. mutex and binary
D. shared and mutual
Correct Answer: A
Chapter: 24
Q598:
In a binary semaphore, the maximum value allowed is ______.
A. 2
B. 1
D. unlimited
Correct Answer: B
Chapter: 24
Q599:
In a counting semaphore, the integer value can range over ______.
A. 0 and 1 only
B. unlimited range
C. negative values only
D. only positive numbers
Correct Answer: B
Chapter: 24
Q600:
In bounded buffer problem, the semaphore 'empty' is initialized to _____.
A. 1
B. n
D. -1
Correct Answer: B

Test Your Knowledge

Take a timed quiz on Operating System

🚀 Start Quiz Now