Fraud labels that arrive late
Mock interview. You're interviewing for a senior data scientist job on a payments company's fraud team. When a stolen card is used, the real card owner usually disputes the payment weeks later. Every payment gets a risk score from 0 to 99. The interviewer says: "A dashboard says fraud fell sharply in October. Is that real? And at what risk score should we block payments?"
payments: one row per payment, with the risk_score, whether it was authorized, and disputed_on: the day a fraud dispute arrived (empty if none so far). The data was pulled on 31 October 2026. Use authorized payments only.
Question 1: The dashboard view
"Show the fraud dispute rate by the week the payment was made."
Expected output
- Columns
week_start(Monday),payments,disputed,dispute_rate_pct(rounded to 2 decimals); authorized payments only; sorted byweek_start
Example of the shape (made-up values):
| week_start | payments | disputed | dispute_rate_pct |
|---|---|---|---|
| 2026-01-05 | 400 | 4 | 1.00 |
Hints, the later questions and the answer come with Pro.
Question 1 of 4
Write your query here. Ctrl + Enter submits.