Loading...
Shared Category Purchasers
A medium SQL interview practice problem on DataDriven. Write and execute real sql code with instant grading.
- Domain
- SQL
- Difficulty
- medium
- Seniority
- mid
Problem
The recommendations team is building a collaborative filtering feature and needs to identify users with overlapping purchase interests. For each product category, find pairs of users who both purchased in that category, showing the category, both user IDs, and how many products they share, with the highest overlap first.
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.