Welcome to the SQL screen.
The question is on your right: 7-Day Rolling DAU on Facebook. Read through the requirements and the one table first.
Run and submit your code as often as you need. You also have five interviewer messages this session - want to talk through your approach, or are you ready to start coding?
Facebook wants to monitor short-term engagement trends by tracking the 7-day rolling average of daily active users (DAU). Write a SQL query to calculate this metric from app activity logs.
activity_date, daily_active_users, and rolling_7d_avg_dau.activity_date ascending.| Column | Type | Description |
|---|---|---|
| event_idPK | INT | Unique event identifier |
| user_id | INT | Facebook user who generated the event |
| event_time | TIMESTAMP | Timestamp when the activity occurred |
| event_name | VARCHAR(50) | Type of user activity event |
| device_type | VARCHAR(20) | Device used for the event |