Three Hours for Yesterday's Numbers
A medium Spark interview practice problem on DataDriven. Write and execute real spark code with instant feedback.
- Domain
- Spark
- Difficulty
- medium
- Seniority
- L5
Problem
A nightly job refreshes `daily_category_sales`, a summary of one day's sales broken down by product category, but it rebuilds from the entire multi-year `transactions` history on every run even though only the most recent day is ever new. For the latest day present in `transactions`, total each product category's revenue and units sold, and make the job read only that day's data rather than the whole table.
Summary
Three terabytes scanned. One day changed.
Practice This Problem
Solve this Spark problem with real code execution. DataDriven runs your solution and checks it automatically.