Weekly Share of New Accounts Making a Pix Within Seven Days
Last updated: November 29, 2026
Quick Overview
Given customers(customer_id, signup_at) and pix_transfers(transfer_id, customer_id, created_at, status), return for each signup week the number of new customers and the percentage whose first completed Pix transfer happened within 7 days of signup.
Nubank
November 29, 20260
0
0 solved
Given customers(customer_id, signup_at) and pix_transfers(transfer_id, customer_id, created_at, status), return for each signup week the number of new customers and the percentage whose first completed Pix transfer happened within 7 days of signup.
Early Pix usage is a strong signal that a new NuConta becomes a primary account, so activation metrics like this are common in Nubank product analytics. The interviewer checks a clean first-event aggregation, a correct join that keeps non-activated customers, and attention to status and time boundaries.
What the Interviewer Expects
- Filters to completed transfers before taking the first one
- LEFT JOINs so customers with no Pix stay in the denominator
- Uses a half-open 7-day window from the signup timestamp
- Groups by signup week, not transfer week
- Avoids integer division
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 the most recent week, whose 7-day window has not closed yet?
- How would you split activation by acquisition channel or country?
- Would you count incoming Pix, and why or why not?
- How would you turn this into a daily dashboard without full rescans?
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
Assume one row per customer, timestamps in a single timezone (for Brazil, pick Sao Paulo time explicitly), and that status includes 'completed', 'failed' and 'pending'. Activation counts only outgoi...
Approach
Find each customer's first completed Pix with MIN(created_at). Join it to customers with a LEFT JOIN, bucket signups by week, and count those whose first Pix falls in `[signup_at, signup_at + 7 days...