Weekly Rate Check to Funded Loan Funnel in SQL
Last updated: November 29, 2026
Quick Overview
Given a rate_checks table and a loan_events table (offer_accepted, funded), write SQL that reports, for each week of first rate check, how many unique applicants accepted an offer and funded a loan within 30 days, with step conversion rates.
Upstart
November 29, 20260
0
0 solved
Given a rate_checks table and a loan_events table (offer_accepted, funded), write SQL that reports, for each week of first rate check, how many unique applicants accepted an offer and funded a loan within 30 days, with step conversion rates.
SQL screens for analytics roles at Upstart usually center on the borrower funnel, because that is the data analysts query every day. The interviewer checks cohort definition, correct join conditions on time windows, and deduplication of repeat rate checks and duplicate events.
What the Interviewer Expects
- Cohorts applicants by their first rate check, not every check
- Restricts events to a window after the rate check
- Uses a LEFT JOIN so applicants with no events stay in the denominator
- Deduplicates repeated events with MAX or COUNT DISTINCT
- Guards against division by zero
Key Topics to Cover
How to Approach This
- Clarify the schema and expected output format before writing queries.
- Use CTEs (WITH clauses) to break complex queries into readable steps.
- Consider window functions (ROW_NUMBER, RANK, LAG, LEAD) for ranking and sequential analysis.
- Watch for NULLs, duplicates, and edge cases in JOINs and GROUP BY.
- For pandas, prefer vectorized operations over row-by-row iteration.
Possible Follow-up Questions
- How would you add a median days from rate check to funding?
- How would you split the funnel by acquisition channel?
- What changes if one applicant can fund two loans?
- How would you exclude cohorts that have not had 30 days to mature?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice SQL ProblemsSample Answer
Clarify the Data
rate_checks(applicant_id, checked_at) can have several rows per applicant. loan_events(applicant_id, event_type, event_at) holds offer_accepted and funded, and events can be logged twice. I as...
Approach
Find each applicant's first check, LEFT JOIN their events inside the 30 day window, collapse to one row per applicant with 0/1 flags via MAX, then aggregate by cohort week. The LEFT JOIN keeps non-con...