Cost Efficiency Variance

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

Interview Prompt

Some months' per-service cost figures swing far more than others, and the finance team's chargeback review wants that spread measured straight from `cloud_costs`. For each billing line, split its amount across the services billed in its region to get a cost ratio, then show every year-month, earliest first, with the average ratio, the month's mean, and the average absolute gap between each line's ratio and that mean.

Summary

Cost efficiency varies. By how much?

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