DataDrivenDataDriven
LearnPracticeInterviewDailyJobsCommunity

The Heaviest Carts

A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant feedback.

Domain
SQL
Difficulty
medium
Seniority
mid

Problem

The merchandising team wants to see which products drive the most spend within each age cohort, looking only at customers whose accounts are currently active. For each age bucket, return the product id alongside its total revenue for the three products that earned the most, from the biggest earner down.

Summary

Inside every age group, a few customers carry the basket. Find them.

Practice This Problem

Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and checks it automatically.

Related

  • All Practice Problems
  • Mock Interview Mode
  • SQL Interview Questions
  • Data Engineering Interview Prep Guide
  • Daily Challenge
  • Data Engineering Lessons