How would you spot constant or near-zero-variance columns during EDA, and why do they matter?

Quick Overview

Asks how to detect constant and near-zero-variance columns during exploratory data analysis and why they cause problems for models. It tests practical checks on cardinality, dominant-value share and variance, plus judgment about when a rare but informative column should stay.

How would you spot constant or near-zero-variance columns during EDA, and why do they matter?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: easy

Interview Round: Other

How would you spot constant or near-zero-variance columns during EDA, and why do they matter? ```hint What to count For each column, look at how many distinct values it has and what share of the rows its most common value takes up. ``` ### What a Strong Answer Covers - A working definition of a constant column and a near-zero-variance column - Concrete checks for numeric and categorical columns, with a sensible threshold - Why these columns cause trouble for models (no information, scaling, matrix rank) - When a near-constant column should stay in the data ### Follow-up Questions - Why is a single raw variance cutoff a poor test when columns are measured in different units? - A binary flag is 1 in only 0.5% of rows. Would you drop it, and what would you check first? - A column is constant in the training data but varies in production. What could explain that? - How can a feature that varies overall become constant inside a cross-validation fold, and what breaks when it does?

Overview: Asks how to detect constant and near-zero-variance columns during exploratory data analysis and why they cause problems for models. It tests practical checks on cardinality, dominant-value share and variance, plus judgment about when a rare but informative column should stay.

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

How would you spot constant or near-zero-variance columns during EDA, and why do they matter?

What a Strong Answer Covers Guidance

  • A working definition of a constant column and a near-zero-variance column
  • Concrete checks for numeric and categorical columns, with a sensible threshold
  • Why these columns cause trouble for models (no information, scaling, matrix rank)
  • When a near-constant column should stay in the data

Follow-up Questions Guidance

  • Why is a single raw variance cutoff a poor test when columns are measured in different units?
  • A binary flag is 1 in only 0.5% of rows. Would you drop it, and what would you check first?
  • A column is constant in the training data but varies in production. What could explain that?
  • How can a feature that varies overall become constant inside a cross-validation fold, and what breaks when it does?