Make Queue Transaction Processing Idempotent Under Robot Retries

Last updated: November 29, 2026

Quick Overview

An unattended robot posts invoices to an ERP from an Orchestrator queue, and a crash or timeout can cause the same queue item to be processed twice. Explain idempotency for this case and implement a small processor that guarantees one side effect per transaction reference even when retried.

UiPath
Software Engineering Fundamentals
Software Engineer
UiPath
November 29, 2026
Software Engineer
Technical Screen
Software Engineering Fundamentals
Easy

0

0

0 solved


An unattended robot posts invoices to an ERP from an Orchestrator queue, and a crash or timeout can cause the same queue item to be processed twice. Explain idempotency for this case and implement a small processor that guarantees one side effect per transaction reference even when retried.

Queues in Orchestrator deliver work at least once: a robot can die after the ERP accepted the invoice but before the item was marked Successful. Interviewers on platform teams use this to see whether a candidate understands delivery guarantees, unique references, and where the deduplication must actually live.

What the Interviewer Expects
  • Explains at-least-once delivery and why exactly-once side effects need idempotency
  • Uses the queue item's unique reference as the idempotency key
  • Distinguishes done, in progress and failed records, with a lease for in-progress work
  • Notes that the downstream system must also dedupe or be checked, not just local memory
  • Writes simple, testable code with an injectable clock
Key Topics to Cover
Idempotency keys
At-least-once delivery
Leases
Retries
Exactly-once effects
How to Approach This
  1. Apply SOLID principles. Single Responsibility makes code testable, Open/Closed makes it extensible.
  2. Choose data structures based on access patterns, not familiarity.
  3. Prefer immutable data and message passing over shared mutable state for concurrency.
  4. Design APIs with RESTful conventions, versioning, meaningful errors, and pagination from day one.
Possible Follow-up Questions
  • The robot crashes after the ERP call but before recording done. What prevents a duplicate invoice?
  • Where would you persist the idempotency records so that a different robot sees them?
  • How long do you keep idempotency records, and what happens when one expires?
  • How do business exceptions (invalid vendor) differ from application exceptions here?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Each queue item has a unique reference (for example the invoice number). Processing it calls a side effect (post to ERP). If the same reference is handled again, return the first result and do not p...

High-Level Design

Keep a record per reference with status running (plus a lease expiry) or done (plus the result). Before doing work, check the record; claim it with a lease; on success store the result; on failure...


Submit Your Answer
Markdown supported

Related Questions