24 interview questions on descriptive statistics & eda, each answered in full. Free to read, no account needed.
Mean vs median vs mode — when do you prefer each?
easy- Mean: sensitive to outliers, but efficient for symmetric distributions.
- Median: robust to outliers, right choice for skewed data (income, response times).
- Mode: most-common value, useful for categorical or multimodal distributions.
- Rule: report both mean and median for skewed data — a big gap between them signals skew.
What are quantiles and quartiles?
easy- The q-quantile is the value below which fraction q of the data falls.
- Median = 0.5-quantile.
- Quartiles: Q1 (0.25), Q2 (0.5, median), Q3 (0.75).
- Interquartile range IQR = Q3 - Q1.
- Used for robust spread measurement, boxplots, outlier detection (points > Q3 + 1.5·IQR or < Q1 - 1.5·IQR are 'outliers' by Tukey's rule).
- Foundation of quantile regression: model any quantile of Y∣X, not just the mean.
How do you read a boxplot?
easy- Box: from Q1 to Q3 (middle 50% of data).
- Line in box: median.
- Whiskers: extend to farthest points within 1.5·IQR of the box.
- Points beyond whiskers: potential outliers.
- Compare boxplots side-by-side to see distribution shape and outlier density across groups.
- Weakness: hides multimodality (violin plots or histograms are better for shape).
How do you choose bin width for a histogram?
medium- Rules of thumb: Sturges' (log2(n)+1, small n), Scott's (3.5σ/n(1/3),assumesnear−normal), Freedman-Diaconis (2⋅IQR/n(1/3),robusttoskew).
- Modern default in most libraries: Freedman-Diaconis.
- Too few bins hide structure; too many create noisy jaggedness.
- Best practice: try 2-3 bin widths, or use KDE (kernel density estimate) for a smooth alternative.
What is kernel density estimation?
medium- Non-parametric density estimate: KDE(x) = (1/(nh)) Σ K((x−xi)/h), where K is a kernel (usually Gaussian) and h is bandwidth.
- Bandwidth choice is the key knob: too small → wiggly, too large → over-smoothed.
- Silverman's rule: h ≈ 1.06 * σ * n^(-1/5).
- Better: cross-validation.
- Smoother alternative to histograms for continuous data; also foundation of some non-parametric classifiers (KDE-NB, Parzen windows).
How do you define an outlier in practice?
medium- No single definition — depends on the model and question.
- Common rules: (1) Tukey: outside Q1 - 1.5·IQR or Q3 + 1.5·IQR.
- (2) Z-score: |z| > 3 for approximately normal data.
- (3) Modified z-score using MAD: |z| > 3.5 (more robust).
- (4) Isolation Forest / DBSCAN for multivariate.
- Never remove outliers blindly — investigate whether they're data errors, natural extremes, or a signal.
What is MAD and why is it robust?
medium- Median Absolute Deviation: MAD(X)=median(∣Xi−median(X)∣).
- Robust measure of dispersion — breakdown point 50% (half the data can be arbitrarily corrupted before MAD explodes; SD breaks down at 0%).
- Use MAD instead of SD when data has outliers.
- Scaled MAD: 1.4826 * MAD estimates σ under normality (approximately unbiased).
- Foundation of robust statistics.
Describe a good EDA workflow for a new dataset.
medium- (1) Shape: rows × columns, dtypes, missing values.
- (2) Univariate: histograms / boxplots / value counts per column.
- (3) Target: distribution of the outcome, class balance.
- (4) Bivariate: correlations, scatter plots, feature-target relationship.
- (5) Missingness: patterns (MCAR / MAR / MNAR)?
- (6) Duplicates and near-duplicates.
- (7) Time / group structure.
- (8) Sanity checks: min/max make sense? plausibility of extremes?
- Report findings, then decide on cleaning + feature engineering.
MCAR vs MAR vs MNAR — what's the difference?
hard- MCAR (Missing Completely At Random): missingness independent of both observed and unobserved data.
- Can drop rows without bias.
- MAR (Missing At Random): missingness depends only on observed data — imputable given the observed features.
- MNAR (Missing Not At Random): missingness depends on the unobserved value itself (e.g., high-income people refuse to report income).
- Only MNAR requires modeling the missingness mechanism.
- Assumption matters — different methods assume different types.
What imputation methods should you consider?
medium- (1) Drop rows: fine if MCAR and few missing.
- (2) Mean/median/mode imputation: baseline, distorts variance.
- (3) KNN imputation: uses similar rows' values.
- (4) Iterative (MICE) imputation: regress each missing column on the others, iterate.
- (5) Model-based (missForest, DL).
- (6) Multiple imputation: create m imputed datasets, fit model on each, combine (Rubin's rules) — captures imputation uncertainty.
- For high-stakes analysis, prefer MICE or multiple imputation.
When and why do you log-transform a variable?
easy- (1) Right-skewed positive variables (income, prices, response times): log transform pulls in the tail, makes distribution more symmetric, often more Gaussian.
- (2) Multiplicative relationships become additive after log — foundation of Box-Cox / Yeo-Johnson and log-linear models.
- (3) Improves linearity for regression.
- Watch: log(0) undefined — use log(1+x) or add a small offset.
- Not helpful for symmetric or already-Gaussian data.
What is the Box-Cox transformation?
medium- Box−Cox(y,λ)=(yλ−1)/λ if λ ≠ 0, log(y) if λ = 0.
- Choose λ (typically via MLE) to make the transformed variable closest to normal.
- Extended to negative values by Yeo-Johnson.
- Uses: normalize skewed regression targets, improve linear-model residual normality.
- In modern ML, tree models don't need it; useful for linear / GLM diagnostics.
Pearson vs Spearman vs Kendall correlation — when do you use each?
easy- Pearson r: measures linear relationship, assumes approximately normal data, sensitive to outliers.
- Spearman rho: rank-based Pearson — captures any monotonic relationship, robust to outliers.
- Kendall tau: also rank-based, based on concordant/discordant pairs — more robust to small samples, less sensitive to outliers.
- Rule: Pearson for linear + normal + no outliers; Spearman/Kendall for monotonic + rank-based data.
What is an ECDF and why is it useful?
medium- Empirical Cumulative Distribution Function: Fn(x)=(1/n)⋅Σ 1(Xi≤x).
- Plots the fraction of data ≤ x for every x.
- No binning — no arbitrary choice like histograms.
- Useful for: comparing distributions visually (overlap two ECDFs), computing quantiles at a glance, checking distributional assumptions (compare ECDF to a theoretical CDF via Kolmogorov-Smirnov test).
How do you read a Q-Q plot?
medium- Q-Q (quantile-quantile) plot: plot empirical quantiles vs theoretical quantiles (typically normal).
- Perfect fit → points on the y=x line.
- Deviations reveal distribution shape: (1) S-shape → heavier or lighter tails than normal; (2) curved → skew; (3) points off at the ends → outliers.
- Fast visual check for normality / distributional fit before running parametric tests.
- Complement with Shapiro-Wilk / Kolmogorov-Smirnov for formal tests.
Standardization vs normalization — what's the difference?
easy- Standardization (Z-score): (x - μ) / σ → mean 0, SD 1.
- Preserves shape, robust when features have similar scales after transform.
- Normalization / MinMax: (x - min) / (max - min) → bounded [0, 1].
- Sensitive to outliers (a single extreme value squashes everything).
- Use standardization for linear models, PCA, k-means, neural networks.
- Use normalization when a bounded range matters (image pixel scaling to [0,1]).
- Robust scaling: (x - median) / IQR — outlier-robust alternative.
What multivariate EDA plots are most useful?
medium- (1) Correlation heatmap: quick view of all pairwise linear relationships.
- (2) Scatter plot matrix (pairs plot): all bivariate scatters, diagonal shows univariate — best for small-to-medium feature sets.
- (3) Parallel coordinates: high-dim shape visualization.
- (4) PCA / UMAP 2D projections: capture nonlinear structure.
- (5) 2D density / hex bins: for many-point scatters.
- (6) Facet grids: same plot across a categorical variable.
- Choose based on dimensionality and hypothesis.
How does EDA help catch target leakage?
medium- Look for features with suspicious high correlation to target: (1) any feature perfectly predictive by itself is suspect; (2) features generated after the target event should not exist at prediction time; (3) IDs / timestamps sometimes carry target information indirectly.
- Cross-checks: check feature availability at inference time (would you have this feature when predicting?); check for target-derived aggregations (e.g., 'average order value' when predicting a churn outcome computed after the churn).
Why should you always do group-wise EDA?
medium- Whole-population statistics can hide subgroup patterns that matter for the model: (1) Simpson's paradox — trends flip when you disaggregate.
- (2) Fairness — model performance may differ by demographic group.
- (3) Missingness patterns may vary by group.
- (4) Different scale / variance per group.
- (5) Distinct outlier populations.
- Practice: pick 2-3 key categorical variables (region, cohort, product), replot univariate + bivariate patterns by group.
- Reveals lots of hidden structure.
What time-series-specific EDA should you do?
medium- (1) Plot the raw series and its rolling mean / median at multiple window sizes.
- (2) Decompose into trend + seasonality + residual (STL).
- (3) Autocorrelation (ACF) and partial autocorrelation (PACF) plots to detect lag structure.
- (4) Stationarity tests (ADF, KPSS).
- (5) Change-point detection.
- (6) Frequency-domain view (spectrogram) for periodic components.
- (7) Compare series across shared time windows and groups.
- Foundation for choosing between ARIMA / Prophet / Bayesian structural time series.
What do you look for in residual plots?
medium- Residuals vs fitted: no pattern = OK; funnel shape = heteroscedasticity; curvature = missed non-linearity.
- Q-Q plot: check normality of residuals (banana → skew, sigmoid → heavy tails).
- Residuals vs order (for time series): autocorrelation.
- Scale-location plot: √|residuals∣vs fitted for heteroscedasticity.
- Leverage vs residuals: identify influential points (Cook's distance).
- Standard 4-plot diagnostic every regression should get.
When should you log-transform the response?
medium- (1) Right-skewed positive outcomes (income, prices, spend, time-on-page).
- (2) Multiplicative errors → additive on log scale.
- (3) Coefficients become interpretable as approximate percent changes for small β.
- Cost: E[log Y] ≠ log E[Y] → back-transformed predictions are biased low (Duan smearing correction fixes it).
- Alternatives: GLM with log link (models log of mean directly, avoids the bias), Box-Cox / Yeo-Johnson for automatic transformation search.
Overall conversion went down but improved in every country. How is that possible?
hard- The traffic mix changed.
- Simpson's paradox appears when the groups have different baseline rates and their relative share shifts, so an aggregate can move opposite to every subgroup.
- Concretely, if a low-converting country grew as a fraction of traffic, the overall rate falls even though each country improved.
- This is why aggregate metrics over a heterogeneous population are unreliable when composition is not held fixed, which happens constantly with marketing campaigns and regional launches.
- The remedy is to compare like with like: stratify by the confounding variable and report a weighted average using a fixed reference composition, or model the outcome with the segment included.
- In a randomized experiment this cannot happen by chance across arms, so if it does, suspect a broken assignment or differential logging.
How do you spot selection bias in a dataset someone hands you?
hard- Ask how a row came to exist, which is a different question from what the row contains.
- Every dataset is the output of a process that decided what to record, and that process is often correlated with the outcome.
- Concretely, look for entities that could have been in the data but are not: churned customers absent from a satisfaction table, rejected loan applicants absent from a default model's training set, machines that failed before the sensor was installed.
- Check whether the sampling rate varies by any variable you care about, and compare the dataset's marginal distributions against a known population where one exists.
- Then ask what the missingness depends on, because data missing as a function of the unobserved outcome cannot be repaired by imputation and needs a model of the selection itself.