Skip to main content

Operating System MCQs with Answers

Practice important Operating System MCQs with answers and explanations.

Multiple Choice Questions

Q171: Which system call suspends the calling process until a child terminates?
  • A: wait()
  • B: exec()
  • C: fork()
  • D: exit()
View Answer
A

Q172: What does the function execlp() replace in a process?
  • A: The process memory space
  • B: The process ID
  • C: The process parent
  • D: The process stack
View Answer
A

Q173: What is the result of a successful execlp() system call?
  • A: It creates a new process
  • B: It terminates the calling process
  • C: It replaces the process image
  • D: It suspends the calling process
View Answer
C

Q174: In the producer-consumer example, what is used to synchronize the producer and consumer?
  • A: Semaphore
  • B: Mutex
  • C: Shared buffer
  • D: Process priority
View Answer
C

Q175: What is the main benefit of cooperating processes?
  • A: To execute independently
  • B: To share information and resources
  • C: To increase process priority
  • D: To run faster by using less CPU
View Answer
B

Q176: The producer-consumer problem assumes a fixed-size buffer in the __________ version.
  • A: bounded buffer
  • B: unbounded buffer
  • C: dynamic buffer
  • D: circular buffer
View Answer
A

Q177: The exec() system call is used in conjunction with which other system call?
  • A: fork()
  • B: wait()
  • C: exit()
  • D: exec()
View Answer
A

Q178: In the code shown, what system call does the child process use after fork()?
  • A: exec()
  • B: fork()
  • C: wait()
  • D: exit()
View Answer
A

Q179: What is the role of the 'in' variable in the producer-consumer problem?
  • A: To point to the next full position in the buffer
  • B: To point to the next empty position in the buffer
  • C: To track the buffer size
  • D: To track the buffer content
View Answer
B

Q180: What will happen if the condition "in == out" is true in the producer process?
  • A: The producer will continue producing items
  • B: The producer will stop producing items
  • C: The producer will wait until space is available
  • D: The producer will reset the buffer
View Answer
C

Test Your Knowledge

Take a timed quiz on Operating System

🚀 Start Quiz Now