PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCareers

Quick Overview

This question evaluates data manipulation and aggregation skills, including joining event logs with metadata, deduplicating by categorical attribute, date-based filtering, and computing per-user distinct counts.

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

Compute article-type diversity per user and histogram

Company: LinkedIn

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: easy

Interview Round: Technical Screen

You track article views and article metadata. ### Tables `article_views` - `user_id` INT - `article_id` INT - `view_date` DATE `articles` - `article_id` INT (PK) - `article_type` VARCHAR ### Tasks 1) For each user, compute the **number of distinct article types** they viewed on **2019-01-01**. - Output columns: `user_id`, `num_article_types`. 2) Build a **histogram** of `num_article_types` on **2019-01-01** (i.e., how many users viewed 1 type, 2 types, etc.). - Output columns: `num_article_types`, `num_users`. ### Notes - If a user viewed multiple articles of the same type, it counts once. - Users with zero views on 2019-01-01 can be excluded unless otherwise specified.

Quick Answer: This question evaluates data manipulation and aggregation skills, including joining event logs with metadata, deduplicating by categorical attribute, date-based filtering, and computing per-user distinct counts.

Last updated: May 7, 2026

Loading coding console...

PracHub

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

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • Careers
  • 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.

Related Coding Questions

  • Write SQL for rankings, state, and aggregations - LinkedIn (easy)
  • Analyze member video posting behavior by country - LinkedIn (easy)
  • Compute each member’s current notification status - LinkedIn (easy)
  • Find top countries by population per continent - LinkedIn (easy)
  • Count Article Types Viewed - LinkedIn (medium)