The Company You Keep
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
Two viewers, one audience: measure how far their campaign worlds overlap.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and checks it automatically.