Boston Consulting Group Data Manipulation (SQL/Python) Interview Questions
Master your tech interview with our curated database of real questions from top companies.
Transform messy transactions with pandas
You are given two CSVs. transactions.csv - Columns: txn_id, user_id, ts_iso (ISO8601 with timezone), amount (decimal USD; refunds negative), merchant_...
Unify 7 tables and impute missing values
Using pandas, write a robust function unify_orders(...) that ingests seven dataframes (or CSVs) with possibly inconsistent column casing/whitespace an...
Query top spenders and 7-day growth
Assume 'today' = 2025-09-01. Write a SQL query to: (1) for each model, compute total revenue in the last 7 days (2025-08-26 to 2025-09-01 inclusive) a...
Manipulate and merge DataFrames correctly
Given three pandas DataFrames: customers customer_id, join_date, tier 101, 2025-01-02, gold 102, 2025-02-10, silver 103, 2025-03-05, gold products mod...
Transform and aggregate messy event data
Using pandas (vectorized; no loops), clean, combine, and aggregate the following to produce country/plan day-level metrics for 2025-08-31. DataFrames ...
Visualize and Clean SKU Sales Data for Outliers
sales_data +------------+--------+-----------+----------+------------+---------+ | date | sku_id | unit_sold | revenue | promo_flag | store_id|...
Merge and Concatenate Inconsistent Order Files with Pandas
orders_2023 +----------+-------------+--------+ | order_id | customer_id | amount | +----------+-------------+--------+ | 101 | C001 | 120...
Merge and Clean Customer Order Data for Analysis
customers +----+---------+---------+ | id | name | country | +----+---------+---------+ | 1 | Alice | US | | 2 | Bob | UK | | 3 ...