The Article Views II interview question is an extension of the basic "Article Views" database problem. In this version, you are tasked with finding all users who viewed more than one article on the same date. This Article Views II coding problem requires you to perform multi-column grouping and aggregate filtering to identify high-activity users.
LinkedIn and other data-driven companies use this to test a candidate's proficiency with SQL GROUP BY and HAVING clauses. It evaluates your ability to handle complex conditions involving multiple dimensions (user, article, and date) and ensures you can correctly differentiate between a user viewing the same article multiple times versus distinct articles on the same day.
This problem follows the Database interview pattern of "Group-Aggregate-Filter." You group the records by viewer_id and view_date, and then use the COUNT(DISTINCT article_id) function to count how many unique articles each viewer saw on that specific day. Finally, a HAVING clause filters for counts greater than 1.
Imagine the Views table:
Whenever you see a requirement like "more than X on the same Y," immediately think of GROUP BY Y combined with a HAVING clause. Practice using COUNT(DISTINCT ...) to handle duplicate entries in log-style data.
| Title | Difficulty | Topics | LeetCode |
|---|---|---|---|
| New Users Daily Count | Medium | Solve | |
| Active Businesses | Medium | Solve | |
| Active Users | Medium | Solve | |
| Activity Participants | Medium | Solve | |
| All People Report to the Given Manager | Medium | Solve |