← Boston Consulting Group Interview Insights

Boston Consulting Group·Data Scientist·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
Jul 2026Remote

Summary

BCG data scientist technical screen, basically one long pandas problem that covers data cleaning, merging, and aggregation all at once. Pretty dense for a single question but it tells you exactly what they care about.

Questions Asked (1)

Q1

Given two user and event DataFrames with messy currency strings, misaligned columns, and mixed schemas, use pandas (no loops) to clean and combine everything, then compute per country and plan metrics for a specific date: distinct active users, purchasers, purchase counts, and revenue. Return a sorted tidy DataFrame and explain your assumptions about nulls and timezones.

Product Analytics & MetricsData ModelingTechnical Trade-offs
Author's notes

This took me longer to mentally parse than I expected.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by profiling both DataFrames to understand the messy currency strings, misaligned columns, and mixed schemas, then use vectorized pandas operations to standardize currencies, align columns, and merge on user_id. After merging, filter to the target date, compute the required per-country and per-plan metrics using groupby aggregations, and return a sorted tidy DataFrame while explicitly stating assumptions about nulls and timezones.

Pro tip: Demonstrate maturity by explicitly stating your assumptions about nulls and timezones upfront, and show how you would validate the cleaned data (e.g., check for unexpected nulls or currency conversion errors) before computing metrics.

1. Profile and understand the data

Examine both DataFrames to identify messy currency formats, misaligned columns, mixed schemas, and potential nulls. Check dtypes, unique values, and sample rows to plan cleaning steps.

2. Clean and standardize

Use vectorized string methods to parse currency strings into numeric values, handle nulls appropriately, and align columns between the two DataFrames. Ensure consistent data types and handle timezone conversion if needed.

3. Merge and filter

Merge the cleaned user and event DataFrames on the appropriate keys (e.g., user_id) using a vectorized merge. Filter events to the specific target date, being explicit about timezone handling.

4. Compute metrics

Use groupby aggregations to compute distinct active users, purchasers, purchase counts, and revenue per country and plan. Ensure no loops are used—rely on pandas built-in functions like nunique, sum, and count.

5. Format and validate output

Return a sorted tidy DataFrame with clear column names. Validate results by checking for anomalies, and document assumptions about nulls (e.g., dropped or imputed) and timezones (e.g., UTC).

Key Points to Mention

  • Vectorized operations: emphasize using pandas methods like str.replace, astype, and groupby to avoid loops.
  • Currency parsing: handle symbols, commas, and mixed formats; consider using regex or built-in string methods.
  • Null handling: decide whether to drop, fill, or flag nulls, and justify based on business context.
  • Timezone assumptions: specify whether timestamps are in UTC or local time, and how you convert to a consistent timezone.
  • Metric definitions: clarify what 'distinct active users' means (e.g., unique user_id with any event) and how purchasers are identified.
  • Tidy output: ensure the final DataFrame is sorted and in a tidy format (e.g., one row per country-plan combination).

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