Operating System MCQs with Answers
Practice important Operating System MCQs with answers and explanations.
Multiple Choice Questions
Q161: What happens when a process exceeds its allocated resources in UNIX/Linux?
- A: Parent terminates the child
- B: The operating system will automatically terminate the process
- C: The parent waits for the process to finish
- D: Child process self-terminates
View Answer
B
Q162: Fill in the blank: The fork() system call allows a process to create a _______ process.
- A: Child
- B: Parent
- C: Helper
- D: Background
View Answer
A
Q163: Fill in the blank: The execlp system call in UNIX is used to load a _______ into the child’s memory.
- A: Binary file
- B: Program code
- C: Script
- D: File descriptor
View Answer
A
Q164: What does the wait() system call do in Unix/Linux?
- A: Suspends the calling process
- B: Terminates the calling process
- C: Changes the process ID
- D: Starts a new process
View Answer
A
Q165: Which system call is used to replace the process memory space in Unix/Linux?
- A: execlp()
- B: fork()
- C: wait()
- D: exit()
View Answer
A
Q166: What happens if all child processes have terminated before calling wait()?
- A: The parent process will wait indefinitely
- B: The parent process will terminate
- C: The parent process will return immediately
- D: The parent process will hang forever
View Answer
C
Q167: In the sample code shown, what function is used to check if the fork() system call fails?
- A: perror()
- B: exit()
- C: wait()
- D: printf()
View Answer
B
Q168: What is the typical use of the execlp() system call?
- A: To create a new process
- B: To terminate a process
- C: To replace the process memory
- D: To suspend the process
View Answer
C
Q169: The producer-consumer problem requires a __________ to store produced items.
- A: queue
- B: stack
- C: buffer
- D: tree
View Answer
C
Q170: In the producer-consumer problem, what condition indicates that the buffer is full?
- A: in == out
- B: (in + 1) % BUFFER_SIZE == out
- C: in > out
- D: in > BUFFER_SIZE
View Answer
B