Design a Global Contractor Payout Ledger for Hourly Experts
Last updated: November 29, 2026
Quick Overview
Design the system that turns approved hours from tens of thousands of experts in 100+ countries into weekly payouts through multiple payment providers, while billing the corresponding AI lab customers, so that money is never paid twice, never lost, and always reconcilable.
Mercor
November 29, 20260
0
0 solved
Design the system that turns approved hours from tens of thousands of experts in 100+ countries into weekly payouts through multiple payment providers, while billing the corresponding AI lab customers, so that money is never paid twice, never lost, and always reconcilable.
Mercor pays a very large international contractor workforce and invoices labs for the same work, so payroll correctness is a trust issue on both sides of the marketplace. The interviewer probes double-entry ledgers, idempotency against external providers, reconciliation, and handling reversals.
What the Interviewer Expects
- Model money with an append-only double-entry ledger
- Make payout execution idempotent against providers that may time out
- Separate earning, approval, payout and customer invoicing states
- Reconcile against provider reports and handle returns and clawbacks
- Address currency conversion, compliance holds and auditability
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- A provider call times out after the money may have moved; what exactly do you do?
- An expert's hours are rejected after they were paid; how is that represented?
- How do you lock the FX rate and who bears the FX risk?
- How would you shard this when one week's run has millions of entries?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Inputs: approved time entries per expert per project with an hourly rate. Outputs: weekly payouts in the expert's currency via the best provider for their country, and invoices to labs at the bill rat...
High-Level Design
Services: Time (approved entries), Ledger (Postgres, append-only journal_entries and postings), Payout Orchestrator, Provider Adapters (one per payment rail), Invoicing, Reconciliation. Approval o...