Mock interview. You're interviewing for a senior credit risk analyst job on a credit card team. The interviewer explains: "Each month a card is either current or 30, 60 or 90 days past due. We want to know how cards move between those buckets, who's most at risk, and what it might cost."
statements has one row per card per month from January to June 2026, with days_past_due of 0, 30, 60 or 90 (90 means 90 or more).
"Build a roll-rate table: for each move from one month to the next, where did cards go? Show the from-bucket, to-bucket, number of moves and the percentage of the from-bucket."
Expected output
from_dpd, to_dpd, moves, pct_of_from (rounded to 1 decimal); sorted by from_dpd, then to_dpdExample of the shape (made-up values):
| from_dpd | to_dpd | moves | pct_of_from |
|---|---|---|---|
| 0 | 0 | 2000 | 90.0 |
| 0 | 30 | 222 | 10.0 |
Hints, the later steps and the answer come with Pro.
Step 1 of 4
Write your query here. Ctrl + Enter submits.