Data Preparation and Class Imbalance for ML Questions
Preparing training data and handling skewed or shifting distributions. Covers preprocessing and cleaning for model input, data augmentation, distribution shift, class imbalance techniques (resampling, reweighting, threshold tuning), and cold-start scenarios where labeled data is scarce. Focuses on the data-side decisions that determine whether a model can learn at all.
Walk through your end-to-end data-preparation strategy for a new supervised learning problem: sourcing the data, your labeling methodology and how you estimated its cost, the quality checks you ran, how you built training/validation/test splits, what augmentation techniques you used, and how you handled class imbalance. Give concrete examples of your label schema and how you measured inter-annotator agreement.
You are deciding between an unsupervised anomaly-detection method (for example Isolation Forest) and a supervised classifier trained on imbalanced labels for a rare-event detection problem. What criteria (label availability and quality, novelty of the pattern you are trying to catch, operational constraints) would lead you to favor one approach over the other, and how would you combine both in production?
You inherit a training pipeline that applies SMOTE before splitting the data into train and test sets. Training AUC is 0.98, validation AUC is 0.75, and minority-class recall keeps declining once the model reaches production. Walk through a debugging plan: what specific checks would you run (leakage, order of operations, SMOTE parameterization, neighbor analysis), what experiments would you run to compare alternatives, and what is your short-term versus long-term remediation plan?
Explain why applying SMOTE to high-dimensional sparse data (text bag-of-words features, or embeddings) can fail or actively hurt performance. Propose at least three alternative strategies for creating informative minority examples in that setting (for example contextual augmentation, back-translation, or latent-space interpolation) and discuss their trade-offs.
You must pick a decision threshold so that recall stays at or above 0.90 while minimizing false positives (or, symmetrically, maximizing recall subject to a minimum precision constraint). Describe a reproducible approach using cross-validation and a held-out validation set to select the threshold under heavy class imbalance, how you would estimate the expected number of false positives per day at a given daily event volume, and how label lag would affect your recall estimate.
Unlock Full Question Bank
Get access to all Data Preparation and Class Imbalance for ML interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.