Loading interview...
Spend and Rank
A hard SQL mock interview question on DataDriven. Practice with AI-powered feedback, real code execution, and a hire/no-hire decision.
- Domain
- SQL
- Difficulty
- hard
Interview Prompt
The executive team wants a leaderboard of the 5 biggest spenders for the quarterly review. Sum spending per user, assign positions starting at 1 for the biggest spender with ties sharing a position, and keep only users in the top 5 positions. Return the username, total spend, and position.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write your sql solution with real code execution
- Get instant feedback and a hire/no-hire decision