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.

MediumBehavioral
43 practiced

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?

EasyTechnical
47 practiced

Describe the end-to-end data-preparation pipeline you would build before training a model on a new tabular dataset: ingestion and schema checks, a data-quality assessment (missingness, outliers, duplicates, label noise, class imbalance, and distribution differences across important slices), the concrete checks and tools you would use for each, missing-value handling, encoding, scaling, splitting, and how you would keep the whole thing reproducible and leakage-free.

MediumTechnical
54 practiced

You trained a Random Forest on a dataset with 0.05% positive examples. It reports 99.9% accuracy but zero recall on the positive class. Explain why this happens and propose at least three concrete changes to improve recall while keeping false positives under control.

HardTechnical
37 practiced

You discover that median imputation for a feature changes model predictions disproportionately for a protected group. Outline a step-by-step audit plan to quantify the harm, alternative preprocessing strategies to test (group-wise imputation, missingness indicators, model-based imputation), and how you would present the fairness-versus-accuracy trade-off to stakeholders.

MediumTechnical
38 practiced

Write a SQL query that flags outlier transactions per user directly in the warehouse (using the IQR method, or a mean/standard-deviation rule over a trailing window), returning the flagged rows along with the statistics used to flag them. Discuss performance considerations (window functions, indexes/partitions) for a large table and how you would handle users with very little history.

Unlock Full Question Bank

Get access to all 30 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.