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

Compute unread and multi-account user percentages

Last updated: Mar 29, 2026

Quick Overview

This question evaluates understanding of SQL data manipulation skills such as aggregations, joins, NULL handling, deduplication reasoning, and user- versus person-level computations for accurate percentage metrics.

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

Compute unread and multi-account user percentages

Company: Meta

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Technical Screen

You’re given two tables. Write ANSI-SQL to answer parts (a)–(d). Treat a notification as unread if read_at IS NULL. Denominator for user-level percentages is all user_ids present in people_users (include users with zero notifications). Schema and small samples: people_users person_id | user_id --------- | ------- 1 | 10 1 | 11 2 | 20 3 | 30 4 | 40 4 | 41 notifications notification_id | user_id | created_at | read_at | notification_type --------------- | ------- | ------------------- | ------------------- | ----------------- 100 | 10 | 2025-08-30 10:00:00 | NULL | message 101 | 10 | 2025-08-31 12:00:00 | 2025-08-31 12:30:00 | mention 102 | 11 | 2025-09-01 08:00:00 | NULL | message 103 | 20 | 2025-09-01 09:00:00 | 2025-09-01 09:05:00 | follow 104 | 30 | 2025-08-28 15:00:00 | NULL | message 105 | 41 | 2025-08-29 17:00:00 | 2025-08-29 17:02:00 | like Tasks: (a) What percentage of users have at least one unread notification right now? Return both numerator, denominator, and percentage with 2 decimals. (b) Break (a) down by notification_type (i.e., percentage of users who have ≥1 unread of each type). Users may appear in multiple types; report each type’s numerator, denominator, and percentage. (c) What percentage of persons (distinct person_id) have multiple accounts (>1 user_id)? Report both the percent of persons with multiple accounts and the percent of user_ids that belong to such multi-account persons. (d) Make your queries robust to duplicate rows in notifications (e.g., same notification_id accidentally logged twice). Explain your deduping assumption briefly in a SQL comment.

Quick Answer: This question evaluates understanding of SQL data manipulation skills such as aggregations, joins, NULL handling, deduplication reasoning, and user- versus person-level computations for accurate percentage metrics.

Related Interview Questions

  • Compute ad impression conversion rates - Meta (medium)
  • Count unconnected posts and reactions - Meta (medium)
  • Count heavy callers in 7 days - Meta (medium)
  • Write SQL for call metrics - Meta (medium)
  • Write SQL for multi-account metrics - Meta (medium)
Meta logo
Meta
Oct 13, 2025, 9:49 PM
Data Scientist
Technical Screen
Data Manipulation (SQL/Python)
10
0

You’re given two tables. Write ANSI-SQL to answer parts (a)–(d). Treat a notification as unread if read_at IS NULL. Denominator for user-level percentages is all user_ids present in people_users (include users with zero notifications).

Schema and small samples:

people_users

person_iduser_id
110
111
220
330
440
441

notifications

notification_iduser_idcreated_atread_atnotification_type
100102025-08-30 10:00:00NULLmessage
101102025-08-31 12:00:002025-08-31 12:30:00mention
102112025-09-01 08:00:00NULLmessage
103202025-09-01 09:00:002025-09-01 09:05:00follow
104302025-08-28 15:00:00NULLmessage
105412025-08-29 17:00:002025-08-29 17:02:00like

Tasks: (a) What percentage of users have at least one unread notification right now? Return both numerator, denominator, and percentage with 2 decimals. (b) Break (a) down by notification_type (i.e., percentage of users who have ≥1 unread of each type). Users may appear in multiple types; report each type’s numerator, denominator, and percentage. (c) What percentage of persons (distinct person_id) have multiple accounts (>1 user_id)? Report both the percent of persons with multiple accounts and the percent of user_ids that belong to such multi-account persons. (d) Make your queries robust to duplicate rows in notifications (e.g., same notification_id accidentally logged twice). Explain your deduping assumption briefly in a SQL comment.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Data Manipulation (SQL/Python)•More Meta•More Data Scientist•Meta Data Scientist•Meta 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.