All jobs / Data science / ML / AI / Model Evaluation
Data science / ML / AI interview question · 0–1 years
Each user has 40 sessions. You split rows at random. What goes wrong?
The strongest answer
The same person leaks into train and test — I split on the user (or the real unit), not the row, unless I can argue independence
Why it works
Exactly. The unit of split is the unit of generalisation. People are not independent rows.
What a good answer covers
- Split on the real unit (user, device, day).
- Random rows can leak a person.
- Stratify ≠ de-identify.
- Do not copy entities across folds.
Answers that fall short
- Close, but not the strongest: More rows is always better; leakage is a senior topic
Juniors are allowed to say this. It is not advanced magic. - Weak: I stratify on the label and that fixes identity leak
Stratifying labels does not separate identities. - Red flag: I duplicate users so every split has the same people
Copying people into every fold is the leak.
Who gets asked this
More Model Evaluation questions
- When is ROC-AUC a reasonable headline, and when is it a dodge?
- A slide says “model accuracy 99%.” What do you add or refuse?
- Users appear across months. How do you validate a churn model?
- Outreach can handle 200 accounts a week. What do you optimise?
- Devices in one household share an address. You split by device id. Risk?
- The model says 0.9. Ops treats that as “90% sure.” What do you correct?
- Default 0.5 threshold on a 4% positive class. What do you change first?
- How do you choose between a miss and a false alarm without fake money numbers?