All jobs / Backend developer / Architecture
Backend developer interview question · 3–5 years
The interviewer asks: “Event-driven or request/response for “order placed → email + warehouse”?” Strongest answer?
The strongest answer
If the caller doesn't need those side effects in the HTTP response, publish an OrderPlaced event (via outbox) and let consumers do email and warehouse. If checkout must confirm stock now, that's a request — maybe with a short saga, not a hope that a consumer ran.
Why it works
Exactly. Events decouple facts that already happened. The user-facing “can I buy this?” is still a synchronous policy decision.
What a good answer covers
- Sync for decisions the user waits on.
- Events for facts that already committed.
- Don't block HTTP on every consumer.
- Don't hidden-RPC in the controller.
Answers that fall short
- Close, but not the strongest: Events for everything; HTTP is legacy.
Turning every click into a topology is operational load you will eat on-call. Use events where asynchrony is a feature. - Weak: Always wait in the request for every consumer to ack.
Waiting for every consumer is a distributed monolith with worse failure modes. That's orchestration in the request — be honest and design the saga. - Red flag: Fire HTTP calls to email and warehouse inside the controller, sequentially, with no timeout.
Coupled sequential HTTP with no timeout is how checkout inherits email's latency and warehouse's outage.
Who gets asked this
More Architecture questions
- The interviewer asks: “How do you change an event payload that old consumers still read?” Strongest answer?
- The interviewer asks: “Billing keeps importing Order's entity. What's the design problem?” Strongest answer?
- The interviewer asks: “How do you isolate tenants in a multi-tenant backend?” Strongest answer?
- The interviewer asks: “A bad deploy took all regions with it. What architecture would have contained it?”…
- A team proposes ports and adapters for a service that reads a queue, writes to one database, and will never…
- The interviewer asks: “Two years of events, consumers you don't own. How do you evolve the schema?” Strongest…
- The interviewer asks: “Auth, TLS, and WAF — in every service or at the gateway?” Strongest answer?
- An interviewer says: “Design a URL shortener.” What do you do first?