Loading interview...

User Spend Segmentation by Category

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
senior

Interview Prompt

Compute each user's average basket size (total spend / transaction count) per category from transactions combined with products. Label 'High' if over $500, 'Medium' between $200 and $500, 'Low' under $200. Then produce a per-category, per-segment summary: unique users, total transactions, total sales, and average basket size. Return the category, segment, unique users, total transactions, total sales, and average basket size.

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