The Space Between Us
A hard SQL interview practice problem on DataDriven. Write and execute real sql code with instant feedback.
- Domain
- SQL
- Difficulty
- hard
- Seniority
- L5
Problem
We run an ad platform and want to know how much any two users overlap in the campaigns they were shown. For each pair of users that shares at least one campaign, report the overlap ratio: the number of campaigns both saw, divided by the number of campaigns at least one of them saw, rounded to two decimals.
Summary
Every viewer lives inside a world of campaigns. Measure how much two of those worlds are really one.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and checks it automatically.