PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches

Quick Overview

This question evaluates proficiency with pandas-based data manipulation, including schema alignment, column renaming, type casting, and vertical concatenation when merging CSV files.

  • Medium
  • Boston Consulting Group
  • Data Manipulation (SQL/Python)
  • Data Scientist

Merge and Concatenate Inconsistent Order Files with Pandas

Company: Boston Consulting Group

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: Medium

Interview Round: Take-home Project

orders_2023 +----------+-------------+--------+ | order_id | customer_id | amount | +----------+-------------+--------+ | 101 | C001 | 120.5 | | 102 | C002 | 75.0 | | 103 | C003 | 140.0 | +----------+-------------+--------+ ​ orders_2024 +----------+-------------+--------+ | orderid | customer_id | amount | +----------+-------------+--------+ | 201 | C001 | 110.0 | | 202 | C004 | 95.0 | | 203 | C005 | 180.0 | +----------+-------------+--------+ ##### Scenario BCG CodeSignal notebook – merging annual order files with schema inconsistencies ##### Question Using Python (pandas), load orders_2023.csv and orders_2024.csv, rename columns so both have ['order_id','customer_id','amount'], cast amount to float, then vertically concatenate them into one DataFrame called orders_all. ##### Hints read_csv ➜ rename ➜ astype ➜ concat; watch the typo in orderid.

Quick Answer: This question evaluates proficiency with pandas-based data manipulation, including schema alignment, column renaming, type casting, and vertical concatenation when merging CSV files.

Last updated: Mar 29, 2026

Loading coding console...

PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.

Related Coding Questions

  • Transform messy transactions with pandas - Boston Consulting Group (Medium)
  • Unify 7 tables and impute missing values - Boston Consulting Group (Medium)
  • Query top spenders and 7-day growth - Boston Consulting Group (Medium)
  • Manipulate and merge DataFrames correctly - Boston Consulting Group (Medium)
  • Transform and aggregate messy event data - Boston Consulting Group (Medium)