DataDriven
LearnPracticeInterviewDiscussDailyJobs

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
Seniority
L5

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.

Summary

Five thrones at the top of the spending leaderboard.

How This Interview Works

  1. Read the vague prompt (just like a real interview)
  2. Ask clarifying questions to the AI interviewer
  3. Write your sql solution with real code execution
  4. Get instant feedback and a hire/no-hire decision

Related

  • All Mock Interviews
  • Practice Mode (untimed)
  • SQL Interview Questions
  • Data Engineering Interview Prep Guide
  • Practice Problems
  • Daily Challenge