Free Practice Quiz Question List

2 Processes and Interprocess Communication Online Quiz Questions

Use this free practice quiz with 20 questions to review 2 Processes and Interprocess Communication, test your knowledge, and prepare for your next test or exam.

20 questions
01
True or false
1 point

True or false: A process is passive code stored on a device, while a program is the code in execution.

  1. A

    True

  2. B

    False

02
Choose one
1 point

A process has requested input and cannot continue until that input arrives. Which state is it in?

  1. A

    Ready

  2. B

    Blocked

  3. C

    Running

  4. D

    Terminated

03
True or false
1 point

True or false: When a process calls an exec function, it continues to exist while its program image is replaced.

  1. A

    True

  2. B

    False

04
Fill in the blank
1 point

In a common Unix-like process pattern, creates a child process, and replaces the current program image with a different program.

05
Written response
1 point

What is the term for a child process that has terminated but whose parent has not yet collected its status?

06
Choose one
1 point

A shell connects a producer's output directly to a consumer's input through a byte stream. Which IPC mechanism is being used?

  1. A

    Pipe

  2. B

    Message queue

  3. C

    Shared memory

  4. D

    Signal

07
Choose all
1 point

Which of the following are message-passing IPC mechanisms? Select all that apply.

  1. A

    Pipes

  2. B

    Shared memory

  3. C

    Message queues

  4. D

    Semaphores

  5. E

    Sockets

  6. F

    Named pipes (FIFOs)

08
Written response
1 point

On Linux, what technique is initially used for a child's memory after fork(), instead of immediately copying every memory page?

09
Choose one
1 point

A running process is preempted because its time slice ends. Which state may it move to next?

  1. A

    Blocked

  2. B

    Ready

  3. C

    Terminated

  4. D

    New

10
Fill in the blank
1 point

Signals are primarily used for , rather than for transferring large amounts of data.

11
Choose all
1 point

Which statements about shared memory are accurate? Select all that apply.

  1. A

    Processes map the same memory region into their address spaces.

  2. B

    The operating system passes each data item through a message channel.

  3. C

    Processes exchange data by reading and writing the shared region.

  4. D

    Synchronization may be needed to avoid conflicting updates.

  5. E

    It cannot be used for frequent exchanges.

12
Choose one
1 point

On a Unix-like system, which operation can a parent use to collect a terminated child's exit status and allow remaining bookkeeping to be released?

  1. A

    exec()

  2. B

    fork()

  3. C

    wait() or waitpid()

  4. D

    A pipe read

13
Choose one
1 point

Two processes on the same machine need a socket-based communication mechanism designed for local communication. Which should they use?

  1. A

    Network sockets only

  2. B

    Unix-domain sockets

  3. C

    Message queues

  4. D

    Signals

14
Open ended
1 point

A system must transfer large amounts of data frequently between processes. Compare message passing with shared memory for this use case, and identify an important coordination requirement for the approach that uses a shared region.

15
True or false
1 point

A process waiting for input cannot continue until that input arrives. In the common process-state model, is the process blocked while it waits?

  1. A

    True

  2. B

    False

16
Choose one
1 point

A running process has more work to do, but the scheduler ends its time slice so another process can use the CPU. Which state should the first process enter?

  1. A

    Blocked, because preemption means the process is waiting for an event.

  2. B

    Ready, because it can run again but must wait for CPU time.

  3. C

    Terminated, because its time slice has ended.

  4. D

    New, because the scheduler must create it again.

17
Choose one
1 point

A child process calls an exec function after being created with fork(). Which outcome describes what happens to the child?

  1. A

    The parent process is terminated and replaced by the new program.

  2. B

    A new PID is assigned to the child, while its original program keeps running.

  3. C

    The process continues, but its program image is replaced by the new program.

  4. D

    The new program is started as a thread in the parent process.

18
Written response
1 point

A process has everything it needs to continue, but the CPU is currently running another process. In the common process-state model, what state is it in?

19
Choose one
1 point

A shell must connect one program's output directly to another program's input as a stream of bytes. Which IPC mechanism best fits this design?

  1. A

    A pipe, which carries a byte stream from a write end to a read end.

  2. B

    A signal, which transfers the producer's complete output as data.

  3. C

    A process identifier, which carries output between programs.

  4. D

    A semaphore, which stores the producer's output for the consumer.

20
Written response
1 point

On a Unix-like system, which system call can a parent use to collect a terminated child's exit status? Give one common call name.