Python and Data Manipulation Questions
Demonstrate practical proficiency in Python for data exploration and preprocessing. Expect to perform data cleaning, joins, group by aggregations, pivots and reshaping, vectorized operations, missing value handling, and basic performance tuning using libraries such as NumPy and Pandas. Show how to write readable, testable, and efficient code for sampling, feature extraction, and quick prototyping, and how to scale to larger data sets using chunking or streaming approaches.
MediumTechnical
40 practiced
You are prototyping a model that uses both structured columns and free-text customer comments. In pandas, how would you extract a small, stable set of text features and combine them with the structured features without making the pipeline fragile or impossible to reproduce?
HardTechnical
52 practiced
You need to process a 50 GB CSV of transactions on a machine that cannot hold the full file in memory. Write a Python function that reads the file in chunks, filters invalid rows, and returns per-customer total spend and transaction count. The function should be restartable and should not require loading all rows at once.
MediumTechnical
43 practiced
A teammate hands you a pandas notebook that builds weekly reporting tables for leadership. What checks would you add so the notebook fails fast when an input column changes type, a join stops matching, or an aggregate quietly drifts from expected values?
MediumTechnical
46 practiced
Given an event table with user_id, event_ts, and spend, write a pandas function that returns one row per user with first_event_ts, last_event_ts, active_day_count, and average spend per active day. Assume timestamps are strings that may need parsing and some users have repeated events on the same day.
EasyTechnical
50 practiced
You are given a pandas DataFrame named df with columns customer_id, signup_date, country, age, and spend. Write a Python function clean_customers(df) that returns a cleaned DataFrame with parsed dates, standardized country values, numeric age and spend columns, and exact duplicate rows removed. If age is missing, fill it with the median age for that country when possible, otherwise use the overall median. Keep the original row order as much as practical.
Unlock Full Question Bank
Get access to hundreds of Python and Data Manipulation interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.