Visa·Data Scientist·Technical Phone Screen
- Given a transactions table, calculate each user's total amount spent in 2023, excluding negative amounts (refunds). Return user_id and total_spent sorted descending. Solve it first in Python using pandas, then rewrite the same logic in SQL using a CTE and GROUP BY.
“The pandas part was fine, filter by year, drop negatives, groupby user_id, sum, sort.”