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.
Explain why standard (shuffled) k-fold cross-validation is inappropriate for many time-series tasks, and describe at least two time-aware alternatives: rolling-window (walk-forward) validation and an expanding window. Outline how you would implement one of them in code, and how you would additionally preserve an approximate positive-class ratio per fold if the target is also rare.
You receive inconsistent categorical labels for the same underlying value from different sources (for example 'NY', 'New York', 'N.Y.', 'newyork' all meaning the same place). Propose a scalable standardization approach combining rule-based normalization, fuzzy matching, and human-in-the-loop verification for ambiguous cases, and describe how you would store and version the canonical mapping so it stays consistent across pipelines over time.
Explain the difference between normalization (min-max scaling to a fixed range) and standardization (z-score, zero mean and unit variance): give the formula for each, when one is preferred over the other, and how outliers affect each. Name model families that are sensitive to feature scale (k-NN, SVM, neural networks) versus scale-invariant ones (tree-based methods), and describe how you would invert the transform to recover original units for interpretability.
Explain the difference between 'data cleaning' and 'data preprocessing'. Give concrete example tasks for each (removing duplicates and fixing type errors versus imputing missing values, encoding categoricals, and scaling numeric features) and describe how the two interact in a typical workflow before modeling.
Behavioral: describe a time a preprocessing or data-quality decision you made changed the outcome of a model, an experiment, or a business decision. Use the STAR method (Situation, Task, Action, Result): what was your reasoning for the chosen approach, how did you validate its impact, and what did you learn?
Unlock Full Question Bank
Get access to all 30 Data Preparation and Class Imbalance for ML interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.