How do you detect disguised or hidden missing values, such as -999, 'N/A', empty strings, or 0 used as a placeholder?
Quick Overview
How to find missing values that are disguised as real data, such as -999 codes, N/A strings, blanks or placeholder zeros. Tests data cleaning judgment: profiling columns, spotting implausible values, and using domain context to decide when a zero is genuine.
How do you detect disguised or hidden missing values, such as -999, 'N/A', empty strings, or 0 used as a placeholder?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
How do you detect disguised or hidden missing values, such as `-999`, `'N/A'`, empty strings, or `0` used as a placeholder?
These values look like ordinary data, so a column can report zero nulls and still be full of gaps.
```hint Where to look
Compare each column's most frequent values and its min and max with what the field can plausibly contain.
```
```hint Watch the zeros
Some zeros are real measurements. Think about what else in the row could tell you which kind you are looking at.
```
### What a Strong Answer Covers
- Profiling value frequencies and distinct strings per column to find spikes and text variants of "missing"
- Range and distribution checks that expose sentinel values outside the plausible domain
- Using domain rules, related columns and documentation to separate genuine values (such as a real zero) from placeholders
- Converting confirmed placeholders to real nulls, column by column, before imputation, aggregation or modeling
- Pitfalls such as blanket replacement rules and loaders that silently convert some tokens to null
### Follow-up Questions
- A column that should be numeric loads as `object` dtype in pandas. How do you find the values responsible?
- With no data dictionary, how would you decide whether `0` in an income column means missing?
- After converting placeholders to nulls, how do you check whether the missingness is random or related to other variables?
- How would you turn these checks into automated tests that run on every new data load?
Overview: How to find missing values that are disguised as real data, such as -999 codes, N/A strings, blanks or placeholder zeros. Tests data cleaning judgment: profiling columns, spotting implausible values, and using domain context to decide when a zero is genuine.