What is exploratory data analysis (EDA) and what does it involve?
Understand what exploratory data analysis is, the univariate and bivariate techniques it involves, and how EDA guides cleaning, features, and model choice.
Expected Interview Answer
Exploratory data analysis (EDA) is the process of investigating a dataset with summary statistics and visualizations to understand its structure, spot patterns, detect anomalies, and check assumptions before formal modeling. It is about asking open questions of the data rather than confirming a preset hypothesis.
EDA typically covers univariate analysis (distributions of single variables), bivariate and multivariate analysis (relationships and correlations), and data quality checks for missing values, duplicates, and outliers. Analysts compute descriptive statistics like mean, median, and standard deviation, and plot histograms, box plots, scatter plots, and correlation heatmaps. The goal is to build intuition, surface data issues early, and guide decisions about cleaning, feature engineering, and which models are appropriate. Coined by John Tukey, EDA is deliberately open-ended and iterative rather than a fixed checklist.
- Reveals data quality issues before modeling
- Uncovers patterns, trends, and relationships
- Guides feature engineering and model choice
- Detects outliers and anomalies early
- Validates assumptions like normality and linearity
- Prevents wasted effort on flawed data
AI Mentor Explanation
Before a big series, an analyst studies every pitch report, weather record, and player's past scores rather than picking a lineup blind. They chart who scores against spin, who collapses under pressure, and where wickets fall most. That open-ended scouting mirrors EDA: you probe the raw data from many angles to understand its character before committing to a strategy or a model.
Step-by-Step Explanation
Step 1
Understand the data
Review shape, column types, and what each variable means, along with the collection context.
Step 2
Assess data quality
Check for missing values, duplicates, inconsistent units, and obvious data-entry errors.
Step 3
Univariate analysis
Summarize and plot each variable individually with histograms, box plots, and descriptive statistics.
Step 4
Bivariate and multivariate analysis
Explore relationships with scatter plots, cross-tabs, and correlation heatmaps.
Step 5
Detect outliers and anomalies
Use box plots, z-scores, or IQR rules to flag extreme or suspicious points.
Step 6
Summarize findings
Document insights, quality issues, and hypotheses that guide cleaning and modeling next.
What Interviewer Expects
- A clear definition of EDA as open-ended investigation
- Knowledge of univariate, bivariate, and multivariate analysis
- Common plots: histogram, box plot, scatter plot, correlation heatmap
- Awareness of data-quality checks (missing values, outliers, duplicates)
- How EDA informs cleaning, feature engineering, and model choice
Common Mistakes
- Treating EDA as a rigid checklist rather than iterative exploration
- Skipping data-quality checks and jumping straight to modeling
- Only doing univariate analysis and ignoring relationships
- Ignoring outliers or removing them without investigation
- Not documenting insights and assumptions for later steps
Best Answer (HR Friendly)
“Exploratory data analysis is the detective work you do on a dataset before building anything — using charts and simple statistics to see what the data looks like, whether it's clean, and what patterns it holds. It helps you catch problems early and decide the right approach.”
Code Example
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
df = pd.read_csv('data.csv')
# Structure and quality
print(df.shape)
print(df.info())
print(df.describe())
print(df.isna().sum()) # missing values per column
print(df.duplicated().sum()) # duplicate rows
# Distributions and relationships
df.hist(figsize=(10, 8))
sns.heatmap(df.corr(numeric_only=True), annot=True, cmap='coolwarm')
plt.show()Follow-up Questions
- Which plots do you use to detect outliers?
- How do you decide whether to remove or keep an outlier?
- What's the difference between EDA and data cleaning?
- How does EDA influence your choice of model?
- How do you approach EDA on a very large dataset?
MCQ Practice
1. What is the primary goal of exploratory data analysis?
EDA is open-ended investigation to understand structure, patterns, and quality before formal modeling.
2. Which plot is most useful for spotting outliers in a single numeric variable?
A box plot displays quartiles and flags points beyond the whiskers as potential outliers.
3. Which is a bivariate analysis technique?
A scatter plot examines the relationship between two variables, making it a bivariate technique.
Flash Cards
What is EDA? — Open-ended investigation of a dataset with statistics and visuals to understand structure, patterns, and quality before modeling.
Who coined the term EDA? — Statistician John Tukey, who promoted exploring data before formal hypothesis testing.
Univariate vs bivariate analysis — Univariate examines one variable's distribution; bivariate examines the relationship between two variables.
Key data-quality checks in EDA — Missing values, duplicates, inconsistent units, and outliers.
Common EDA plots — Histogram, box plot, scatter plot, and correlation heatmap.
Continue Learning
Related Interview Questions
What is the difference between mean, median, and mode, and when do you use each?
easy
What is standard deviation and how does it differ from variance?
easy
How Does the Missing-Data Mechanism Change Your Imputation Choice?
medium
What is the difference between correlation and causation in data analysis?
easy