When would you impute missing numeric values with an arbitrary constant?

Quick Overview

Asks when filling missing numeric features with a fixed constant such as -999 or 0 is a sound choice. Tests understanding of informative missingness, how tree-based and linear models react to an out-of-range value, and which imputation alternatives fit other model families.

When would you impute missing numeric values with an arbitrary constant?

Role: Machine Learning Engineer

Category: Machine Learning

Difficulty: easy

Interview Round: Other

When would you impute missing numeric values with an arbitrary constant? Arbitrary-constant imputation replaces every missing entry of a numeric feature with one fixed value chosen by the modeler, such as -999 or 0, instead of a statistic estimated from the data. ```hint Think about the model Ask how a tree split and a linear coefficient each react to a value like -999, and whether the fact that a value is missing tells you anything about the target. ``` ### What a Strong Answer Covers - When missingness itself carries information about the target, and why that matters for the choice - Which model families can isolate a constant and which treat it as a real magnitude - How to pick the fill value relative to the feature's observed range - Cases where the constant has a real domain meaning, such as counts - The alternative to use for models that cannot isolate the constant ### Follow-up Questions - How do gradient boosting libraries such as XGBoost and LightGBM handle missing values without any imputation? - If you switch to median imputation with a missing indicator, how do you keep the imputer from leaking information across cross-validation folds? - How would you check whether missingness in a feature is informative before choosing a strategy?

Overview: Asks when filling missing numeric features with a fixed constant such as -999 or 0 is a sound choice. Tests understanding of informative missingness, how tree-based and linear models react to an out-of-range value, and which imputation alternatives fit other model families.

General logo
General
Nov 25, 2026
easyMachine Learning EngineerOtherMachine Learning
0
0

When would you impute missing numeric values with an arbitrary constant?

Arbitrary-constant imputation replaces every missing entry of a numeric feature with one fixed value chosen by the modeler, such as -999 or 0, instead of a statistic estimated from the data.

What a Strong Answer Covers Guidance

  • When missingness itself carries information about the target, and why that matters for the choice
  • Which model families can isolate a constant and which treat it as a real magnitude
  • How to pick the fill value relative to the feature's observed range
  • Cases where the constant has a real domain meaning, such as counts
  • The alternative to use for models that cannot isolate the constant

Follow-up Questions Guidance

  • How do gradient boosting libraries such as XGBoost and LightGBM handle missing values without any imputation?
  • If you switch to median imputation with a missing indicator, how do you keep the imputer from leaking information across cross-validation folds?
  • How would you check whether missingness in a feature is informative before choosing a strategy?