Create Session-Level Features From Raw Google Search Event Streams
Last updated: November 29, 2026
Quick Overview
Given a raw stream of (user, timestamp, query, click) events from Google Search, build session-level features such as query reformulation rate and time to first click that a satisfaction model can use. Explain how you define sessions and implement the sessionization step.
0
0
0 solved
Given a raw stream of (user, timestamp, query, click) events from Google Search, build session-level features such as query reformulation rate and time to first click that a satisfaction model can use. Explain how you define sessions and implement the sessionization step.
Session features power search satisfaction models and quality metrics at Google, and they depend heavily on how sessions are defined. The interviewer checks that you can implement sessionization correctly and design behavioral features that reflect success or struggle.
What the Interviewer Expects
- Defines sessions with an inactivity gap and justifies the threshold
- Implements sessionization correctly per user in time order
- Designs features for struggle and success, such as reformulations and long clicks
- Handles edge cases like out-of-order events and very long sessions
- Notes privacy and aggregation considerations
Key Topics to Cover
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
- How would you detect that two consecutive queries are reformulations of each other?
- How sensitive are your features to the 30 minute threshold?
- How would you sessionize in a streaming system where events arrive late?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Explore ML Interview PrepSample Answer
Clarify
Ask whether events can arrive out of order, how clicks are linked to queries, whether the stream mixes devices for the same user, and what the downstream model predicts (session-level satisfaction). A...
Approach
A session is a maximal run of a user's events with no gap longer than a threshold, commonly 30 minutes. Sort each user's events by time, start a new session when the gap exceeds the threshold, and the...