EDA — Interview Questions¶
Questions covering exploratory data analysis, distributions, correlations, and presenting findings.
[Beginner] What is the purpose of exploratory data analysis? What do you do during EDA?
Show answer
EDA is the process of understanding a dataset before drawing conclusions or building models. You're answering: What does this data contain? What's typical? What's unusual? What patterns exist?
A typical EDA workflow: 1. Audit — shape, dtypes, missing values, duplicates 2. Univariate analysis — distribution of each variable individually 3. Bivariate analysis — relationships between pairs of variables 4. Trend analysis — how key metrics change over time 5. Hypothesis generation — "I notice X. Let me investigate whether X correlates with Y."
The output is not a final answer — it's a set of informed hypotheses and a better understanding of the data's limitations.
[Beginner] What is the difference between mean and median, and when does it matter which you report?
Show answer
- Mean (arithmetic average): sum of all values divided by count. Sensitive to extreme values.
- Median: the middle value when sorted. Robust to extreme values.
It matters when the distribution is skewed. If revenue has a few whale customers spending £50,000 while most spend £200, the mean (e.g., £800) overstates the "typical" customer. The median (e.g., £215) is more representative.
Rule: if mean and median are far apart (>20% difference), report both and explain the skewness. Otherwise, mean is fine.
[Mid-level] You plot a histogram of order values and see a bimodal distribution (two peaks). What might explain this, and how would you investigate?
Show answer
A bimodal distribution suggests two distinct underlying populations in the data.
Likely explanations in an orders context: - Two customer segments — retail (low order values) and wholesale/corporate (high order values) - Two product categories — one with £20-50 price points, another with £200-500 - Different channels — web orders vs in-store or phone orders - Day-of-week effect — weekday business orders vs weekend personal orders
How to investigate:
1. Split the histogram by a categorical variable and see if one group explains each peak: df.groupby("segment")["total"].hist()
2. Look at where the "valley" between peaks is (e.g., £150) and filter: df[df["total"] < 150] vs df[df["total"] >= 150] — do they have different characteristics?
3. Check if the bimodality persists when you remove outliers, or if it's caused by extreme values
[Mid-level] What is a correlation matrix and how do you read it?
Show answer
A correlation matrix shows the Pearson correlation coefficient between every pair of numeric variables. Values range from -1 to +1.
How to read it: - The diagonal is always 1.0 (a variable perfectly correlates with itself) - Values close to +1: variables increase together - Values close to -1: one increases as the other decreases - Values near 0: no linear relationship
What to look for: - Strong correlations between non-obvious pairs (might reveal a hidden relationship) - Negative correlations (quantity ordered vs unit price — bulk orders get cheaper prices) - Very high correlations between features you plan to use as model inputs (multicollinearity problem)
[Mid-level] How do you determine if an observed trend in your data is real or just noise?
Show answer
1. Statistical testing: - Is the trend's slope significantly different from zero? Use linear regression and check the p-value. - Is a period's value significantly different from the historical baseline? Use a t-test.
2. Effect size: A trend can be "statistically significant" but practically tiny. Always check the magnitude — a 0.1% month-over-month decline might be noise even if p < 0.05 with a huge sample.
3. Rolling window check: Is the trend consistent across rolling windows? Or does it appear only if you cherry-pick start/end dates?
4. Out-of-sample validation: Does the trend hold in a held-out test period?
5. Business plausibility: Does this trend make sense given known business events? (product launch, marketing campaign, seasonal pattern)?
[Senior] A stakeholder asks you to "look at the data and find something interesting." How do you structure your EDA to avoid data dredging (p-hacking)?
Show answer
Data dredging is when you run many tests, find a "significant" result by chance, and present it as a discovery. With enough variables, some correlation will appear by chance alone.
Structured approach:
-
Pre-register your hypotheses — before running any statistics, write down 3-5 specific questions you're trying to answer. Don't change these after looking at the data.
-
Adjust for multiple comparisons — if you test 20 correlations, apply Bonferroni correction: use p < 0.05/20 = 0.0025 as your significance threshold instead of 0.05.
-
Split your data — use half for exploration (generate hypotheses), the other half for confirmation. Only report findings that replicate in the confirmation set.
-
Distinguish exploration from confirmation — clearly label EDA findings as "hypothesis-generating, not confirmed." Require a proper experiment (A/B test) to confirm causation before taking action.
-
Report null results — if you didn't find a relationship between X and Y, say so. Presenting only the significant findings gives stakeholders a biased picture.