Meta Pay Card Setup Funnel Table in Pandas
Last updated: November 29, 2026
Quick Overview
Given a DataFrame of Meta Pay setup events (view setup, add card, verify card, set PIN), produce a funnel table with distinct users per step, conversion from the previous step, and conversion from the top of the funnel.
Meta
November 29, 20260
0
0 solved
Given a DataFrame of Meta Pay setup events (view setup, add card, verify card, set PIN), produce a funnel table with distinct users per step, conversion from the previous step, and conversion from the top of the funnel.
A pandas warm-up in the style of Meta's data science online assessments, where funnels are the default first exercise. The interviewer checks groupby with nunique, keeping steps in funnel order even when a step has no users, and safe division.
What the Interviewer Expects
- Uses nunique per step, not row counts
- Keeps funnel order with reindex and fills empty steps with zero
- Computes previous-step and top-of-funnel rates
- Avoids divide-by-zero warnings and infinite values
- Ignores events that are not part of the funnel
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 make this an ordered funnel where each step must follow the previous one?
- How would you add a breakdown by country as columns?
- How would you compute the median time between steps in pandas?
- Why might verify_card exceed add_card in real logs?
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
A DataFrame with user_id, event_name, ts. The four funnel steps are fixed and ordered. Other events (for example other) are ignored. This is a loose funnel: a user counts at a step if they fir...
Approach
Filter to the funnel events, take nunique of users per event, and reindex to the step order so missing steps appear as 0 and the order is right. shift(1) gives the previous step for the step-ove...