Build search sessions
Mock interview. You're interviewing for a senior data scientist job on a search team. The interviewer says: "Looking at single searches misses the bigger picture: people often search a few times to get one thing done. Let's group searches into sessions and measure success that way."
A session is a run of one user's searches where each search comes within 30 minutes of the one before. A gap of more than 30 minutes starts a new session. A session succeeds if any of its searches got a click.
Question 1: Build the sessions
"Group the searches into sessions. In one row: the number of sessions, the number of users, average searches per session, and the share of sessions with more than one search."
Expected output
- One row;
searches_per_sessionrounded to 2 decimals;multi_search_pctas a percentage rounded to 1 decimal
Example of the shape (made-up values):
| sessions | users | searches_per_session | multi_search_pct |
|---|---|---|---|
| 4000 | 700 | 1.40 | 25.0 |
Hints, the later questions and the answer come with Pro.
Question 1 of 4
Write your query here. Ctrl + Enter submits.