Interview practice question
Session metrics from clickstream
Data Engineering · SQL · Experienced
From a clickstream table, compute sessions with a 30-minute inactivity timeout, plus session duration and pages per session.
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- LAG previous event time per user.
- Flag new session when gap > 30 minutes or first event.
- Running SUM of flags gives session number.
- Aggregate per user and session: MIN, MAX time and COUNT pages.
- Partition and filter by date to keep it scalable.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.