Data Preparation and Data Quality
Quality dimensions
Data quality is judged on completeness, accuracy, consistency, timeliness, uniqueness, and validity. Candidates should map a symptom to a dimension: duplicate customer records violate uniqueness; a date field with mixed formats violates consistency and validity. Know that quality issues compound downstream and are cheaper to fix early.
Cleaning and transformation
Understand handling missing values (deletion, imputation with mean/median/mode, model-based imputation), outlier detection, deduplication, normalization versus standardization, encoding categorical variables (one-hot, ordinal, target encoding), and feature scaling's importance for distance-based and gradient methods. Know that transformations must be fit on training data and applied to validation and test data to prevent leakage.
Data leakage and splitting
Leakage occurs when information unavailable at prediction time enters training: target-derived features, future data in time series, or scaling computed on the full dataset. Time-ordered problems require chronological splits, not random ones. Grouped data (for example, multiple records per patient) needs group-aware splits.
Labeling and imbalance
Label quality matters as much as feature quality. Understand inter-annotator agreement, label noise, and strategies for class imbalance (resampling, class weights, synthetic minority oversampling).
Worked example
A churn model includes "account cancellation date" as a feature and scores near-perfectly. That field is only populated after churn, so it is target leakage; remove it and re-evaluate. Similarly, standardizing with statistics from the full dataset leaks test information.
Rule of thumb
For every feature, ask: would this value be known at the moment of prediction? If not, it cannot be used.