Distributed ReliabilityQueue recovery and health restorationPrincipal
How should dead-letter redrive revalidate authority and reconcile an earlier unknown payment?
By Amit Kumar3 min readWorked answer includedReviewed 28 Sept 2026
The question
Interview question
A payment job approved Monday fails and enters a dead-letter queue. Approval is revoked Thursday, and an operator redrives Friday. Design current authorization and operation identity checks, including a Monday submission whose acknowledgement was lost. Explain when an absent provider lookup is insufficient and what a safe redrive inventory must show.
Draft your approach first
Take a few minutes before you read the answer. Name the constraint that matters most, the failure you are designing for and how you would know it worked.
Reveal the worked answerWorked answer
An agent was approved to send a supplier payment on Monday. The job hit an integration error and ended up in a dead-letter queue. On Thursday, the user revokes approval. On Friday, an operator redrives the queue and the payment executes. The retry machinery did its job. The business authorization did not.
A queued message is a record of an intent and past decision, not an evergreen permission. SQS documents dead-letter queues and redrive as transport operations. They do not reauthorize application actions. In this hypothetical system, the consumer must distinguish “this job may be delivered again” from “this side effect is still allowed now.”
I would give the job a durable action ID, actor and tenant, target resource, approved operation and limits, approval reference, decision version, deadline, and original creation time. On every attempt, including redrive, the executor checks live revocation and current resource state with the authority that owns them. The approval may have a defined lifetime and scope. If a policy changed, the outcome depends on the product's explicit versioning rule, but an explicit revocation must not be ignored because an old serialized approved=true flag survived. For high-impact actions, a stale or unavailable authorization source should block execution and request review, with a visible reason.
The interviewer may ask, “What if the payment actually went through on Monday and the acknowledgement was lost?” Rechecking approval alone does not solve duplicate side effects. Query the payment ledger using a stable business operation ID or an idempotency key recognized by the downstream service. If it is settled, reconcile and mark the job complete. If non-execution is established under a contract that also excludes a late earlier submission, and current authorization is valid, the executor may proceed under that contract. If status is unknown, quarantine rather than blindly issue another payment. The state machine needs to record attempts, external IDs, authorization checks and terminal outcomes.
A negative status lookup alone may only mean the provider has not observed an earlier request yet. A delayed request can arrive after that read. With still-valid authority, repeat automatically only when the same operation and parameters remain covered by the provider’s deduplication contract, or another enforced protocol excludes that race. Otherwise keep the outcome unresolved. A revoked approval blocks a new submission, but does not require erasing an authenticated outcome from an earlier attempt. Recording what happened and authorizing another effect are different transitions.
Redrive should be a controlled operation with a dry-run inventory of age, action type, revocations and unknown side-effect states. Measure how many replayed jobs were rejected by the fresh gate. Test approval revocation between failure and redrive, lost acknowledgement, and a batch containing both safe and unsafe jobs. The agent's task was approved yesterday. The employee loses access today. Does the scheduled action run? concerns a scheduled action after a principal loses access. This question is the operational replay path, where a dead-letter queue can turn a past intent into a new attempt long after the original failure.
Related questions
Keep practising distributed reliability
Follow another question in this area, or search the complete library.
Get my essays on AI engineering and distributed systems by email. Subscribe to ArchCrux