Handling missing numerical values
judgment about imputation trade-offs.
dropping rows is simple but loses data and can bias if missingness is non-random; mean or median imputation keeps rows but shrinks variance and ignores correlations; model-based imputation is…
WHAT THIS TESTS The interviewer wants to see structured reasoning about the bias-variance and data-loss trade-offs of imputation, plus awareness of why missingness arose. It is a judgment question, not a recipe.
A GOOD ANSWER COVERS First, deletion: dropping rows with missing values is trivial and keeps the remaining data untouched, but it discards information and produces biased estimates unless values are missing completely at random. Second, simple imputation with the mean or median: this retains every row and is fast, but it artificially reduces variance, weakens correlations with other features, and the mean is sensitive to outliers so the median is often safer for skewed columns. Third, model-based imputation such as KNN or iterative regression imputation predicts the missing value from other features, capturing relationships and giving more realistic fills, at the cost of complexity, runtime, and leakage risk if not fit only on training data. Adding a binary missingness-indicator column can also preserve the signal that a value was absent.
COMMON WRONG ANSWERS Always using the mean regardless of skew or outliers. Imputing before splitting into train and test, which leaks information. Dropping columns or rows without checking how much data is lost or why it is missing. Ignoring that missingness itself may be predictive.
LIKELY FOLLOW-UPS Define missing completely at random, missing at random, and missing not at random. How does imputation interact with cross-validation. When would you prefer to add a missingness flag.
ONE CONCRETE EXAMPLE In a salary column where high earners decline to report, the data is missing not at random. Mean imputation would pull missing entries toward the average and understate true top salaries, biasing any downstream model. A better choice is model-based imputation plus a missingness indicator, so the model learns both an estimate and the fact that the value was withheld.
Read the original → scirp.org
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.