Spending Velocity

A medium SQL mock interview question on DataDriven, with an AI interviewer who asks follow-up questions and a hire or no-hire decision at the end.

Domain
SQL
Difficulty
medium
Seniority
L5

Interview Prompt

A fraud model watches each customer's spending pace, so for every purchase in the transactions table we need a trailing total of that customer's recent purchase amounts, up to and including that purchase. Return user_id, transaction_date, total_amount and that trailing total.

Summary

Fraud hides in the pace, not the price. Watch each customer's last seven purchases roll forward.

How This Interview Works

  1. Read the vague prompt (just like a real interview)
  2. Ask clarifying questions to the AI interviewer
  3. Write and run your SQL against a real database
  4. Answer the interviewer's follow-up questions, then get a hire or no-hire decision