Linux Interview Questions and Answers on IPC for Freshers

https://www.computersprofessor.com/2018/08/linux-interview-questions-and-answers_3.html
1. Which is true regarding pipes?
a) half duplex
b) full duplex
c) message boundaries are preserved
d) unordered data
Answer: a
2. The persistancy of a FIFO is
a) process
b) kernel
c) file system
d) none of the mentioned
Answer: c
3. Advantage of FIFO over pipe is
a) related processes can communicate
b) unrelated processes can communicate
c) all of the mentioned
d) none of the mentioned
Answer: b
4. What mkfifo() creats?
a) pipe
b) unnamed pipe
c) named pipe
d) msg queue
Answer: c
5. System V IPC common attributes are
a) key
b) id
c) owner
d) all of the mentioned
Answer: d
6. Which one of the following is not system V IPC ?
a) Shared Memory
b) Semaphores
c) FIFO
d) Message Queues
Answer: c
7. Which system call is used to create Sys V message Queue.
a) msgget
b) shemget
c) semget
d) msgctl
Answer: a
8. Which is not the correct option for removing a message queue
a) ipcrm -Q
b) ipcrm -q
c) ipcrm -m
d) none of the mentioned
Answer: c
9. Message queues are created in
a) userspace
b) kernelspace
c) userspace & kernelspace
d) none of the mentioned
Answer: b
10. A communication end-point is identified by
a) ip address
b) port number
c) both IP address and port number
d) none of the mentioned
Answer: c
11. Command used to check shared memory is
a) ipcs
b) ipcs -m
c) ipcs -s
d) ipcs -q
Answer: b
12. Which is Fastest IPC?
a) Message Queue
b) shared memory
c) Socket
d) All of the mentioned
Answer: b
13. What is the persistancy level of Shared memory segments?
a) signal
b) process
c) file system
d) kernel
Answer: d
14. The structure which keeps the information about shared memory in the kernel is
a) struct ipc_perm
b) struct semid_ds
c) struct shmid_ds
d) struct msgid_ds
Answer: c
15. One process requires M resource to complete a job. What should be the minimum number of resources available for N processes so that at least one process can continue to execute without blocking/waiting?
a) M * N
b) M * N – 1
c) M * N + 1
d) M
Answer: d
16. Semaphore P( ) operation usually does the following:
a) descrements the semaphore count and the process sleeps if needed
b) increments the semaphore count
c) wakes up a sleeping process
d) none of the mentioned
Answer: a
17. Which call to use to set the resource count of semaphore?
a) semget( )
b) semctl( )
c) sem_setcount( )
d) sem_set_count( )
Answer: d
18. Race condition can be avoided by using
a) semaphore
b) mutex
c) socket
d) both semaphore & mutex
Answer: d
19. A server which is handling one client at a time is called as
a) single server
b) multiserver
c) concurrent server
d) iterative server
Answer: d
20. A server which is handling many clients at a time is called as
a) single server
b) multiserver
c) concurrent server
d) iterative server
Answer: c