Pandas data engineering interview problem. Difficulty: beginner. Pattern: Date Functions. About 12 minutes. Free to practice.
Parse DD/MM/YYYY and extract year, month, day. Treat this as a production helper: match the contracted return shape, including empty and duplicate inputs.
Parse date with format %d/%m/%Y, then add integer year, month, day columns. Keep date, value, and the parts. Sort by date. Assign result.
Input: string dates Output: date | value | year | month | day 2024-01-01 | 1 | 2024 | 1 | 1 2024-02-15 | 2 | 2024 | 2 | 15 2024-03-31 | 3 | 2024 | 3 | 31 2024-04-10 | 4 | 2024 | 4 | 10 Day-first parsing avoids US month/day swaps.
Topics: lakebench, pandas, to_datetime.
More interview problems · All interview problems · Learn data engineering
Interview-style drill: Parse DD/MM/YYYY and extract year, month, day.
Parse `date` with format `%d/%m/%Y`, then add integer `year`, `month`, `day` columns. Keep `date`, `value`, and the parts. Sort by `date`. Assign `result`.