PracHub
QuestionsCoachesLearningGuidesInterview Prep

Quick Overview

This question evaluates a data scientist's competence in Data Manipulation (SQL/Python), focusing on SQL aggregation, joining call and user snapshot tables, temporal filtering, and computing user-level engagement metrics across incoming and outgoing call records.

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

Compute percent of active users with 50+ calls

Company: Meta

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: easy

Interview Round: Technical Screen

## Problem You work on a Messenger-like app. You want to measure how many **active users in Great Britain (GB) today** have been heavy callers recently. ### Tables Assume two tables (names can vary). #### 1) `calls` One row per call record. - `call_id` (STRING, primary key) - `caller_id` (STRING) - `receiver_id` (STRING) - `date` (STRING) — call date in string format (e.g., `'2025-11-06'`) - `duration` (INT) — call duration (seconds) #### 2) `user_daily_status` One row per user per day describing user attributes and activity. - `user_id` (STRING) - `country` (STRING) - `is_active` (INT) — `1` if the user is active on that date, else `0` - `date` (STRING) — snapshot date in string format (e.g., `'2025-11-06'`) ### Definitions / assumptions - “GB active users today” = users with `country = 'GB'`, `is_active = 1` on **today’s** snapshot date. - “Previous seven days” = the 7-day lookback window **excluding today**, i.e. `[today - 7 days, today - 1 day]`. - A user’s “call records” count includes both: - outgoing calls where the user is the `caller_id`, and - incoming calls where the user is the `receiver_id`. - Count calls as number of call records (e.g., count of `call_id`). ## Task Write a SQL query to compute: - the **percentage** of today’s GB active users who had **more than 50** call records in the previous 7 days. ### Output Return at least: - `as_of_date` - `active_users_today` (denominator) - `active_users_gt_50_calls_last_7d` (numerator) - `pct_active_users_gt_50_calls_last_7d` (You may assume your SQL dialect provides a way to parse the date string into a date type.)

Quick Answer: This question evaluates a data scientist's competence in Data Manipulation (SQL/Python), focusing on SQL aggregation, joining call and user snapshot tables, temporal filtering, and computing user-level engagement metrics across incoming and outgoing call records.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 8,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
  • AI Coding 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

  • Calculate Daily Survey Response Rates by Country - Meta (medium)
  • Compare Survey Satisfaction for New and Established Users - Meta (medium)
  • Find A Low-Quality Annotator From Label Data - Meta (hard)
  • Compute ad impression conversion rates - Meta (medium)
  • Count unconnected posts and reactions - Meta (medium)