Design Expense Management

Medium45 min
1 / 30
understanding6 min read

Problem Statement & Context

How Problem Statement & Context shapes architecture and interviewer follow-ups for Design Expense Management.

Problem Statement & Context

Corporate expense platforms reconcile employee spend with finance controls: capture receipts, extract structured fields, enforce policy (per diem, category caps, receipt required), route approvals, and export to ERP/payroll. Unlike a shopping cart, the hard part is messy unstructured input (photos, forwarded emails, card feeds) converging on auditable numbers.

Personas

  • Employee: snap receipts, mileage, corporate card auto-match
  • Manager: approve exceptions, bulk actions at month-end
  • Finance: audit trail, tax tags, GL coding, reimbursement batches

Scale anchors (state explicitly)

Assume 80k enterprise tenants, 12M active employees, 180M expense lines/month, 2.3 receipts/line average. Peak month-end close = daily submit rate for 72 hours. Target: receipt upload ack < 300ms, OCR enrichment p95 < 45s, approval API p99 < 250ms.

Core tension

report_id must serialize workflow transitions while OCR workers mutate line items asynchronously. Finance needs strong audit; employees need offline-friendly capture.

javaOne Dark Pro
1public final class ReportSubmitService {
2 public SubmitResult submit(UUID reportId, String idempotencyKey) {
3 return txTemplate.execute(status -> {
4 var report = reports.lockForUpdate(reportId);
5 var violations = policyEngine.evaluate(report);
6 if (violations.stream().anyMatch(Violation::blocking)) {
7 throw new PolicyViolationException(violations);
8 }
9 audit.append(reportId, "submitted");
10 outbox.enqueueExport(reportId);
11 return SubmitResult.ok(report.version());
12 });
13 }
14}

Section 1 focus

Interviewers expect Problem Statement & Context to cite report_id consistency, OCR confidence gating, and SOX-friendly audit — not generic microservices buzzwords.

Why interviewers care

Expense Management interviews reward crisp scope, explicit trade-offs, and failure stories—not generic microservice diagrams.

Interview checkpoint

Name one failure story for Problem Statement & Context that proves you understand real outages, not happy-path diagrams.

Key Highlights

  • Problem Statement & Context: anchor on report_id workflow stickiness
  • OCR async; policy blocks on submit
  • Immutable receipt blobs + audit hash chain
  • Phase understanding checkpoint for design-expense-management
Signal
When discussing Problem Statement & Context, cite versioned policy evaluation and ERP idempotent export.
Delivery
Quantify month-end peak (4×) and separate OCR lag SLO from API latency.

Section Rescue Kit

Buzzwords to use:

PolicySnapshot-1ReceiptFingerprint-1

Safe statements:

  • "I'll keep PAN out of scope and ingest card feeds as tokens only."
  • "If audit append fails, I fail closed on submit — finance prefers delay over silent loss."
Design Expense Management - System Design | WinJob | WinJob