Build search sessions

HardGooglesessionizationlagrunning sumsbool_orpercentiles· 160 XP (40 per step)

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.

Step 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_session rounded to 2 decimals; multi_search_pct as 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 steps and the answer come with Pro.

Step 1 of 4

Write your query here. Ctrl + Enter submits.