PracHub
QuestionsPremiumLearningGuidesInterview PrepNEWCoaches

Quick Overview

This question evaluates a data scientist's ability to perform relational data manipulation and aggregation with SQL or Python, covering competencies such as handling one-to-many joins, grouping and bucketing counts, deduplicating across related tables, and computing cohort-level percentages from boolean flags.

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

Compute multi-account user distribution and unread pct

Company: Meta

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: easy

Interview Round: Technical Screen

You are working on a product where a **user** can have multiple **accounts**, and each account can receive **notifications**. ### Tables Assume the following schemas: **users** - `user_id` BIGINT PRIMARY KEY - `created_at` TIMESTAMP **accounts** - `account_id` BIGINT PRIMARY KEY - `user_id` BIGINT NOT NULL REFERENCES `users(user_id)` - `created_at` TIMESTAMP **notifications** - `notification_id` BIGINT PRIMARY KEY - `account_id` BIGINT NOT NULL REFERENCES `accounts(account_id)` - `created_at` TIMESTAMP - `is_read` BOOLEAN -- `FALSE` means unread ### Tasks 1) **Account-count distribution**: Return the number of users who have: - exactly **2** accounts - exactly **3** accounts - **4 or more** accounts **Required output columns**: `account_bucket`, `num_users`. 2) **Unread-notification rate among multi-account users**: Among users with **2+ accounts**, compute the **percentage of users** who have **at least one unread notification** across any of their accounts. **Required output columns**: `pct_users_with_unread` (as a percent or decimal; specify which you choose).

Quick Answer: This question evaluates a data scientist's ability to perform relational data manipulation and aggregation with SQL or Python, covering competencies such as handling one-to-many joins, grouping and bucketing counts, deduplicating across related tables, and computing cohort-level percentages from boolean flags.

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

  • 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)