PracHub
QuestionsPremiumCoachesLearningGuidesInterview Prep
|Home/Data Manipulation (SQL/Python)/Meta

Find the most-used app

Last updated: Mar 29, 2026

Quick Overview

This question evaluates data manipulation and metrics-definition skills, emphasizing SQL and Python proficiency for aggregating user activity and joining app metadata within analytics workflows.

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

Find the most-used app

Company: Meta

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

You work on Oculus app engagement analytics. ## Tables ### `user_activity` - `user_id` (BIGINT) - `date` (DATE) — day of activity (assume UTC unless otherwise specified) - `app_id` (INT) - `session_id` (VARCHAR) - `duration` (INT) — session duration in seconds ### `apps` - `app_id` (INT, PK) - `app_name` (VARCHAR) - `app_category` (VARCHAR) Relationship: `user_activity.app_id` → `apps.app_id`. ## Task For the **last 7 days** (inclusive) relative to a provided `:as_of_date`, identify the **“most used app.”** 1) Write a SQL query that returns the most-used app using **one clear definition** of “most used” (e.g., **number of sessions** or **total time spent**). 2) In 2–3 sentences, explain the pros/cons of at least **two** plausible definitions (e.g., sessions vs. total time vs. unique users). ### Output Return exactly one row with at least: - `app_id` - `app_name` - your chosen usage metric (e.g., `session_cnt` or `total_duration_seconds`) Assume ties do **not** need a deterministic tie-breaker unless you choose to add one.

Quick Answer: This question evaluates data manipulation and metrics-definition skills, emphasizing SQL and Python proficiency for aggregating user activity and joining app metadata within analytics workflows.

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
Aug 17, 2025, 12:00 AM
Data Scientist
Onsite
Data Manipulation (SQL/Python)
3
0

You work on Oculus app engagement analytics.

Tables

user_activity

  • user_id (BIGINT)
  • date (DATE) — day of activity (assume UTC unless otherwise specified)
  • app_id (INT)
  • session_id (VARCHAR)
  • duration (INT) — session duration in seconds

apps

  • app_id (INT, PK)
  • app_name (VARCHAR)
  • app_category (VARCHAR)

Relationship: user_activity.app_id → apps.app_id.

Task

For the last 7 days (inclusive) relative to a provided :as_of_date, identify the “most used app.”

  1. Write a SQL query that returns the most-used app using one clear definition of “most used” (e.g., number of sessions or total time spent ).
  2. In 2–3 sentences, explain the pros/cons of at least two plausible definitions (e.g., sessions vs. total time vs. unique users).

Output

Return exactly one row with at least:

  • app_id
  • app_name
  • your chosen usage metric (e.g., session_cnt or total_duration_seconds )

Assume ties do not need a deterministic tie-breaker unless you choose to add one.

Submit Your Answer

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 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
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.