Operating System MCQs with Answers
Practice important Operating System MCQs with answers and explanations.
Multiple Choice Questions
Q181: In the producer-consumer problem, what does the "out" variable represent?
- A: The next available slot for a consumer
- B: The next available slot for a producer
- C: The buffer size
- D: The producer's current position
View Answer
A
Q182: In the given code, which system call is used to check if execlp() fails?
- A: exit()
- B: perror()
- C: wait()
- D: printf()
View Answer
B
Q183: The fork() system call creates a __________ process.
- A: Child
- B: Parent
- C: New
- D: Zombie
View Answer
A
Q184: What happens when a process calls wait() with no child processes to wait for?
- A: It waits indefinitely
- B: It terminates the process immediately
- C: It returns immediately
- D: It returns after a delay
View Answer
C
Q185: In the code example provided, if the fork() fails, what does the parent process do?
- A: It creates a new process
- B: It terminates the process
- C: It prints an error message
- D: It executes wait()
View Answer
B
Q186: What is the function of a message passing system in Interprocess Communication (IPC)?
- A: To allow processes to communicate
- B: To share memory between processes
- C: To control the flow of processes
- D: To sync processes without using shared address space
View Answer
A
Q187: Which of the following is NOT a common IPC tool in UNIX/Linux?
- A: Pipe
- B: Named Pipe (FIFO)
- C: Message Queue
- D: Semaphore
View Answer
D
Q188: What does direct communication in IPC require?
- A: A shared mailbox between processes
- B: Explicit naming of recipient/sender
- C: A link established by the operating system
- D: An indirect buffer storage
View Answer
B
Q189: Which of the following describes blocking send in IPC?
- A: The sender continues immediately after sending
- B: The sender is blocked until the receiver gets the message
- C: The sender writes the message to a file
- D: The sender never blocks
View Answer
B
Q190: The UNIX/Linux pipe() system call is used for ______.
- A: Establishing a two-way communication channel
- B: Creating a communication link between two processes
- C: Creating a temporary file for process I/O
- D: Connecting standard input and output of different processes
View Answer
B