Skip to content
RED SAGSkills
hardCloud Engineer interview question

Design an event-driven order processing system on a public cloud that must handle traffic spikes and never lose or double-charge an order.

What the interviewer wants to hear

  • Durable queue or stream to buffer spikes between producers and consumers
  • At-least-once delivery means idempotent consumers with idempotency keys
  • Transactional outbox to publish events reliably with database writes
  • Dead-letter queues, retries with backoff, and alerts on DLQ depth
  • Ordering only where needed, using partition or message group keys
  • Saga or step functions for multi-step workflows and compensation

Model answer

The API validates the order, writes it to the database and records an event in an outbox table in the same transaction, so we never save an order without publishing its event. A relay or change data capture pushes outbox events to a queue or stream such as SQS, EventBridge or Kafka, which absorbs spikes while consumers scale on queue depth. Delivery is at-least-once, so every consumer is idempotent: payment calls use the order ID as an idempotency key, and we store processed message IDs. Failures retry with exponential backoff, and messages that keep failing go to a dead-letter queue with an alarm and a redrive process. I only enforce ordering where it matters, by keying on order ID. The multi-step flow of payment, inventory and shipping runs as a saga, for example in Step Functions, with compensating actions like refunds.

Can you answer it under time pressure?

Take a timed hard round and get scored on every answer.

Start mock interview

More hard Cloud Engineer questions