Skip to main content

Operating System MCQs with Answers

Practice important Operating System MCQs with answers and explanations.

Multiple Choice Questions

Q201: In the context of UNIX/Linux IPC, which system call is used to close a file descriptor?
  • A: read()
  • B: write()
  • C: close()
  • D: fork()
View Answer
C

Q202: A link in direct communication is associated with ______.
  • A: More than two processes
  • B: Exactly two processes
  • C: A mailbox
  • D: A shared memory
View Answer
B

Q203: The pipe() system call returns how many file descriptors?
  • A: One
  • B: Two
  • C: Three
  • D: Four
View Answer
B

Q204: In indirect communication, messages are sent to a ______.
  • A: Process
  • B: Mailbox
  • C: Shared memory
  • D: File descriptor
View Answer
B

Q205: The sender in a blocking send scenario will ______.
  • A: Wait until the message is received
  • B: Continue its operation immediately
  • C: Block until the message is written
  • D: Not block, even if the message is not received
View Answer
A

Q206: Which of the following is true about asynchronous communication in IPC?
  • A: The sender does not wait for the receiver
  • B: The sender waits for the receiver to acknowledge
  • C: Both sender and receiver must block
  • D: Communication only occurs when the queue is full
View Answer
A

Q207: In the sample code provided, what happens when the child process writes to the pipe?
  • A: The parent process reads from the pipe
  • B: The child process reads from the pipe
  • C: Both processes write to the pipe simultaneously
  • D: The pipe gets closed automatically
View Answer
A

Q208: What is the maximum number of bytes that can be written to a pipe in UNIX/Linux without blocking?
  • A: PIPE_BUF
  • B: 1024 bytes
  • C: 4096 bytes
  • D: 5120 bytes
View Answer
A

Q209: The pipefd[1] descriptor in UNIX/Linux IPC is used for ______.
  • A: Reading from the pipe
  • B: Writing to the pipe
  • C: Closing the file descriptor
  • D: Receiving messages from the parent process
View Answer
B

Q210: Which of the following is an example of a synchronization method used in IPC?
  • A: Blocking send
  • B: Shared memory
  • C: Named pipe
  • D: Pipe
View Answer
A

Test Your Knowledge

Take a timed quiz on Operating System

🚀 Start Quiz Now