PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches
|Home/Data Manipulation (SQL/Python)/LinkedIn

Count viewed article types

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's competency in SQL data manipulation and analytics, focusing on joins between event and reference tables, distinct-count aggregation, date-based filtering, and building distributional summaries by user.

  • medium
  • LinkedIn
  • Data Manipulation (SQL/Python)
  • Data Scientist

Count viewed article types

Company: LinkedIn

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Technical Screen

You are given two tables about article views. Table 1: `article_views` - `user_id` INT - `article_id` INT - `view_date` DATE — UTC calendar date of the view Table 2: `articles` - `article_id` INT - `article_type` STRING Relationship: - `article_views.article_id = articles.article_id` Assumptions: - Each row in `article_views` represents one article view event. - Dates are interpreted as UTC calendar dates. Write SQL for the following: 1. On `2019-01-01` UTC, compute the number of distinct article types viewed by each user. - Output columns: `user_id, num_article_types` 2. Build a histogram of the number of distinct article types viewed per user across all available dates. - For each distinct value of `num_article_types`, return how many users have that count. - Output columns: `num_article_types, num_users`

Quick Answer: This question evaluates a candidate's competency in SQL data manipulation and analytics, focusing on joins between event and reference tables, distinct-count aggregation, date-based filtering, and building distributional summaries by user.

Related Interview Questions

  • Write SQL for rankings, state, and aggregations - LinkedIn (easy)
  • Analyze member video posting behavior by country - LinkedIn (easy)
  • Compute article-type diversity per user and histogram - LinkedIn (easy)
  • Compute each member’s current notification status - LinkedIn (easy)
  • Find top countries by population per continent - LinkedIn (easy)
LinkedIn logo
LinkedIn
Jul 20, 2025, 12:00 AM
Data Scientist
Technical Screen
Data Manipulation (SQL/Python)
3
0

You are given two tables about article views.

Table 1: article_views

  • user_id INT
  • article_id INT
  • view_date DATE — UTC calendar date of the view

Table 2: articles

  • article_id INT
  • article_type STRING

Relationship:

  • article_views.article_id = articles.article_id

Assumptions:

  • Each row in article_views represents one article view event.
  • Dates are interpreted as UTC calendar dates.

Write SQL for the following:

  1. On 2019-01-01 UTC, compute the number of distinct article types viewed by each user.
    • Output columns: user_id, num_article_types
  2. Build a histogram of the number of distinct article types viewed per user across all available dates.
    • For each distinct value of num_article_types , return how many users have that count.
    • Output columns: num_article_types, num_users

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Data Manipulation (SQL/Python)•More LinkedIn•More Data Scientist•LinkedIn Data Scientist•LinkedIn Data Manipulation (SQL/Python)•Data Scientist Data Manipulation (SQL/Python)
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.