Two Sides of the Ledger

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

An analyst is reconciling each region's budget on one monthly ledger built from the charges in cloud_costs and the allocations in cost_allocs, where a charge draws the region's balance down and an allocation builds it back up. For every region and month, show the net movement and the balance standing after it.

Summary

Two cost tables, one region. Which way does the balance tip?

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