How do you decide whether to impute, ignore, or drop features in a highly sparse dataset with missing values?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
If a client provides a highly sparse dataset with missing values, how would you decide whether to impute, ignore, or drop those features?
```hint Ask why it is blank
Before looking at percentages, ask what process produced each blank, and whether a blank means "unknown" or means "zero" or "not applicable".
```
```hint Count complete rows
Estimate how many rows would survive if you removed every row with at least one missing value.
```
### Clarifying Questions to Ask
- What does a blank mean in each source field: unknown, not applicable, or zero?
- Is the goal prediction, or inference about the effect of specific features?
- Which model families are acceptable, and does the model need to be interpretable?
- Will the same fields be missing at similar rates when the model runs in production?
### What a Strong Answer Covers
- Measuring missing rates per feature and separating structural sparsity from values that are truly unknown.
- Reasoning about the missingness mechanism (MCAR, MAR, MNAR) and what each one implies for imputation.
- Criteria for imputing, dropping, or leaving values missing, including the feature's predictive value and whether the model handles missing values natively.
- Missing-value indicators and fitting imputers on training data only.
- Validating the choice empirically with cross-validation.
### Follow-up Questions
- How can you check whether values are missing completely at random?
- When would you use multiple imputation instead of a single imputed value?
- A feature is 85% missing, but its missingness flag is one of the strongest predictors. What do you do with it?
- How would you handle a feature that is missing in production but was always present in training?
Overview: Asks how to choose between imputing, dropping, or leaving missing values in place for the features of a highly sparse client dataset. Tests understanding of missingness mechanisms, structural zeros, missing-value flags, leakage-safe imputation, and empirical validation.