MEDIUMVerified Real Interview• Risk & Fraud Quantitative Analyst

High-Dispute Merchant Chargeback Thresholds

Stripe's Risk team monitors merchants whose chargeback dispute rate exceeds regulatory caps.

Write a SQL query to identify all merchants with at least 5 processed charges whose dispute rate is strictly greater than 20.0%. Return merchant_id, total charges (total_charges), disputed charges (disputed_charges), and the dispute percentage rounded to 2 decimals (dispute_pct). Sort by dispute_pct descending.

Tables:

  • charges (charge_id INT, merchant_id INT, amount DECIMAL, is_disputed BOOLEAN)

Execution Sandbox:

Your query executes inside an isolated in-memory PostgreSQL engine (PGlite WebAssembly). You have full access to standard PostgreSQL aggregations, window functions, and CTEs.

Standard SQL (ANSI)|Ln 1, Col 1
⌘↵ Run Query
Ready to execute. Press Run (⌘+Enter)
Write your query and click “Run” or press ⌘+Enter to inspect output.