Concurrency Patterns Scenario Quiz

Q1. In a networked printing system, multiple users submit print jobs that are placed in a queue, while a single printer processes them one at a time. Which concurrency pattern does this illustrate?




Q2. A search service distributes a user query to five back-end services in parallel, then waits for all to return before combining the results. Which pattern is at work?




Q3. A high-traffic web server uses a fixed set of worker threads that pull incoming HTTP requests from a queue instead of spawning a new thread per request. What pattern is this?




Q4. A mobile app launches three network requests asynchronously and immediately returns control to the UI, receiving placeholder objects for the eventual results. Which concept is being used?




Q5. An IoT analytics pipeline streams events through filter, transform, and publish stages with built-in backpressure to slow intake if the dashboard lags. Which pattern fits?




Q6. A financial system logs every transaction as an immutable event and rebuilds account balances by replaying those events. What architectural pattern is this?




Q7. After repeated failures calling a remote Payment service, an Order service stops calling it for a cooldown period, then retries later. Which pattern is applied?




Q8. A public API limits each client to 100 requests per second; excess requests are denied or delayed. Which concurrency control mechanism is this?




Q9. Two threads must write to the same config file; only one may write at a time, forcing the other to wait. Which synchronization primitive is used?




Q10. An image-processing service allows at most four concurrent processing threads; a fifth must wait until a permit frees up. What primitive enforces this?




Q11. In a multiplayer game, each character has its own mailbox and state; characters communicate only by sending messages to each other’s inboxes. Which model is this?




Q12. An e-commerce site places new orders on a persistent queue; a separate service pulls and processes them asynchronously. What integration pattern is this?




Q13. A sports news broker delivers category-tagged updates (e.g., 'soccer') to all user devices subscribed to that category. Which communication pattern is being used?




Q14. A cache supports dozens of concurrent readers but grants exclusive access to any thread that needs to update the cache. What type of lock is this?




Q15. A matrix computation splits into four sub-tasks run in parallel on separate cores, then merges results into the final answer. Which pattern applies?




Q16. An object’s methods are guarded so that only one thread can execute any method at a time; threads may wait inside until signaled when a condition is met. What is this construct?




Q17. In a parallel traffic simulation, threads must all reach the end of a time step before any can start the next step. What synchronization mechanism is this?




Q18. A chat server manages thousands of connections with a single thread that waits for I/O readiness events and dispatches handlers without blocking. Which pattern does this represent?




Q19. A booking system dedicates separate thread pools to flight and hotel services so slowness in one cannot consume resources needed by the other. Which pattern provides this isolation?




Q20. A high-frequency trading app increments a shared counter using atomic compare-and-swap operations without locks; threads that clash simply retry until success. What technique is this?




design-patterns