InterviewStack.io LogoInterviewStack.io

Python Data Manipulation with Pandas Questions

Skills and concepts for extracting, transforming, and preparing tabular and array data in Python using libraries such as pandas and NumPy. Candidates should be comfortable reading data from common formats, working with pandas DataFrame and Series objects, selecting and filtering rows and columns, boolean indexing and query methods, groupby aggregations, sorting, merging and joining dataframes, reshaping data with pivot and melt, handling missing values, and converting and validating data types. Understand NumPy arrays and vectorized operations for efficient numeric computation, when to prefer vectorized approaches over Python loops, and how to write readable, reusable data processing functions. At higher levels, expect questions on memory efficiency, profiling and optimizing slow pandas operations, processing data that does not fit in memory, and designing robust pipelines that handle edge cases and mixed data types.

MediumTechnical
83 practiced
A pandas preprocessing step that used to run in seconds is now taking minutes as the input data has grown. Walk through how you'd figure out whether the bottleneck is CPU, memory, or I/O, and what you'd actually change in the code once you've found it.
HardTechnical
67 practiced
An overnight pandas ETL job failed because a vendor changed delimiter and quoting in a CSV file. Describe step-by-step how you would triage the incident, repair the pipeline for that run, and implement preventative measures so similar changes are detected and handled automatically in future runs.
HardSystem Design
78 practiced
Design a robust ETL pipeline using pandas for ingesting raw CSVs from S3, validating schema, transforming and normalizing columns, and writing partitioned parquet files for downstream model training. Include considerations for retries, atomic writes, incremental processing, schema evolution, monitoring, and memory constraints in your design.
MediumTechnical
57 practiced
You inherit a loop that builds up a result DataFrame by appending a new small DataFrame onto it on every iteration, and it gets dramatically slower as the loop progresses. Walk through why that pattern degrades, and how you'd rewrite it to scale to tens of thousands of iterations.
EasyTechnical
65 practiced
A teammate's pandas code raises a KeyError after they filter a DataFrame and then try to grab row 3 with .loc[3]. Walk through what's likely going wrong, how you'd decide between .loc and .iloc for a given task, and how you'd fix the code so index-based lookups behave predictably after filtering.

Unlock Full Question Bank

Get access to hundreds of Python Data Manipulation with Pandas interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.