InterviewStack.io LogoInterviewStack.io

Python Data Manipulation with Pandas & PySpark Questions

Techniques for cleaning, transforming, and analyzing data in Python using Pandas and PySpark. Covers working with DataFrames, data wrangling, missing-value handling, filtering, aggregations, joins, grouping, and typical patterns for data preparation and exploratory analysis, including both in-memory Pandas workflows and distributed PySpark processing.

HardTechnical
60 practiced
Implement a PySpark solution to compute sessionization for user events: create session_id per user where a new session starts if gap between events > 30 minutes. Provide code using window functions and explain stateful vs stateless approaches and how each behaves in streaming vs batch.
MediumTechnical
58 practiced
A PySpark job writes many tiny Parquet files partitioned by date/hour and downstream jobs suffer from small-file overhead. Describe three strategies to reduce the small-file problem and show code or Spark configs that perform coalescing/compaction during writes.
MediumTechnical
64 practiced
Given a Pandas DataFrame 'df' with a JSON column 'properties' (strings contain JSON objects), write Python (Pandas) code to expand the JSON into separate columns and handle missing keys by filling with NaN. Show code using pandas.json_normalize or apply + pd.Series.
EasyTechnical
52 practiced
You're given a CSV with 10M rows and you need to perform lightweight cleaning (drop unused columns, parse dates) before handing to analysts. In Pandas, what are three ways to reduce memory usage while reading this CSV? Provide code examples for dtype specification and for reading in chunks.
HardTechnical
97 practiced
Describe a robust approach in PySpark for schema evolution when appending nightly data to an existing Parquet dataset: how to detect new fields, align types, and safely append without corrupting downstream consumers. Include practical steps, code snippets, or tooling suggestions.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.