The interview problem
A customer wants an AI assistant to turn service emails into work orders in a legacy system. Its create endpoint sometimes times out, documentation is incomplete and the vendor cannot add features this quarter. Deliver a four-week pilot for 6,000 work orders per day without creating duplicate jobs or claiming success before the customer can use the result.
Original FDE practice, not a reported interview. Customer, deadlines and volumes are hypothetical. Technical reference retrieved September 27, 2026.
1. Discover the contract before promising automation
Observe an operator creating and correcting a real work order in an approved test environment. Identify the business key, required fields, allowed state transitions, downstream notifications and what counts as a duplicate. Two similar emails might refer to the same repair or to separate visits: content similarity cannot decide business intent alone.
Build a capability matrix with evidence: authentication lifetime, request limits, field lengths, date formats, pagination, error codes, lookup by external reference, uniqueness enforcement and visibility delay after creation. Mark every item as documented, experimentally observed or still unknown. A successful happy-path call proves little about a timeout after a committed write.
Ask the vendor and customer system owner whether an external reference is atomically unique, whether repeated creates return the original object, and how long any deduplication record lasts. A free-text reference field is not equivalent to an idempotency guarantee. Record the owner responsible for confirming each assumption.
2. Put deterministic validation around the model
The model proposes a structured draft with evidence pointers to the source email. An adapter maps that draft to a versioned internal command schema. Validate equipment identifiers against customer records, distinguish absent from empty values, reject unsupported enum values and require explicit timezone handling. Do not silently truncate an address or convert an unknown priority into the highest priority.
For the pilot, an operator reviews uncertain or consequential fields. Approval binds the exact command payload and its version, not a mutable chat transcript. Changes after approval require a new review. The model cannot choose an arbitrary endpoint, customer account or credential; the executor uses an allowlisted operation and the authenticated customer's scope.
Use redacted contract fixtures for valid, invalid and boundary inputs. Keep model quality failures separate from mapping failures: a correctly transmitted wrong equipment ID is still a failed workflow. Measure corrections per field and final work-order correctness, not merely JSON validity.
3. Keep a durable command record
Use email ingestion → proposed draft → validation/review → durable command store → rate-limited adapter → legacy API. Assign a stable command ID to the approved business action. Persist payload hash, approval version, customer scope and dispatch state before sending. An outbox can make recording the approved command and scheduling its execution one local transaction.
Track states such as approved, dispatching, confirmed, rejected and outcome-unknown. Confirmed requires authoritative evidence of the resulting work-order ID and intended fields. An HTTP acceptance response may only indicate that processing began. Define the difference in the customer's status view.
Worker leases and local deduplication prevent many accidental parallel sends. They cannot atomically commit a remote work order and the adapter's local status. If a worker crashes after the remote commit but before recording success, the next worker faces the same ambiguity as a network timeout.
4. Resolve ambiguous outcomes without inventing guarantees
If the remote API supports a verified idempotency contract, send the same command identifier on retries and preserve its payload. Confirm identifier scope, retention and behavior when the same identifier arrives with different parameters. A new identifier on every attempt defeats deduplication.
If the system instead enforces a unique external business reference, lookup and conflict handling may recover the existing work order. Test that uniqueness applies atomically to concurrent creates, not just to the UI. Verify a found record belongs to this command before treating it as success.
If neither capability exists, a timeout is outcome-unknown. Pause automatic creation for that command and route it to an operator with the attempted payload, timestamps and available lookup evidence. A search returning nothing is insufficient when indexing is delayed. Even a strongly consistent read cannot rule out a still-running original request that commits later; safe retry needs remote deduplication or authoritative evidence that the original attempt has terminated without creating the work order.
Offer the customer a narrower initial delivery: prepare validated drafts, create only where outcomes can be established and explicitly staff ambiguous cases. Do not sell a local queue as exactly-once execution against an unconstrained remote API. Manual investigation also needs a documented procedure, not a blind “retry” button.
5. Budget throughput and exception handling
Assume the 6,000 daily commands arrive during ten working hours: average arrival rate is 6,000 / 36,000 ≈ 0.167 commands/s. If a shared API allowance is two calls/s and a normal command takes three calls, ideal capacity is 2/3 commands/s, or 24,000 commands in ten hours. This is a ceiling before retries, polling and other clients consume the allowance.
A burst of 1,200 commands takes at least 1,800 seconds, or 30 minutes, at that ideal capacity with no other work. If ordinary arrivals continue at 1/6 command/s, net drain is 2/3 − 1/6 = 1/2 command/s, so the same backlog takes 40 minutes. Negotiate burst latency separately from daily volume.
If 0.5% of daily commands require manual resolution, that is 30 cases/day. At eight minutes per case, the pilot needs four operator-hours per day for ambiguity alone. This hypothetical rate is a staffing scenario, not a vendor reliability estimate. Measure the real rate before promising an unattended launch.
6. Make acceptance observable
In week one, confirm the capability matrix and collect representative fixtures with the customer owner. In week two, deliver draft-only workflow and contract tests. In week three, run limited approved writes on a bounded customer cohort only if the verified contract and exception procedure meet the agreed risk criteria; otherwise retain draft-only operation. Staff the exception queue before enabling writes. In week four, review observed correctness, queue age, duplicate incidents and operator effort against agreed launch criteria.
Acceptance tests should include response loss after a successful create, delayed visibility, expired credentials, rate limiting, schema changes and a crash between remote success and local persistence. Inject faults in a mock adapter or vendor-approved sandbox rather than damaging production records. Show the customer the expected state and recovery owner for each scenario.
Agree a concrete pilot gate, for example: all scripted ambiguous writes remain visibly unresolved until evidence arrives; no duplicate work orders in the approved fault suite; every confirmed command links to a verified remote record. Passing a finite suite does not prove duplicates are impossible in all production conditions. Also measure audited business correctness on the pilot sample and report its size and selection method.
7. Own the operational boundary
Provide an exception dashboard with age, cause and assigned owner; a kill switch stops new dispatch while preserving evidence. Define who can resolve or cancel an unknown command, how conflicting records are handled and when vendor support is involved. Cancellation of local dispatch does not undo a remote write that already happened.
Retain enough redacted request metadata for diagnosis and restrict access to original email content. Version adapters and fixtures together. An unexpected response shape should fail visibly rather than turning a parser fallback into a false success. Monitor upstream contract changes as well as model drift.
Foundation: list the missing API guarantees. Senior: walk through response loss after commit. Staff: negotiate a useful pilot when the customer requires zero duplicates but the remote contract cannot guarantee safe retries.
Score 0–2 each for discovery evidence, model/executor separation, ambiguous outcomes, capacity and acceptance ownership. Continue with integration reconciliation and pilot to production.
Sources and next steps
- Amazon Builders' Library: Making retries safe with idempotent APIs — retry ambiguity and caller-provided request identity.
The customer scenario, adapter design, delivery contract and arithmetic are original. The source explains a technical pattern; it does not establish that a particular legacy vendor supports it.
Continue your preparation
Choose a connected learning path or browse more FDE interviews questions. Read our editorial method and attribution policy.