Convert Dates to Calendar Quarter Labels in SQL/Python
Company: Point72
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: Medium
Interview Round: Technical Screen
Transactions
+----+-----------+
| id | trans_dt |
+----+-----------+
| 1 | 20230115 |
| 2 | 20230402 |
| 3 | 20230930 |
| 4 | 20231201 |
+----+-----------+
##### Scenario
Financial reporting needs quarterly sales aggregation from raw numeric dates.
##### Question
Given a table of transactions where the date is stored as an 8-digit integer (YYYYMMDD), write SQL and/or Python code that converts each date into its calendar quarter label (e.g., 20230215 → 2023_Q
1).
##### Hints
Convert to date type, extract month, map month to quarter with CASE or arithmetic.
Quick Answer: This question evaluates a candidate's ability to perform date/time data transformation and normalization in SQL or Python, focusing on converting raw numeric dates into standardized quarter labels for aggregation and reporting.