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.