How do you handle 10% nulls in a key numerical column?
Judgment between dropping rows, imputing, or flagging gaps for dashboards.
Check MCAR/MAR/MNAR; prefer median or mean imputation; add an "is_missing" indicator.
Row deletion or zero-fill without bias checks.
WHAT THIS TESTS: This question tests whether you treat missing data as a signal rather than a nuisance. At the senior level, interviewers want to hear you discuss missingness mechanisms, the bias-variance trade-off in imputation, and how dashboard consumers interpret aggregated numbers. They also care if you preserve transparency by flagging imputed values instead of silently rewriting data.
A GOOD ANSWER COVERS: A strong answer follows four steps in order. First, investigate why the data is missing by plotting null rates over time and correlating missingness with other features to distinguish MCAR from MAR or MNAR. Second, reject row deletion because losing 10% of rows can shift averages by several percentage points and break dashboard totals. Third, choose an imputation strategy matched to the distribution: use mean imputation from SimpleImputer for roughly normal data and median for skewed data, or use multivariate imputation like IterativeImputer if other columns predict the missing values. Fourth, add an is_missing indicator column so downstream users can filter imputed records, and validate by comparing pre- and post-imputation aggregates to ensure drift stays under 1-2%.
COMMON WRONG ANSWERS: The biggest red flag is dropping rows with nulls without discussing bias; at 10% sparsity this can silently distort KPIs. Another red flag is zero-filling, which pulls means down artificially. Filling with the global mean without checking skew or segment differences is also weak because it ignores heterogeneity. Finally, proposing complex deep-learning imputation for a simple dashboard metric shows poor cost-benefit judgment.
LIKELY FOLLOW-UPS: Expect the interviewer to ask how you would handle 40% missingness instead of 10%, or what you would do if the missingness correlates with a specific customer segment. They may also ask whether you would expose imputed values differently in the UI, or how you would monitor for data-quality regression in production.
ONE CONCRETE EXAMPLE: Suppose you are building a revenue dashboard and 10% of transaction amounts are null. You discover nulls are MAR: they spike for a legacy payment gateway. You keep all rows, fill missing amounts with the median transaction value stratified by gateway and product tier, append an is_imputed flag, and validate that the total revenue after imputation is within 0.8% of the known total. The dashboard shows a footnote when the imputation rate exceeds 5%.
Read the original → scikit-learn.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.