You find outliers in your dataset. Walk me through what you do, step by step.
Role: Data Scientist
Category: Statistics & Math
Difficulty: medium
Interview Round: Other
You find outliers in your dataset. Walk me through what you do, step by step.
```hint Cause first
Before picking any treatment, ask what produced the extreme value. The right action for a typo is different from the right action for a real but rare event.
```
```hint Prove it does not matter
Think about how you would show a reviewer that your handling of the outliers did not drive the final result.
```
### Clarifying Questions to Ask
- What is the data for: a summary metric, a predictive model, an experiment readout, or anomaly detection where the extremes are the target?
- How were the points flagged (a univariate rule such as IQR or z-score, a multivariate method, or someone eyeballing a chart)?
- Is the outlier in an input feature or in the outcome variable?
- Can I trace rows back to the source system or the team that owns it?
### What a Strong Answer Covers
- Confirming and quantifying the flagged points, including the method that flagged them, before acting.
- Diagnosing the cause (entry or measurement error, unit or encoding issue, genuine rare event) with domain rules.
- Choosing a treatment that matches the cause, with the options for errors and for genuine extremes and their trade-offs.
- Checking how sensitive the results are to the treatment.
- Documenting what was done so it can be reproduced and applied the same way to new data.
### Follow-up Questions
- How do you find outliers that only show up across several features together, where no single column looks extreme?
- When would you cap values instead of log-transforming them, and what does each do to a linear regression?
- In fraud detection the outliers are the signal. How does your process change?
- How do you keep outlier handling consistent between model training and serving?
Overview: Describe, step by step, what you do after finding outliers in a dataset, from confirming them to choosing a treatment. It tests how you diagnose the cause of extreme values, match a fix to that cause, check whether the result depends on the choice, and document it.