Loading...
User Campaign Overlap Percentage
A hard SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- hard
- Seniority
- senior
Problem
For every pair of users, calculate the overlap ratio of shared ad campaigns relative to the smaller user's campaign set. Include only pairs that share at least one campaign. Show the two user IDs, the shared campaign count, and the overlap ratio.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a live PostgreSQL database and grades it instantly.