This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.
Tag: Data Eng
ML0113 Missing Data Handling
How do you handle missing data: what do MCAR, MAR, and MNAR mean, when is dropping vs imputing wrong, and how do missing-indicator features fit in?
Consider a credit-approval model for a card issuer such as Capital One. Self-reported income is blank on 14% of historical applications, several other fields have gaps, and the deployed model must still score every live application, including the ones with blanks.

The Problem: A credit model is trained on historical applications with blank cells in several columns, and it must also score live applications whose fields can be blank. Before choosing between dropping, filling, or flagging, you need to know why each value is missing.
Answer
Handling missing data starts with asking why a value is missing, because the right fix depends on the missingness mechanism rather than on the missing rate. In Rubin’s taxonomy, MCAR means blanks are independent of all data, MAR means they depend only on observed features, and MNAR means they depend on the missing value itself. Dropping rows is unbiased only under MCAR, still wastes data, and is impossible at serving, where every request must be scored. Mean or median filling keeps the center but shrinks variance and correlations under every mechanism, while conditional imputers such as KNN or MICE are valid under MAR. Under MNAR the blank itself carries signal, so a missing-indicator feature or native NaN routing in boosted trees captures what no fill value can. Every imputer is fit on the training fold only and replayed identically at serving.
(1) Diagnose Before Fixing: Predict each column’s missingness flag from the other observed columns, and an AUC near 0.5 is consistent with MCAR. MAR versus MNAR cannot be tested from the data alone and needs domain evidence.
(2) Dropping Compounds: With 10 features each 5% MCAR-missing, listwise deletion keeps onlyof rows. Under MAR or MNAR the surviving rows are also a biased sample.
(3) Mean Filling Distorts: Filling a fractionwith one value scales variance by about
and correlations by about
. It also creates an artificial spike that trees will happily split on.
(4) Conditional Imputation For MAR: KNN, MICE (chained equations), or a per-column model predict the blank from observed features. Use multiple imputation when you need honest standard errors.
(5) Indicators Carry MNAR Signal: A binary is-missing column, or the learned default direction in XGBoost and LightGBM, lets the model treat a blank as information rather than noise.
(6) Fit On Train, Replay At Serving: Imputation statistics are model parameters. Fitting them on all rows leaks test information, and recomputing them at serving causes training-serving skew.Mathematical Formulation:
Where:
is the missingness indicator matrix, with
when feature
of row
is blank;
and
are the observed and missing parts of the data.
- Under MCAR the pattern ignores all values, under MAR it depends only on what you can see, and under MNAR it still depends on
after conditioning on
, which is why MNAR cannot be verified from observed data alone.
is the mean-imputed column,
the fraction of rows filled,
the true variance, and
the Pearson correlation with any other variable
; both approximations hold under MCAR for large samples.
- At
, variance falls to 70% of its true value and a true correlation of 0.60 is reported as about
.
Worked Example:
Suppose 80% of applicants earn about 60k and 20% earn about 200k. High earners leave income blank 50% of the time, everyone else 5% of the time, which is an MNAR pattern. The true mean, the observed share, and the mean of the observed rows are:
Complete-case analysis and mean filling both anchor on 76.3k, about 13% below the truth. Worse,
of the blank rows are actually high earners, so filling them with 76.3k is wrong in a systematic direction. A missing indicator lets the model learn that a blank income usually means a high income, which is exactly the signal an imputer fitted on observed rows cannot fully recover.
Login to view more contentML0111 Conditional Random Fields
This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.
ML0110 LDA & QDA
This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.
ML0109 Expectation-Maximization
This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.
MSD0141 LLM-Assisted Grading of Human Labeling Work
This is an IntvML Pro interview question. Upgrade to Pro to unlock the full prompt, diagrams, and solution.

