PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Data Manipulation (SQL/Python)/LinkedIn

Count Article Types Viewed

Last updated: Mar 29, 2026

Quick Overview

This question evaluates a candidate's ability to perform relational joins, deduplicate by categorical attributes, apply date-based filtering, and compute grouped aggregations and distributional histograms, within the domain of Data Manipulation (SQL/Python) for a Data Scientist role.

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

Count Article Types Viewed

Company: LinkedIn

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Technical Screen

You are given article view events and article metadata. `article_views(user_id INT, article_id INT, view_date DATE)` - One row per article view event. `articles(article_id INT, article_type VARCHAR)` - Maps each article to its type. Join key: `article_views.article_id = articles.article_id`. Assume `view_date` is a calendar date and timezone handling is not needed. Tasks: 1. For `2019-01-01`, return the number of distinct article types viewed by each user. 2. Build a histogram of the number of distinct article types viewed per user across the full dataset. In other words, for each possible `num_article_types`, return how many users viewed exactly that many distinct article types. Definitions: - If a user views multiple articles of the same `article_type`, count that type only once for that user. - For the histogram in task 2, use all available dates unless otherwise stated. Required output: - Task 1: `user_id, num_article_types` - Task 2: `num_article_types, num_users`

Quick Answer: This question evaluates a candidate's ability to perform relational joins, deduplicate by categorical attributes, apply date-based filtering, and compute grouped aggregations and distributional histograms, within the domain of Data Manipulation (SQL/Python) for a Data Scientist role.

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
Aug 3, 2025, 12:00 AM
Data Scientist
Technical Screen
Data Manipulation (SQL/Python)
2
0

You are given article view events and article metadata.

article_views(user_id INT, article_id INT, view_date DATE)

  • One row per article view event.

articles(article_id INT, article_type VARCHAR)

  • Maps each article to its type.

Join key: article_views.article_id = articles.article_id. Assume view_date is a calendar date and timezone handling is not needed.

Tasks:

  1. For 2019-01-01 , return the number of distinct article types viewed by each user.
  2. Build a histogram of the number of distinct article types viewed per user across the full dataset. In other words, for each possible num_article_types , return how many users viewed exactly that many distinct article types.

Definitions:

  • If a user views multiple articles of the same article_type , count that type only once for that user.
  • For the histogram in task 2, use all available dates unless otherwise stated.

Required output:

  • Task 1: user_id, num_article_types
  • Task 2: 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.