What does a correlation heatmap show in EDA, and when do you use Pearson or Spearman correlation?

Quick Overview

This exploratory data analysis question asks what a correlation matrix or heatmap is for and how to decide between the Pearson and Spearman coefficients. It tests whether you know what each coefficient measures, what distorts it, and how to read the two together.

What does a correlation heatmap show in EDA, and when do you use Pearson or Spearman correlation?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Other

Explain the purpose of a correlation matrix or heatmap in exploratory data analysis. What are the practical differences between the Pearson and Spearman correlation coefficients, and when would you choose one over the other for exploration? ```hint What each coefficient reads Ask what each coefficient takes as its input, then what a single extreme value or a curved but always-increasing relationship does to each one. ``` ```hint Two numbers for one pair Think about what it tells you when the two coefficients disagree for the same pair of variables. ``` ### What a Strong Answer Covers - What a correlation matrix or heatmap is for in EDA and what it can flag - What Pearson measures and what it is sensitive to - What Spearman measures and why working on ranks changes its behavior - How to pick one during exploration, including what a gap between them suggests - The limits of both, such as causation, non-monotonic patterns and the need for plots ### Follow-up Questions - Neither coefficient detects a U-shaped relationship. What would you use to find one? - How would you measure association between a numeric and a categorical variable, or between two categorical variables? - With 200 features, how do you keep a correlation heatmap readable and avoid reading meaning into chance correlations? - When would you prefer Kendall's tau over Spearman?

Overview: This exploratory data analysis question asks what a correlation matrix or heatmap is for and how to decide between the Pearson and Spearman coefficients. It tests whether you know what each coefficient measures, what distorts it, and how to read the two together.

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

Explain the purpose of a correlation matrix or heatmap in exploratory data analysis. What are the practical differences between the Pearson and Spearman correlation coefficients, and when would you choose one over the other for exploration?

What a Strong Answer Covers Guidance

  • What a correlation matrix or heatmap is for in EDA and what it can flag
  • What Pearson measures and what it is sensitive to
  • What Spearman measures and why working on ranks changes its behavior
  • How to pick one during exploration, including what a gap between them suggests
  • The limits of both, such as causation, non-monotonic patterns and the need for plots

Follow-up Questions Guidance

  • Neither coefficient detects a U-shaped relationship. What would you use to find one?
  • How would you measure association between a numeric and a categorical variable, or between two categorical variables?
  • With 200 features, how do you keep a correlation heatmap readable and avoid reading meaning into chance correlations?
  • When would you prefer Kendall's tau over Spearman?