InterviewStack.io LogoInterviewStack.io

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.

MediumTechnical
52 practiced

Provide an end-to-end checklist of automated tests you would add to a preprocessing pipeline to prevent regressions: schema checks, distributional tests, null-rate thresholds, and unit tests for individual transformers. For each, state the rationale and a suggested pass/fail policy, and describe how you would run a subset of these as a 'canary' check on incremental data updates to catch newly-introduced leakage before it reaches production.

MediumTechnical
41 practiced

Describe augmentation strategies for multivariate time-series data (classification or forecasting): jittering, scaling, permutation, time-warping, and window slicing. How do label-preservation requirements differ between a forecasting task and a classification task, and how would you preserve temporal coherence across channels when augmenting sliding windows?

MediumTechnical
66 practiced

Explain focal loss for binary classification: give the formula and the intuition behind its modulating factor. Explain how the hyperparameters alpha and gamma influence training dynamics, and give a scenario where focal loss is likely to outperform simple class weighting.

MediumTechnical
41 practiced

Explain the mixup and CutMix augmentation techniques for supervised image classification: how does each construct a new training example (both the input and the label), and why do they tend to improve generalization and calibration? Note a data regime or task (small datasets, localization-sensitive tasks, multi-label) where you would prefer one over the other.

EasyTechnical
53 practiced

Implement a function that flags outlier rows in a numeric column using the IQR method (below Q1 minus k times IQR, or above Q3 plus k times IQR), handling NaNs gracefully. Give a short example and note the method's limitations on a skewed distribution.

Unlock Full Question Bank

Get access to all Data Preparation and Class Imbalance for ML interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.