How do you choose whether to remove, cap, winsorize, transform, flag or leave an outlier?

Quick Overview

Asks how to treat an outlier once you find it: remove it, cap or winsorize it, transform the scale, flag it or leave it alone. Tests whether you can tie the choice to the cause of the value and to the model or metric that uses the data, without leaking information.

How do you choose whether to remove, cap, winsorize, transform, flag or leave an outlier?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Other

Once an outlier is identified, what are the different treatment strategies (remove, cap, winsorize, transform, flag, leave), and how do you decide which to apply? ```hint Start with the cause Before picking a treatment, ask whether the value is a recording error or a real observation, and what the downstream analysis or model is sensitive to. ``` ```hint Watch where the cutoffs come from If a treatment uses a threshold, think about which rows the threshold is computed on and whether the same rule reaches every group you compare. ``` ### What a Strong Answer Covers - What each of the six treatments does to the data, and what it keeps and loses - How the cause of the extreme value, error or genuine observation, changes the choice - How the downstream model or metric decides which treatment is safe - Process issues such as fitting thresholds on training data only, applying one rule to every group and documenting the choice ### Follow-up Questions - In an A/B test on revenue per user, how would you handle a few very large purchases without biasing the comparison? - Why are tree-based models less sensitive to outliers in the features than to outliers in the target? - How would you choose winsorizing percentiles, and how would you check that the choice does not drive the result? - A log transform fails because the column has zeros and negative values. What would you use?

Overview: Asks how to treat an outlier once you find it: remove it, cap or winsorize it, transform the scale, flag it or leave it alone. Tests whether you can tie the choice to the cause of the value and to the model or metric that uses the data, without leaking information.

General logo
General
Nov 25, 2026
mediumData ScientistOtherData Manipulation (SQL/Python)
0
0

Once an outlier is identified, what are the different treatment strategies (remove, cap, winsorize, transform, flag, leave), and how do you decide which to apply?

What a Strong Answer Covers Guidance

  • What each of the six treatments does to the data, and what it keeps and loses
  • How the cause of the extreme value, error or genuine observation, changes the choice
  • How the downstream model or metric decides which treatment is safe
  • Process issues such as fitting thresholds on training data only, applying one rule to every group and documenting the choice

Follow-up Questions Guidance

  • In an A/B test on revenue per user, how would you handle a few very large purchases without biasing the comparison?
  • Why are tree-based models less sensitive to outliers in the features than to outliers in the target?
  • How would you choose winsorizing percentiles, and how would you check that the choice does not drive the result?
  • A log transform fails because the column has zeros and negative values. What would you use?