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
59 practiced
Design a robust A/B testing metric computation pipeline in PySpark to compute experiment metrics nightly across billions of rows. Requirements: deduplicate exposures/events, attribute events to the correct exposure and time window, compute per-cohort aggregated metrics and confidence intervals, and support incremental re-computation. Sketch schema, joins, and job orchestration details.
HardTechnical
48 practiced
Describe and implement optimizations to reduce the memory and CPU overhead when converting a large Spark DataFrame to Pandas via toPandas(). Include code snippets using Arrow, column selection, sampling, repartitioning, and driver memory settings. Explain trade-offs.
MediumTechnical
45 practiced
You're preparing to write a large dataset (~1TB) to Parquet partitioned by event_date using PySpark. Provide code that repartitions appropriately, writes compressed Parquet to s3://bucket/path/ with snappy compression, and explain best practices around partition column choice and avoiding small files.
EasyTechnical
51 practiced
As a PySpark starter task: write Python code to create a SparkSession, read a CSV file at s3://my-bucket/data.csv with header and inferSchema turned on, show the inferred schema and 10 sample rows. Add config to set shuffle partitions to 200 for the session.
MediumTechnical
51 practiced
Explain when to use cache() / persist() in Spark. Compare storage levels (MEMORY_ONLY, MEMORY_AND_DISK, MEMORY_ONLY_SER), describe how to choose them based on workload (iterative ML training vs one-off ETL), and show how to unpersist and monitor cache usage.

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.