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
- L4
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.
Summary
They bought different things from the same aisle.
Practice This Problem
Solve this SQL problem with real code execution. DataDriven runs your SQL queries against a real database and grades it automatically.