Article Views II

ASKED IN INTERVIEW
2pts
Linked In

Problem Statement

LinkedIn data scientists track high-engagement users to improve content recommendations. A user is considered "highly engaged" on a particular day if they view more than one unique article on that same day.

Write an SQL query to find all such users.

Rules:

  • A user must have viewed at least two different articles on the same date.
  • Viewing the same article multiple times on the same date does not count as "more than one article".
  • Output columns: id (which is the viewer_id).
  • Results must be sorted by id in ascending order.
Tests your understanding of
Grouping, Filtering and Aggregation

Input Tables

views
article_id(INTEGER)author_id(INTEGER)viewer_id(INTEGER)view_date(DATE)
1352026-02-01
2352026-02-01
1362026-02-02
1362026-02-02
4762026-02-03
3442026-02-01
articles
article_id(INTEGER)title(VARCHAR)category(VARCHAR)
1SQL BasicsTech
2Data Science 101Tech
3LinkedIn TipsCareer
viewer_profiles
viewer_id(INTEGER)membership_type(VARCHAR)
4Free
5Premium
6Premium

Expected Output

id(INTEGER)
5

Tags

EasyASKED IN INTERVIEWGroupingFilteringAggregation
10-15 min
74%

Hints