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
72 practiced
You must implement a reusable pandas transformation function that normalizes column names, enforces dtypes, fills missing values according to a policy, and returns a clean DataFrame. Describe how you would structure the function for testability and reusability, what unit tests you'd write using pytest with small sample DataFrames, and how to document assumptions and failure modes.
HardSystem Design
83 practiced
As an AI Engineer building preprocessing pipelines, describe how you would implement data contracts and validation checks using tools like pandera or custom validators integrated with pandas. Provide example checks for dtypes, ranges, nullability, uniqueness, and discuss how to integrate these checks into CI/CD and production monitoring with actionable alerts.
MediumTechnical
82 practiced
You receive timestamps in multiple timezones and must align them to UTC before aggregation. Explain how to parse timezone-aware strings, localize naive timestamps, convert to UTC, and handle ambiguous or nonexistent times during DST transitions. Provide pandas code snippets demonstrating tz_localize with ambiguous handling for 'Europe/Berlin'.
HardSystem Design
73 practiced
A long-running pandas job takes hours on a single machine. Outline a step-by-step migration plan to Dask (or Ray DataFrame) including minimal code changes to get started, how to test correctness, common unsupported pandas methods and workarounds, and how to measure and validate performance improvements and scaling behavior.
MediumTechnical
77 practiced
Explain how pandas categorical dtype reduces memory usage and can speed up operations like groupby. Given a DataFrame with 50M rows and a 'country' column with 200 unique values, describe steps to convert the column to categorical, measure memory improvement, and discuss pitfalls when categories change over time or new unseen categories appear.

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.