Actors
- Claims intake/payment system
- Payment-integrity analyst
- External review vendor
- Vendor manager
- Appeals investigator
- Compliance auditor
CLAIMS LEDGER / MOCK 08
Design a deterministic prefilter and vendor-routing platform that safely avoids unnecessary pay-per-catch reviews while preserving money correctness, appeals and audit.
OPENING PROMPT
Read this once, then begin aloud. Spend the first two minutes establishing contract, actors, risk and what must remain authoritative.
Design ClaimShield for a public insurer. It receives 10,000 claims/day, applies deterministic payment-integrity rules, safely filters claims that do not need an expensive external review vendor, routes the remainder across vendors, ingests findings, supports corrections and appeals, and proves why each claim was or was not sent. Vendor charging is pay-per-reviewed-claim, so false routing has financial impact.
Make the prefilter a conservative, versioned eligibility proof with explicit abstention—not an opaque denial model. Claims and decisions are immutable revisions; routing and vendor calls use an idempotent ledger and reconciliation.
REQUIREMENTS
These are supplied mock numbers for sizing and follow-ups. Say your assumptions before using them.
HIGH-LEVEL DESIGN
Name the authoritative state, derived projections, asynchronous boundaries and the exact point where a business decision becomes durable.
STORAGE + ACCESS
The table is logical, not a mandate for one database. Choose physical stores after access patterns, transactions, retention and rebuildability are clear.
| Entity | Primary / unique key | Important fields and purpose |
|---|---|---|
| Claim | (tenant_id, claim_id) | member_token, provider_id, service_date, currency, lifecycle |
| ClaimRevision | (claim_id, revision) | canonical_lines, total_cents, source_event_id, content_hash |
| PolicyBundle | (policy_id, version) | effective_interval, rules_hash, state, approvals |
| FilterDecision | (claim_revision, policy_version) | SEND/SKIP/ABSTAIN, reason_codes, facts_hash, trace |
| VendorDispatch | (dispatch_id) | claim_revision, vendor_id, idempotency_ref, state, fee_cents |
| VendorFinding | (dispatch_id, vendor_finding_id) | category, amount_cents, evidence, received_at |
| IntegrityAction | (action_id) | claim_revision, finding_id, proposed_delta_cents, state, approver |
| Appeal | (appeal_id) | action_id, evidence, decision, adjustment_id, resolved_at |
POST /v1/claim-revisionsSource event ID + canonical claim; duplicate-safe
202 {claimId,revision,operation}GET /v1/claims/{id}/integrityDecision, policy, evidence, dispatch and action chain
200POST /v1/filter-runsPin claim revision + policy bundle; replayable
202 {runId}POST /v1/vendor-callbacks/{vendor}Signed result; vendor finding ID dedupe
202POST /v1/actions/{id}/decisionApprove/modify/reject financial action with etag
200 / 409POST /v1/appealsReference immutable action and new evidence
201 {appealId}00:00 → 30:00
Answers are written in a speakable first-person style. Turn on Practice Mode to hide them, answer aloud, then reveal one at a time.
I will define the prefilter’s promise carefully: SKIP means we have deterministic evidence that this claim is outside vendor-review value under an approved policy; SEND means eligible; ABSTAIN means missing/ambiguous facts and defaults to the safe route. The platform never directly denies a claim. Claims core remains authoritative for payment, and vendors remain external reviewers. We own decision provenance, routing, findings, proposed actions and appeal linkage. I would ask what failure is more costly: an unnecessary vendor send or a missed recoverable overpayment.
V1 ingests versioned claims/lines, snapshots eligibility facts, evaluates deterministic effective-dated rules, routes SEND/ABSTAIN cases by vendor capability and capacity, reconciles vendor callbacks, and creates human-reviewed financial actions. It supports corrected claims, replay, appeals, sampled audits of SKIP decisions and shadow rollout. Every decision cites rules and facts. We exclude final clinical adjudication, autonomous denial, replacement of payment core and unreviewed model rules.
Ten thousand claims/day average 0.116/s, but 100/s bursts require queue elasticity. At $7/mock vendor review, sending all costs $70k/day. An 80% safe skip sends 2,000 and costs $14k, a gross $56k/day reduction before platform and missed-opportunity cost. That upside makes false-SKIP measurement essential. With 120k lines/day and perhaps 2 KB normalized per line, daily canonical data is roughly 240 MB plus indexes and evidence.
10,000 × $7 = $70,000/day baseline
20% × 10,000 × $7 = $14,000/day routed
Gross avoided fee = $56,000/day (mock only)Claim has stable identity; ClaimRevision is immutable and keyed by revision with canonical total cents and source-event ID. FilterDecision pins revision, fact snapshot and PolicyBundle. One revision has one active decision per policy run. VendorDispatch has a unique deterministic reference and fee. VendorFinding is append-only and deduped by vendor ID. IntegrityAction proposes a delta but needs approval before claims core integration. Appeal references the action; an adjustment is separate. Invariants include line sum equals claim total, currency consistent, and one payable business action per approved action ID.
The intake edge authenticates the source, persists the raw event and canonical revision, and acknowledges. A fact service resolves enrollment, provider, duplicate and policy data into a content-hashed snapshot with freshness labels. The deterministic rule engine evaluates a compiled PolicyBundle and emits SEND, SKIP or ABSTAIN plus trace. A dispatch transaction writes decision and, for SEND/ABSTAIN, a VendorDispatch outbox. The router chooses a qualified vendor using capability, contract, queue age and deterministic weighted allocation. Adapters submit with idempotency references. Signed callbacks land in a raw inbox, dedupe, map to findings and create analyst tasks. All state transitions emit an audit outbox.
Rules form a conservative decision list. Hard exclusions with complete facts may SKIP—for example already-reviewed identical revision, jurisdiction outside contract, or amount below an approved threshold when legally safe. Eligible patterns SEND. Missing critical data, conflicting totals, stale facts or unknown codes ABSTAIN and route. Each rule declares inputs, freshness, effective interval, outcome, stable reason and evidence template. A constrained DSL compiles to deterministic code. Before promotion, simulate on historical data and vendor outcomes; rule owners review false-SKIP samples.
Start in full shadow: still send all claims, but record proposed decision. Join eventual vendor findings and downstream confirmed recoveries to the exact claim revision. Compute SKIP precision as the fraction of proposed SKIPs with no material confirmed finding, with confidence bounds. Because vendor findings are imperfect, randomly dual-review a stratified sample of SKIPs and use internal audits. Slice by rule, provider, service, amount, geography, vendor and effective period. A rule promotes only after minimum sample size, no severe misses, financial-weighted loss below budget and reviewer approval.
Eligibility filters vendors by contract, claim type, region, data-sharing permission and current health. Among eligible vendors, use deterministic weighted allocation with capacity tokens and sticky hash for repeatable distribution. Dispatch has states PENDING, SENT_UNKNOWN, ACKED, RESULTED, CANCELLED and EXPIRED. A timeout triggers status lookup before resubmit. Vendor fee accrual is a ledger entry tied to accepted dispatch, reconciled against invoice. Findings propose recoveries separately; financial analysts approve actions, and a downstream outbox sends adjustments to claims core idempotently.
Strong consistency protects claim revision insertion, filter-decision publication, dispatch creation, action approval and adjustment outbox. Fact indexes and dashboards are eventual. Source event ID dedupes intake; a different content hash for the same event is quarantined. Filter run key is revision + fact snapshot + policy. Vendor idempotency reference is stable across retries. Queues separate intake, facts, filtering, each vendor and action processing. If vendors saturate, intake continues; capacity tokens route elsewhere or backlog SEND/ABSTAIN with SLA priority. SKIP never results merely from overload.
Create ClaimRevision 2 and link it as superseding revision 1. Do not mutate the original dispatch. If vendor supports cancellation and no result exists, send a cancellation command idempotently; otherwise mark the result stale-on-arrival and preserve any contractual fee. Evaluate revision 2 independently and route as needed. The analyst UI groups revisions and forbids applying a finding from revision 1 without revalidation against revision 2. Payment actions reference one exact revision. Metrics track wasted dispatch fees due to corrections.
An approved IntegrityAction is immutable. Appeal opens a case with claimant evidence, deadlines and access controls. It may stay, reverse or modify the action; reversal creates an adjustment referencing the original, never deletes it. The appeal decision records reviewers, evidence and policy context. Overturns feed rule-quality analytics only after governance and delayed-label safeguards. A high overturn rate for one SKIP/SEND rule triggers shadow fallback or policy suspension, but an individual appeal never silently rewrites the rule.
Circuit-break new sends to A after health/error thresholds. PENDING work can reroute if no attempt occurred; SENT_UNKNOWN cannot be sent elsewhere until status lookup or a contract-defined timeout proves non-acceptance, otherwise two vendors may bill and produce conflicting findings. Capacity-aware routing shifts new eligible claims to B/C up to their limits, with priority by financial exposure and SLA age. If all saturate, backlog with visible ETA and alert contract operations. Claims ingestion and filtering remain available.
Claims contain regulated health and financial data. Tokenize member identity, encrypt claim/finding/evidence with tenant keys, use private connectivity and field minimization per vendor contract, and isolate tenant/vendor credentials. Authorization combines role, tenant, purpose and case assignment. Analysts see minimum necessary data; bulk export and break-glass require reason. Signed callbacks prevent spoofing. Rule bundles and fact snapshots are signed/hash-pinned. Models, if used for analyst assistance, run in an approved boundary and cannot issue filter or payment decisions.
Operational SLIs: intake durability/lag, fact freshness, filter p95, queue age, vendor ack/result SLA, unknown dispatch age, callback dedupe, adjustment outbox lag and reconciliation breaks. Quality: proposed SKIP rate, mature-label SKIP precision with confidence, severe misses, recovered dollars, vendor yield normalized by case mix, appeal/overturn by rule, and sampled-audit disagreement. Financial: fees accrued vs invoiced, avoided fee, confirmed recovery, false-positive analyst cost and correction waste.
Ingest and replay first, then shadow filter while sending 100%, then allow only a few high-precision rules to SKIP while retaining a random audit sample, expand by rule/cohort, and keep kill switches. Conservative abstention costs vendor fees but protects missed recoveries. Deterministic rules may capture less than a model but are governable. Traps are calling vendor labels truth, optimizing raw hit rate, skipping on missing data, mutating corrected claims, double-sending after timeout, and claiming savings without subtracting platform/audit/missed-recovery costs.
ClaimShield stores immutable claim revisions and fact snapshots, then runs an approved effective-dated deterministic filter with SEND, SKIP or safe ABSTAIN. Decisions include evidence and one idempotent dispatch outbox. Capacity-aware vendor adapters use stable references, ambiguous-send states and reconciliation. Findings only propose actions; humans approve, and appeals append adjustments to the ledger. We prove safe skipping through full shadow, mature labels, independent sampled audits and per-rule financial slices, then expand gradually with exploration samples and kill switches. Vendor outages delay routing but never turn into a SKIP.
DOMAIN DEPTH
These mechanisms are the interview’s differentiators. Be able to redraw each from memory and defend its failure behavior.
A high skip rate is useful only when labels mature, severe misses are bounded, case mix is sliced and independent audits challenge vendor blind spots.
A review is not one event. Dispatch acceptance, vendor finding, invoice fee and claims-core adjustment must agree.
FAILURE MATRIX
When the interviewer injects a fault, restate the violated assumption, change state or protocol, and name the new invariant.
| Injection | Recovery mechanism | Tempting wrong answer |
|---|---|---|
| 01Duplicate intake | Source event ID + content hash | Duplicate revision |
| 02Corrected claim | New revision; cancel/stale old dispatch | Mutate original |
| 03Vendor timeout | SENT_UNKNOWN + status lookup | Double vendor billing |
| 04Missing fact | ABSTAIN and route | Treat missing as false |
| 05Late finding | Pin exact claim revision | Apply to latest |
| 06Rule quality drops | Shadow/kill switch + sampled audits | Trust aggregate rate |
BOTEC
Use orders of magnitude to expose the bottleneck. State what this simple model omits.
INTERACTIVE SCENARIO
Estimate gross avoided vendor fees under mock volume and skip assumptions. This is not net savings.
OPERATIONS + DELIVERY
A system is incomplete without observable user outcomes, staged deployment, rollback and an answer to “how will we know?”
INTERVIEWER TRAPS
Use these as flash cards. The right column is the compact sentence you want available under pressure.
| Trap | Better move |
|---|---|
| Vendor output = truth | Audit and mature downstream labels. |
| Missing fact means no risk | ABSTAIN safely. |
| Timeout means retry elsewhere | Resolve ambiguous acceptance. |
| Claim is mutable | Use immutable revisions. |
| Hit rate only | Normalize case mix and financial impact. |
| Savings as gross fee | Subtract operations and missed value. |
DEFINITIONS
Define the term, then connect it to a concrete invariant in this design. Avoid dropping vocabulary as a substitute for reasoning.
FINAL MINUTE
ClaimShield stores immutable claim revisions and fact snapshots, then runs an approved effective-dated deterministic filter with SEND, SKIP or safe ABSTAIN. Decisions include evidence and one idempotent dispatch outbox. Capacity-aware vendor adapters use stable references, ambiguous-send states and reconciliation. Findings only propose actions; humans approve, and appeals append adjustments to the ledger. We prove safe skipping through full shadow, mature labels, independent sampled audits and per-rule financial slices, then expand gradually with exploration samples and kill switches. Vendor outages delay routing but never turn into a SKIP.
Rehearse again