Interview Q&A · questions with model answers
pandas Interview Questions
Part of the study plan for: Machine Learning Engineer · Data Engineer
Ordered by how often they're asked. Most-asked answers are free to read in full; members see every answer and can rate their confidence on each.
-
Write pandas code that finds each customer's latest order and their 30-day rolling spend.
Sort by customer and date, use groupby().tail(1) (or idxmax) for the latest order, and a time-based rolling window per customer for the 30-day spend. Time-based windows ("30D") need a datetime index…