Build a Delinquency Roll Rate Matrix Between Consecutive Months

Last updated: November 29, 2026

Quick Overview

From month-end loan snapshots, build a transition matrix showing, for loans in each delinquency bucket last month, what fraction are in each bucket this month (current, 30, 60, 90+, paid off). Handle loans that leave or enter the portfolio.

Valon
Data Manipulation (SQL/Python)
Data Scientist
Valon
November 29, 2026
Data Scientist
Onsite
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


From month-end loan snapshots, build a transition matrix showing, for loans in each delinquency bucket last month, what fraction are in each bucket this month (current, 30, 60, 90+, paid off). Handle loans that leave or enter the portfolio.

Roll rates drive loss forecasting, staffing for collections and loss mitigation, and investor conversations, all of which a servicer runs on its platform. In a Valon-style data round the interviewer checks self-joins across months, bucket definitions, and how you treat loans that pay off, transfer out or board mid-stream.

What the Interviewer Expects
  • Bucket days past due consistently
  • Self-join snapshots on loan and consecutive month
  • Use a LEFT JOIN so exits are counted, not dropped
  • Normalize each row of the matrix to sum to 1
  • Discuss cures versus roll forward and terminal states
Key Topics to Cover
Roll rates
Self joins
Markov chains
Delinquency buckets
Window functions
How to Approach This
  1. Clarify the schema and expected output format before writing queries.
  2. Use CTEs (WITH clauses) to break complex queries into readable steps.
  3. Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
  4. Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
  5. For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
  • How would you turn this matrix into a 6-month delinquency forecast?
  • Why might roll rates by UPB differ from roll rates by count?
  • How do you handle a servicing transfer where a loan's history before boarding is missing?
  • How would you show this in a dashboard for an operations lead?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice SQL Problems
Sample Answer
Clarify the Data

Same snapshot table: loan_month_snapshot(loan_id, snapshot_month, status, days_past_due, upb_cents). Buckets: C (0 to 29 dpd), D30 (30 to 59), D60 (60 to 89), D90 (90+). Exits next month: PAID (paid...

Approach

Bucket every row in a CTE. Join month m to month m+1 on loan_id with a LEFT JOIN so loans without a next row survive. Derive the next state from status first (paid off, transferred), then from days pa...


Submit Your Answer
Markdown supported

Related Questions