PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates proficiency in SQL-based data manipulation and analytical querying, covering aggregation, grouping, ranking, and the correlation of impressions with user engagement and feature usage metrics.

  • Medium
  • Pinterest
  • Data Manipulation (SQL/Python)
  • Data Scientist

Analyze Global Engagement and Impressions with SQL Queries

Company: Pinterest

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

impressions +---------+---------+----------+----------------+ | user_id | country | category | impression_cnt | +---------+---------+----------+----------------+ | 1 | US | Sports | 120 | | 2 | US | News | 80 | | 3 | CN | Games | 200 | +---------+---------+----------+----------------+ ​ user_activity +---------+-------------+ | user_id | activity_dt | +---------+-------------+ | 1 | 2023-09-01 | | 1 | 2023-09-02 | | 1 | 2023-09-04 | | 2 | 2023-09-01 | | 3 | 2023-09-05 | +---------+-------------+ ​ feature_usage +---------+-------------+-----------+ | user_id | usage_dt | feature | +---------+-------------+-----------+ | 1 | 2023-09-02 | search | | 1 | 2023-09-02 | share | | 1 | 2023-09-02 | save | | 2 | 2023-09-03 | search | | 3 | 2023-09-05 | save | +---------+-------------+-----------+ ##### Scenario A global content platform wants to understand engagement and impressions across countries in the last week. ##### Question Write SQL to (a) return, for every country, the content category with the highest total impressions and its count; (b) compute the weekly heavy-user rate, where a heavy user is one who was active on at least 4 distinct days in the last 7 and, on at least one of those days, used 3 or more distinct features. ##### Hints Join the three tables, use GROUP BY with conditional aggregation, distinct counts for days/features, and window/CTE for ranking the top category per country.

Quick Answer: This question evaluates proficiency in SQL-based data manipulation and analytical querying, covering aggregation, grouping, ranking, and the correlation of impressions with user engagement and feature usage metrics.

Last updated: Mar 29, 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
  • 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 Queries for Pinterest Engagement Tasks - Pinterest (medium)
  • Write SQL for top categories and highly active users - Pinterest (easy)
  • Compute percent of first-cancelled users who never rebook - Pinterest (medium)
  • Compute percent of first-cancel users who never return - Pinterest (easy)
  • Find top category by video time spent - Pinterest (Medium)