System Design: Marketplace Seller Fraud Detection (Walnut Mart: Seller Risk, Payout Holds, Both Fulfillment Models, Under 1% False Positives)
We design the system that finds suspicious sellers on a large online marketplace and stops avoidable loss, without delaying honest sellers' orders or payments. The marketplace is called Walnut Mart, and our system is called Walnut Mart Trust. As in any system design interview, the numbers are assumptions for planning:
- Numbers the interviewer gives in the question are marked "from the question".
- Every other number is our own assumption, and the design is our own.
How to read this post. It takes about 90 minutes in full, so it is built to be read in parts:
1. Requirements
1.1 What we are building
Walnut Mart lets other businesses, called sellers, sell to its customers. It pays each seller once a week, every Friday. It runs two fulfillment models, two ways an order reaches the buyer:
- The seller packs and ships the order itself.
- The seller sends its stock to our warehouse, and we pack and ship it.
Nova Electronics sells phones from Houston and uses both models. On Wednesday 2 Dec at 23:10, someone signed in as Nova asks to change its bank account. The device is new to us, and its network is rented servers in the Netherlands.
Nova's next payout of $48,000 is due on Friday, 36 hours later. The thief, if it is one, wants it sent to the new account. Once a bank transfer is sent, it cannot be pulled back.
Who made the change? There are two possibilities:
- Outcome A: a phishing crew, thieves who tricked Daniel out of his password.
- Outcome B: Nova's owner, Daniel Brooks. He is at a trade fair in Amsterdam with a new laptop, so the device is new and the network is in the Netherlands. This week Nova opened an account at a new bank with lower fees. Its number ends in 6630. Daniel wants Friday's payout to go there, so he changes it from his hotel early on Thursday morning, Amsterdam time.
At 23:10, the two look almost the same. Only small details differ, such as the email change the crew tried at 23:07.
Walnut Mart Trust must answer within 75 ms, as the question asks. It must keep the money safe in both cases. And it must wrongly hold fewer than 1 in 100 honest payouts.
Nova's week runs through the whole post. All times are Central Time, in 2026.
- Tue 1 Dec, 19:05. Emily Carter is a buyer in Dallas. She says her $649 phone from Nova arrived as an empty box. Its order ID is O-77215. This is separate from the bank change. Emily is an honest buyer, and her story later shows how we judge empty-box claims.
- Wed 2 Dec, 23:10:02. Someone signed in as Nova adds a new bank account. We answer "step-up" 61 ms later. The person must prove who they are. Until then, the new account cannot receive money.
- Wed 23:13. In outcome A, the selfie check fails, and Nova's sensitive changes are frozen. In outcome B, Daniel passes, and the new account is verified at 23:16.
- Thu 3 Dec, 06:41. In outcome A, Daniel taps "Not me" on his phone. At 18:00 the weekly payout run builds Nova's $48,000 payout. Its payout ID is P-88120.
- Fri 4 Dec, 10:00 to 11:30. Every payout is checked, and the ones not held are sent. A payout goes only to an account verified at least 24 hours earlier. P-88120 goes out at 11:10. In outcome A it goes to Nova's old account, whose number ends in 2208. In outcome B it goes to the new account ending 6630.
- Fri 4 Dec, held payouts. Two other sellers' payouts are held. Bluebonnet Deals is a fraud. Lakeside Toys is honest, and its payout is released that evening.
1.2 Words we use
| Word | Meaning |
|---|---|
| Seller, owner | A seller is a business selling here (Nova Electronics, seller ID S-4417). Its owner is the person who controls the account (Daniel Brooks). |
| Buyer, analyst, policy team | A buyer is a customer (Emily Carter). An analyst is our employee who reviews cases (Olivia Martinez). The policy team (Rachel Nguyen) writes the rules. |
| Owner system | Another team's program that holds money, listings, accounts or goods, and applies our decisions. We only advise. There are eight: the Identity service, Payout service, Order service, Catalog service, Claims service, Carrier gateway, Fulfillment systems and Seller account service. |
| Seller group | Sellers we measure apart: new, established, high-volume, cross-border. Code calls it a cohort. |
| Payout | One weekly payment to a seller, such as payout P-88120. The payout run builds them on Thursday and sends them on Friday. |
| Beneficiary | The bank account payouts go to. Each change gets a new version: Nova's account ending 2208 is beneficiary version 6. |
| Fulfillment model | Seller-fulfilled: the seller ships and uploads a tracking number. Walnut Mart Fulfillment: we ship from our center, such as fulfillment center DFW-3 near Dallas. |
| Claim, chargeback | A claim is a buyer saying an order went wrong. A chargeback is a card holder's bank taking a payment back after a dispute. |
| Event | One fact with the time it happened, such as "bank change, Wed 23:10:02". |
| Feature | One number made from events, which rules and models read, such as "bank changes in 30 days: 1". |
| Identifier | A detail two accounts can share: a device, network, bank account, address or phone. |
| Fingerprint | How we store an identifier: a short code made from the value with a secret key, such as bk_7d21 for a bank account. |
| Link, ring | Sellers sharing an identifier are linked; all links form the link graph. Three or more linked sellers form a ring. |
| Rule | One condition a person wrote, with the action it asks for, such as rule R-104. |
| Policy | Everything decisions follow at one moment: every rule that runs, with its mode, the score lines and which model version to use. It has one version, such as pol-2026-11-30. |
| Decision | Our one answer to one action, saved with every version it used, such as decision dec_5F2A91. |
| Model, score | A model is a program that learned from past outcomes. Its score is the chance of fraud: 0.38 means about 38 in 100. |
| Threshold | A score line in the policy, such as "a hold needs 5% or more". |
| Mode | Whether a rule may act: shadow only logs, pilot acts for 5% of sellers, live acts for all. |
| Backfill | A replay of past events through a new rule, to forecast its holds. |
| Flag, step-up | A flag asks a person to look and delays nothing. A step-up asks the owner to prove again who they are, for example with a photo ID and a selfie. |
| Hold | Stops one payout, or one order's amount, until a 48-hour deadline. It can be extended once. |
| Reserve | Keeps back part of later payouts after money already left, until 30 days after the orders' expected delivery. Holds and reserves are both risk holds. |
| Policy hold | A wait in the payment terms for every seller, such as 7 days after delivery. It is not a risk decision. |
| Wrongful hold | A risk hold on money that turns out to be honest. In this post a false positive always means a wrongful hold. |
| Hold budget | A weekly cap on risk holds, kept in code. |
| Slice | One group with its own cap and report: all payouts, one seller group, one fulfillment model, or one rule. |
| Label | The final truth about one decision: fraud, legitimate or unknown. Labels train models and measure us. |
| Decision service | Our program that answers every decision call. |
| Event log | One ordered list of all events, which our background jobs read. |
| p99, p50 | The time within which 99, or 50, of every 100 calls finish. |
| Region, zone, pod | A region is a group of data centers; we run US East and US Central. Each has 3 zones, separate buildings. A pod is one running copy of a program. |
IDs in this post
Every ID below is made up for Nova's story. The start of each ID says what kind of thing it names. Versions and account endings are plain numbers, so the post always says what each one is.
| ID | What it names | Example |
|---|---|---|
| S-4417 | A seller ID: one seller account | S-4417, Nova Electronics; S-2291 and S-6610, the other two sellers with the crew's bank account; S-3920, Bayou Bargains |
| O-77215 | An order ID: one buyer's order | O-77215, Emily's $649 phone |
| P-88120 | A payout ID: one weekly payment to one seller | P-88120, Nova's $48,000; P-88310, Bluebonnet's; P-88452, Lakeside's; P-88290, Red River's |
| H-6021 | A hold ID: one hold on one payout, kept by the Payout service | H-6021 on Bluebonnet's payout; H-6022 on Lakeside's |
| LE-901 | A ledger entry ID: one money record in the payments team's ledger | LE-901, P-88120 built on Thursday; LE-902, P-88120 sent on Friday |
| R-104 | A rule ID: one rule the policy team wrote | R-104, bank change from a new device; R-318, tracking numbers never scanned; R-212, sales against the seller's own average |
| R-104 version 3 | A rule version: every edit of a rule gets the next number | R-104 version 3; R-212 versions 1 and 2 |
| dec_5F2A91 | A decision ID: one answer of ours to one action | dec_5F2A91, the step-up on Nova's bank change; dec_6A40D2, Bluebonnet's hold |
| act_bc_7731f0 | An action ID: one action an owner system asks us about | act_bc_7731f0, Nova's bank change |
| case_31877 | A case ID: one record analysts review | case_31877, the takeover of Nova; case_31902, the ring |
| ev_pack_O-77215 | An event ID: one event, made by its sender | ev_pack_O-77215, the pack event for Emily's order |
| dev_e914 | A device ID: one phone or computer | dev_e914, the crew's device |
| bk_7d21 | A fingerprint: one identifier stored as a short code; bk_ means a bank account | bk_7d21, the crew's bank account; bk_4c88, Bayou Bargains' bank account |
| ph_6612 | An evidence file ID: one file in the Evidence vault | ph_6612, the photo of Emily's box at packing |
| fs_8812c | A feature snapshot ID: the saved inputs of one decision | fs_8812c, the inputs of dec_5F2A91 |
| pol-2026-11-30 | A policy version: everything decisions follow at one moment | pol-2026-11-30, the policy on Nova's Wednesday |
| model 14, model 9 | A model version: one trained copy of one model | Account change model 14, written account-change-14 in the answer; payout model 9 |
| version 6, version 7 | A beneficiary version: one saved state of a seller's bank account | Nova's version 6, the account ending 2208; version 7, the new account |
| ending 2208 | The last 4 digits of a bank account number; the post never shows a full number | 2208, Nova's old account; 9031, the crew's account; 6630, Nova's new account |
| DFW-3, PS-14 | A fulfillment center, and one pack station inside it | DFW-3 near Dallas; PS-14, the station that packed Emily's phone |
| 2026-W49 | A budget week: the week the hold budget counts | Week 49 of 2026, Monday 30 Nov to Sunday 6 Dec |
1.3 The kinds of seller fraud we must catch
Nova's bank change is one kind of fraud. Each kind leaves different traces, in data that different owner systems send us.
| Fraud type | What it looks like | The data that shows it | Who sends that data | What we do |
|---|---|---|---|---|
| Account takeover: a thief signs in as a real seller and moves its money. In scope. | Nova, Wed 23:10: a new device, rented servers in the Netherlands, and a bank change 36 hours before a $48,000 payout | Device first seen; data center network; contact changes tried today; bank changes in 30 days; next payout | Identity service; Payout service | A strict step-up, so the new account gets no money until the owner proves who he is. Stages 1 to 5 follow it |
| Exit scam: a seller takes many orders, collects one large payout, then stops shipping. In scope. | Bluebonnet Deals: sales 6 times normal in the holiday week; 31% of its tracking numbers never scanned | Sales against the 28-day average; share of tracking numbers never scanned in 7 days | Order service; Carrier gateway | Hold one payout: $126,000 on Fri 10:05, by rule R-318. Stage 5 and the hold budget |
| Fake or label-only tracking: a shipping label is printed, but no parcel reaches the carrier. In scope. | The same 31% of Bluebonnet's tracking numbers | No first scan; share of tracking numbers never scanned; no delivery scan | Carrier gateway | Money waits for a delivery scan. New and risky sellers buy shipping through us. Deep dive on evidence from fulfillment |
| Empty-box or non-delivery claim: a buyer says the box came empty or never came. The seller, the buyer or the carrier may be at fault. In scope. | Emily's order O-77215, an honest claim: the box left DFW-3 full | Expected packed weight; pack weight and photo; carrier scans and their weight; the buyer's claim history | Catalog service; Fulfillment systems; Carrier gateway; Claims service | Who held the box decides who pays. We refund Emily and file a carrier claim. Deep dive on evidence from fulfillment |
| Seller ring: one crew runs several sellers that share a bank account or device. In scope. | Bank fingerprint bk_7d21 on Nova, S-2291 and S-6610 by Wed 23:15 | Who else uses this bank account or device; ring size | Payout service, for bank accounts; Identity service, for devices | One review for the whole ring. Stage 6 finds the ring within 15 minutes |
| Banned seller returns: a banned seller applies again under a new name. In scope. | Coastal Tech Supply applies on Thu 09:40 with bk_4c88, the bank account of Bayou Bargains, banned in August | A banned link on the bank fingerprint; distance to the nearest banned seller | Seller account service, which records the ban | The application waits for review. Deep dive on events and features |
| Sales spike that may be honest: not fraud, but it looks like an exit scam. In scope, as the wrongful hold to avoid. | Lakeside Toys: a toy went viral, sales 5 times normal, with real carrier scans | Sales against the 28-day average, next to real scans | Order service; Carrier gateway | Held Fri 10:07, released 19:20 after review. The hold budget caps how many honest payouts can wait |
| Insider abuse: an employee releases holds or brings back banned sellers, for example for a bribe. In scope, in part. | No story example | Every release, rule change and evidence view | Our own staff tools, which write each one down | A second analyst for large releases; a second person approves every rule. Deep dive on case review |
| Brushing: a seller sends cheap items to real addresses, then posts "verified" fake reviews in those people's names. Out of scope: review integrity, not payouts. | No story example | Orders to addresses with no buyer history | Order service | Not designed here |
| Triangulation: a seller buys the item at another store with a stolen card and ships it to our buyer. Out of scope: the stolen card is used at another store. | No story example. Our buyer is happy; the card holder disputes the charge weeks later | Prices below cost; tracking from another store's account | Order service; Carrier gateway | Not designed here |
| Counterfeits: fake branded goods. Out of scope: listing integrity, not payouts. | No story example | Brand reports; listing content | Catalog service | Not designed here |
This post follows account takeover in depth. The other types use the same pipeline, with different features and rules.
1.4 Functional requirements
- Decide while the caller waits on every sensitive seller action. These actions are:
- sign-ins
- bank and contact changes
- listing edits
- onboarding, when a new seller applies
- buyer claims
- each payout's release
- Advise; do not act. Return an outcome and what it touches. Also return the reasons and the versions of the rules and model used. The team that owns the money, listing or account applies it.
- Collect evidence, each fact as one event. Sellers act in Seller Portal, the sellers' website. The owner system of each action sends the event. Stage 6 lists every owner system and what it sends.
- Keep signals fresh: counts within minutes; links between sellers, including to banned sellers, within 15 minutes.
- Act narrowly. A step-up before a hold; a hold on one payout before stopping a seller.
- Put people where the money is. Rank cases, the records analysts review, by money at risk; record every outcome and appeal as a label.
- Measure ourselves. Count wrongful holds per payout and per dollar, in every slice. Pause any rule that breaks the limit.
- Ship rules fast and safely. A new rule first only logs, on live traffic, within minutes of approval. That night it is replayed over past events. It acts only after both are measured.
Out of scope:
- card fraud at checkout
- ad fraud
- fake product images
- the inside of identity-check vendors and carriers
1.5 Non-functional requirements
"False positives under 1%" needs a definition first. Say there are 1,000 honest payouts and 10 holds, and 5 of the holds were wrong.
- Wrongful holds ÷ honest payouts = 5 ÷ 1,000 = 0.5%.
- Wrongful holds ÷ all holds = 5 ÷ 10 = 50%.
Our false-positive rate is the first, because it measures harm to honest sellers. The second rises when there is less fraud to catch, even if no more honest sellers wait. Approving everything makes the first zero, so we also report fraud loss per dollar of sales.
- False positives. Wrongful holds ÷ honest payouts stays under 1%, per payout and per dollar, in every slice. We prove it with the 95% upper bound. This is the highest rate the data still allows, so a small, lucky sample cannot pass.
- Fast. p99 75 ms and p50 about 20 ms per decision. A caller waits at most 150 ms, twice the p99. Then it follows its written fallback rule.
- Fresh. A feature shows an event within 2 minutes; a link within 15 minutes; the full link graph is rebuilt nightly.
- Narrow and short holds. Each names one payout or order amount, a reason and a 48-hour deadline.
- Money safety. A payout is sent at most once for its payout ID and never changes after. A hold takes effect at most once per decision.
- Available. 99.95% of calls get an answer within 150 ms.
1.6 The numbers
From the question:
- 200,000 sellers.
- About 10 million events a day.
- About 200,000 payouts every Friday.
- 10,000 flags and 500 reviews a day.
Our own estimates:
- 1.5 million orders a day, 60% packed in our centers; about $400 million of payouts a week.
- A busiest hour of 10 times the average; events of about 1 KB.
- About 2 million decisions a day, mostly listing edits and sign-ins.
- 25 analysts; about 400 risk holds a week; about 1.5 in 1,000 payouts involving fraud.
- 1.5 million sellers who applied in the past.
These are rough sums, the kind a candidate does at a whiteboard in a few minutes.
| Number | How we get it | Result | What it decides |
|---|---|---|---|
| Events | 10 million ÷ 86,400 s ≈ 116 a second; × 10 in the busiest hour | 1,160 a second at peak | A small load. One ordered log, a list on disk that many programs read, split by seller ID so one seller's events stay in order |
| Decisions | 2 million ÷ 86,400 s ≈ 23 a second; × 10 = 230 at peak. Each reads about 25 keys: 230 × 25 | 5,750 key reads a second | Single-key reads, all at once. Links between sellers are computed ahead, never walked per request |
| Friday payout checks | 200,000 payouts ÷ 3,600 s | 56 a second for one hour | Check the riskiest money first, at most 50 at once |
| Log and decisions | Events: 10 GB a day × 7 days × 3 copies. Decisions: 2 million × 2 KB | Log 210 GB; decisions 4 GB a day | One database writer holds every decision |
| Photos and features | Pack photos: 900,000 a day × 200 KB × 180 days. Features: 200,000 sellers × 3 KB, and 40 million identifiers × 300 bytes | Photos about 32 TB; features 600 MB and 12 GB | Only photos are large, so they go to object storage, cheap space for big files |
| Link graph | 200,000 sellers + 1.5 million past applicants = 1.7 million accounts. Our estimate is about 59 links each: 1.7 million × 59 | about 100 million links | Too big to walk per request, so a nightly batch rebuilds it in about 40 minutes |
| Reviews | 25 analysts × 20 a day = 500; 500 ÷ 10,000 flags = 5%. About 400 holds a week all land on Friday | 5% of flags; Friday's holds fill one day's 500 reviews | People are the first bottleneck. Holds are reviewed first, and Friday needs its own review plan |
| Worst case if holds are capped | 200,000 × 0.15% = 300 fraud, so 199,700 honest. A cap of 0.5% = 1,000 holds: 1,000 ÷ 199,700 | at most 0.50% wrongful, before the overflow holds of the deep dive | A hold budget in code keeps us under 1% before any truth arrives |
What these numbers tell us: rates and bytes are small. We design around 500 reviews a day, truth that arrives weeks late, and money that cannot come back once sent.