Share of New Accounts Receiving Direct Deposit Within 14 Days
Last updated: November 29, 2026
Quick Overview
Using a users table and a deposits table, write SQL that returns, for each signup week, the number of new users and the percentage whose first direct deposit landed within 14 days of signup.
Onepay
November 29, 20260
0
0 solved
Using a users table and a deposits table, write SQL that returns, for each signup week, the number of new users and the percentage whose first direct deposit landed within 14 days of signup.
For a checking product like OnePay, setting up direct deposit is the activation event that predicts long-term engagement. This screen checks that you can isolate the first qualifying event per user, join it back to signup cohorts, and avoid the classic denominator mistakes.
What the Interviewer Expects
- Filter deposits to direct deposit type before taking the first one
- Use a LEFT JOIN so users with no deposit stay in the denominator
- Measure the 14-day window from each user's own signup time
- Group by signup week, not deposit week
- Mention that recent cohorts are not yet fully observed
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 exclude small test deposits that some employers send to verify an account?
- How would you show the full curve (day 1 to day 30) instead of one cutoff?
- Which user attributes would you break this down by to find onboarding friction?
- How would you handle users who moved direct deposit away later?
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
users(user_id, signup_at) has one row per account. deposits(user_id, deposit_at, deposit_type, amount_cents) holds all incoming money, where deposit_type = 'direct_deposit' marks payroll or bene...
Approach
Find each user's first direct deposit with MIN(deposit_at) grouped by user. LEFT JOIN that to users so users with none still count. A user converts if the first deposit is within 14 days after signu...