← Boston Consulting Group Interview Insights

Boston Consulting Group·Data Scientist·Online Assessment (OA)·Intermediate

Intermediate
May 2026Remote

Summary

BCG data scientist live coding session on CodeSignal, basically one scenario-based question about cleaning and visualizing sales data in Python. Pretty focused, no fluff.

Questions Asked (1)

Q1

Given raw daily SKU-level sales data, use Python (pandas plus matplotlib or seaborn) to plot a histogram of daily revenue per SKU, detect outliers using IQR or Z-score, remove them, and then re-plot the cleaned distribution.

Product Analytics & MetricsTechnical Trade-offs
Author's notes

The scenario itself wasn't hard to parse but I spent way too long debating IQR vs Z-score instead of just picking one and moving.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the data structure and business context, then walk through a reproducible Python workflow: load and aggregate daily revenue per SKU, visualize the raw distribution, apply IQR or Z-score to flag outliers, remove them, and re-plot to compare. Emphasize that outlier removal should be justified and validated, not automatic, and discuss trade-offs between methods and their impact on downstream analysis.

Pro tip: Always investigate outliers before removing them—some may be legitimate high-value sales or data errors; document your decision and consider robust alternatives like winsorizing or log transformation. This shows business acumen and statistical maturity.

1. Clarify data and business context

Ask about the data granularity, time period, and whether outliers could represent real events (e.g., promotions, bulk orders) or errors. Confirm the definition of daily revenue per SKU (e.g., sum of sales).

2. Compute and visualize raw distribution

Use pandas to group by SKU and date, calculate daily revenue, then plot a histogram with matplotlib/seaborn. Describe the shape, skewness, and potential outliers visually.

3. Detect outliers using IQR or Z-score

Implement both methods: IQR (Q1 - 1.5*IQR, Q3 + 1.5*IQR) and Z-score (|z| > 3). Discuss pros and cons: IQR is robust to non-normal data, Z-score assumes normality and is sensitive to extreme values.

4. Remove outliers and re-plot

Filter out flagged outliers, then re-plot the cleaned distribution. Compare side-by-side with the original to show the effect. Mention that removal should be justified and consider alternative treatments like capping.

5. Validate and communicate impact

Check how many data points were removed and whether the cleaned distribution makes business sense. Discuss potential impact on downstream metrics and suggest sensitivity analysis or robust methods.

Key Points to Mention

  • Data aggregation: ensure daily revenue per SKU is correctly computed (e.g., sum of sales, not average).
  • Choice of outlier detection method: IQR vs Z-score, and when each is appropriate (robustness vs normality assumption).
  • Visualization best practices: use histograms with appropriate bin sizes, add KDE or box plots for clarity, label axes.
  • Business context: outliers may be legitimate (e.g., promotions) or errors; removal should be justified and documented.
  • Alternative approaches: winsorizing, log transformation, or robust statistical methods instead of removal.
  • Impact on analysis: removing outliers can bias results; perform sensitivity analysis and communicate limitations.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.