Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Lec3_ Part3 (Interprocess Communication Quiz)

Total questions: 22

Worksheet time: 11hrs 0mins

Name
Class
Date
1.

What is the main reason for using Interprocess Communication (IPC)?

a)

To reduce memory usage

b)

To allow processes to communicate and coordinate actions

c)

To avoid system calls

d)

To enable direct file access

2.

In a cooperating process system, which of the following is NOT a reason for cooperation?

a)

Information sharing

b)

Computation speedup

c)

Deadlock creation

d)

Modularity

3.

Which IPC method uses a common memory region for communication?

a)

Message passing

b)

Shared memory

c)

Signals

d)

Ports

4.

Which system call is used in POSIX to create or open a shared memory segment?

a)

open()

b)

fork()

c)

shm_open()

d)

mmap()

5.

What does mmap() do in the context of shared memory?

a)

Deletes memory

b)

Writes directly to disk

c)

Maps shared memory into the process address space

d)

Encrypts shared data

6.

What is a mailbox in message passing?

a)

A physical address

b)

A logical channel with a unique ID

c)

A shared disk partition

d)

A CPU register

7.

Which type of link in IPC allows only one direction of communication?

a)

Unidirectional

b)

Bidirectional

c)

Symmetrical

d)

Multiplexed

8.

In POSIX shared memory, what does ftruncate() do?

a)

Truncates a file

b)

Maps memory

c)

Sets the size of the shared memory object

d)

Unlinks the shared memory

9.

What does a 'handle' represent in Windows IPC?

a)

The actual data

b)

A reference to a port or resource

c)

A user password

d)

A thread ID

10.

What is the first step in a Local Procedure Call (LPC) in Windows?

a)

Client sends a connection request

b)

Server creates a shared object

c)

Client writes to shared memory

d)

Server sends a signal

11.

What is the correct solution to a race condition?

a)

Delete one process

b)

Use synchronization techniques like semaphores or mutexes

c)

Increase memory size

d)

Assign processes to different CPUs

12.

In direct communication, what must be true?

a)

Processes must know each other’s IDs

b)

All communication goes through a server

c)

Shared memory must be mapped

d)

Communication is always one-way

13.

Which of the following is true about shared memory?

a)

It works best over a network

b)

It requires processes to coordinate access manually

c)

It is slower than message passing

d)

It uses sockets for communication

14.

In POSIX, which function maps shared memory into a process's address space?

a)

shm_read()

b)

mmap()

c)

ptr_map()

d)

shm_link()

15.

What best defines a race condition?

a)

When a process monopolizes the CPU

b)

When processes communicate too quickly

c)

When multiple processes access shared data and the final result depends on timing

d)

When processes use different ports

16.

What is a key advantage of shared memory over message passing?

a)

It’s faster because it avoids kernel involvement

b)

It supports remote processes

c)

It uses less memory

d)

It uses file descriptors

17.

Which scenario is most likely to lead to a race condition?

a)

Processes using mailboxes

b)

Two threads incrementing a shared variable without synchronization

c)

Independent processes printing to screen

d)

Processes accessing separate files

18.

Why are race conditions dangerous?

a)

They waste memory

b)

They lead to unpredictable or incorrect results

c)

They improve process speed

d)

They are needed for message passing

19.

In message passing IPC, which component ensures messages are sent to the right recipient?

a)

Mailbox (or port)

b)

CPU

c)

Cache

d)

Socket buffer

20.

Why must synchronization be used in shared memory IPC?

a)

To protect the system from power loss

b)

To prevent race conditions and ensure data consistency

c)

To delay message transmission

d)

To allow mailbox usage

21.

Which of the following is NOT a property of a communication link?

a)

Unidirectional or bidirectional

b)

Always encrypted

c)

May be established only if a shared mailbox exists

d)

Can be between many processes

22.

What is an advantage of message passing over shared memory?

a)

It’s always faster

b)

It automatically synchronizes communication

c)

It doesn’t support bidirectional links

d)

It avoids using system calls