Build Cumulative Net Charge-Off Vintage Curves in Pandas

Last updated: November 29, 2026

Quick Overview

Given loan originations, charge-off events and post charge-off recoveries, use pandas to produce a vintage table where each row is an origination month, each column is months on book, and each cell is cumulative net charge-offs divided by original vintage balance, blank where the vintage has not aged that far.

OneMain Financial
Data Manipulation (SQL/Python)
Data Scientist
OneMain Financial
November 29, 2026
Data Scientist
Take-home Project
Data Manipulation (SQL/Python)
Medium

0

0

0 solved


Given loan originations, charge-off events and post charge-off recoveries, use pandas to produce a vintage table where each row is an origination month, each column is months on book, and each cell is cumulative net charge-offs divided by original vintage balance, blank where the vintage has not aged that far.

Vintage curves are how OneMain's credit and pricing teams see whether newer loans are performing worse than older ones, often well before portfolio-level loss rates move. A take-home like this checks month arithmetic, netting recoveries, reindexing to a complete grid, and not confusing missing data with zero losses.

What the Interviewer Expects
  • Bucket loans by origination month and compute months on book for each event
  • Net recoveries against charge-offs (recoveries are negative loss)
  • Use origination balance as the denominator so vintages of different size compare
  • Reindex to a full grid so months with no losses show 0, then cumsum across columns
  • Mask cells beyond each vintage's age as NaN, not 0
Key Topics to Cover
vintage analysis
pandas
months on book
net charge-off
credit risk
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 compare the 2026 vintages against 2024 at the same months on book in a chart?
  • Why do curves for secured (auto collateral) loans look different from unsecured?
  • How would you adjust for a mix shift toward larger loans in recent vintages?
  • How would you forecast where an immature vintage ends up?
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

loans(loan_id, orig_date, orig_amount), chargeoffs(loan_id, event_date, co_amount) and recoveries(loan_id, event_date, rec_amount). One loan charges off at most once but may have several recover...

Approach

Convert dates to an integer month index (year * 12 + month). Stack charge-offs as positive and recoveries as negative amounts, join to the loan's vintage, compute MOB, sum by (vintage, MOB), reindex t...


Submit Your Answer
Markdown supported

Related Questions