PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates sessionization, time-based aggregation, and metric design competencies using SQL and Python, testing a data scientist's ability to process timestamped logs, compute engagement metrics, and interpret user-switching behavior within the Data Manipulation domain.

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

Calculate Average Session Length and Compare App Performance

Company: Meta

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Onsite

user_sessions +---------+------------+------------+---------------------+---------------------+ | user_id | session_id | app | session_start | session_end | +---------+------------+------------+---------------------+---------------------+ | 101 | s1 | Instagram | 2023-07-10 10:00:00 | 2023-07-10 10:15:00 | | 101 | s2 | Facebook | 2023-07-10 10:20:00 | 2023-07-10 10:35:00 | | 102 | s3 | Messenger | 2023-07-10 11:00:00 | 2023-07-10 11:05:00 | | 103 | s4 | Instagram | 2023-07-10 12:00:00 | 2023-07-10 12:45:00 | +---------+------------+------------+---------------------+---------------------+ ##### Scenario Analyzing cross-app user session logs to measure engagement and switching behavior. ##### Question For yesterday, calculate the average session length (session_end − session_start) for each app. Propose and compute a metric to compare daily app performance, explaining why your chosen denominator makes sense. Compute each app's daily bounce rate: users who switch to another app and then return to the first app within the same day. ##### Hints Use DATE filters, window/aggregate functions, define metrics clearly.

Quick Answer: This question evaluates sessionization, time-based aggregation, and metric design competencies using SQL and Python, testing a data scientist's ability to process timestamped logs, compute engagement metrics, and interpret user-switching behavior within the Data Manipulation domain.

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)