Inter-Process Communication (IPC) — Concept Check
Questions on Inter-Process Communication (IPC). IPC mechanisms — pipes, message queues, shared memory, and sockets — allow processes to exchange data, each with different trade-offs in speed, complexity, and synchronization requirements.
Questions in this quiz
8 questions on Inter-Process Communication (IPC) — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A developer is using shared memory for IPC to speed up data processing between two processes. What must they ensure to avoid race conditions?
- AUse message queues instead
- BRely on the kernel to handle synchronization
- CUse semaphores or mutexes for synchronization
- DImplement a custom locking mechanism
2.A team is developing a client-server application that needs to communicate over a local network. Which IPC mechanism should they use for optimal performance?
- AUnix domain sockets
- BMessage queues
- CTCP sockets
- DNamed pipes
3.Two unrelated processes need to communicate in a unidirectional manner. Which IPC mechanism is appropriate?
- AShared memory
- BSockets
- CAnonymous pipes
- DNamed pipes (FIFOs)
4.A developer notices that their message queue-based application is slower than expected. What could be a reason for this?
- AMessage queues involve data copying through the kernel
- BSockets are always faster than message queues
- CShared memory is inherently slower
- DMessage queues lack synchronization
5.A Java application uses ProcessBuilder for IPC. What underlying mechanism is being utilized?
- AShared memory
- BSockets
- CAnonymous pipes
- DNamed pipes
6.A developer chooses shared memory for IPC due to its speed. What is a potential downside they must manage?
- AData is copied through the kernel
- BExplicit synchronization is required
- CIt is always slower than message queues
- DIt only works across networks
7.A software engineer is deciding between using message queues and shared memory for a high-throughput data pipeline. Which should they choose and why?
- ASockets for network flexibility
- BShared memory for zero-copy speed
- CMessage queues for built-in synchronization
- DNamed pipes for unrelated process communication
8.A developer is using Unix domain sockets in a Java 16+ application. What is a key advantage over TCP sockets?
- AInherent synchronization
- BSupports cross-network communication
- CFaster communication due to no network stack overhead
- DBetter for unrelated process communication