Split Train and Test Data for Time-Ordered Play Store Purchases
Last updated: November 29, 2026
Quick Overview
You are building a model that predicts whether a Google Play user will make an in-app purchase in the next 7 days. A teammate used a random 80/20 row split and got great offline results. Explain what is wrong and design a correct evaluation split.
0
0
0 solved
You are building a model that predicts whether a Google Play user will make an in-app purchase in the next 7 days. A teammate used a random 80/20 row split and got great offline results. Explain what is wrong and design a correct evaluation split.
Google Play models are trained on logs that evolve with seasonality, promotions, and catalog changes. The interviewer is testing whether you recognize temporal leakage and user overlap, and whether you can design a split that matches how the model will be used in production.
What the Interviewer Expects
- Identifies temporal leakage from random splits on time-ordered data
- Identifies label-window overlap between feature and label periods
- Proposes an out-of-time split with a gap matching the label horizon
- Considers whether test users should also be unseen users
- Mentions rolling or expanding-window backtests for stability
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 large should the gap between train and test be, and why?
- How would you detect that a seasonal event like a holiday sale distorts the test period?
- When would a random split actually be acceptable?
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 how rows are built (one row per user per day, with features computed up to that day and a label covering the next 7 days), the date range available, and how the model will be used: retrained weekl...
Approach
A random row split puts rows from the same week and often the same user in both train and test. The model can learn patterns tied to specific dates (a promotion on day X lifts everyone's purchase rate...