# Department Spend Difference

> The compensation gap between departments.

Canonical URL: <https://datadriven.io/problems/department_spend_difference>

Domain: SQL · Difficulty: easy · Seniority: L3

## Problem

Leadership wants to compare peak metric values between engineering and marketing. Find the highest metric value recorded in each of the two departments, then return the absolute gap between them as a single number.

## Related

- [All practice problems](https://datadriven.io/problems)
- [Mock interview mode](https://datadriven.io/interview/department_spend_difference)
- [SQL Interview Questions](https://datadriven.io/sql-interview-questions)
- [Data Engineering Interview Prep Guide](https://datadriven.io/data-engineer-interview-prep)
- [Daily Challenge](https://datadriven.io/daily)

---

Source: DataDriven (https://datadriven.io). 100% free data engineering interview prep. Live code execution against Postgres 16, Python 3.11, and Spark sandboxes. No paywall, no premium tier, no signup gate.