You are responsible for a service that authenticates requests, writes audit events, and triggers downstream notifications across several internal systems. Some paths block on immediate responses while others enqueue work and continue after acknowledgment. A recent incident showed that a failed downstream call was retried inconsistently, making it hard to tell whether the issue was a timeout, a queue backlog, or a bad deployment.
How would you explain the differences between synchronous and asynchronous programming in this system, and when would you choose one over the other? Walk through the reliability, observability, and failure-mode trade-offs you would use to debug the incident and decide where each pattern belongs.
You are responsible for a service that authenticates requests, writes audit events, and triggers downstream notifications across several internal systems. Some paths block on immediate responses while others enqueue work and continue after acknowledgment. A recent incident showed that a failed downstream call was retried inconsistently, making it hard to tell whether the issue was a timeout, a queue backlog, or a bad deployment.
How would you explain the differences between synchronous and asynchronous programming in this system, and when would you choose one over the other? Walk through the reliability, observability, and failure-mode trade-offs you would use to debug the incident and decide where each pattern belongs.