You are building a model where only 0.5% of examples are positive. How do you approach training and evaluation?
What the interviewer wants to hear
- Use metrics like PR-AUC, recall at a fixed precision, not accuracy
- Keep the real class balance in validation and test sets
- Try class weights or resampling only inside training folds
- Tune the decision threshold to business costs
- Check calibration if probabilities are used downstream
Model answer
First I would make sure evaluation is honest. Accuracy is useless at 0.5% positives, so I would use PR-AUC and a business metric such as recall at the precision the operations team can handle. I would use stratified splits, or time-based ones if relevant, and keep the true class balance in validation and test. For training, I would start with a strong baseline like gradient boosting with class weights, which often works as well as resampling. If I try undersampling or SMOTE, I apply it only inside training folds to avoid leakage. Then I choose the threshold from the precision-recall curve based on the cost of a missed positive versus a false alarm. If the scores feed pricing or prioritisation, I check calibration, because weighting and resampling distort probabilities, and recalibrate with isotonic or Platt scaling if needed.
Can you answer it under time pressure?
Take a timed medium round and get scored on every answer.
More medium Data Scientist questions
- Walk through how you would design an A/B test for a new checkout page.
- How would you choose a success metric for a new "recommended for you" section in a shopping app?
- You have 500 candidate features for a churn model. How do you decide which ones to keep?
- A business team does not trust your credit risk model. How do you explain its predictions?
- The CEO asks: "Why are customers churning?" How do you approach this?
- How would you validate a demand forecasting model before the business relies on it?
- What is data leakage, how do you detect it, and how do you prevent it in a modelling project?
- How do you decide between a regularised linear model and a gradient boosted tree model for a tabular problem?
- Walk me through how you would decide the sample size and duration of an A/B test.