InterviewStack.io LogoInterviewStack.io

Data Manipulation and Transformation Questions

Encompasses techniques and best practices for cleaning, transforming, and preparing data for analysis and production systems. Candidates should be able to handle missing values, duplicates, inconsistency resolution, normalization and denormalization, data typing and casting, and validation checks. Expect discussion of writing robust code that handles edge cases such as empty datasets and null values, defensive data validation, unit and integration testing for transformations, and strategies for performance and memory efficiency. At more senior levels include design of scalable, debuggable, and maintainable data pipelines and transformation architectures, idempotency, schema evolution, batch versus streaming trade offs, observability and monitoring, versioning and reproducibility, and tool selection such as SQL, pandas, Spark, or dedicated ETL frameworks.

MediumTechnical
57 practiced
A Spark job must process JSON logs with deeply nested structures. Provide a transformation plan to normalize nested arrays into a wide analytical table, ensuring you handle optional fields, nested nulls, and missing arrays. Show example PySpark code to explode and select fields safely.
MediumTechnical
65 practiced
Write a PySpark example that implements an upsert (merge) of CDC events into a Delta Lake table. Assume CDC events are in a streaming DataFrame with keys: id, op_type ('I','U','D'), payload (struct), ts. Show how you would apply changes to keep a current view table consistent and idempotent.
HardTechnical
77 practiced
You receive a stream of CDC events (insert/update/delete) from multiple regions. Events may arrive out-of-order. Design an algorithm to merge events into an SCD Type 2 store such that final temporal order is respected and late events are applied correctly. Discuss watermarking, buffering, and reprocessing trade-offs.
MediumSystem Design
68 practiced
You're tasked with building an incremental (daily) ingestion pipeline from a transactional OLTP Postgres DB into a data warehouse. Describe two approaches: (1) time-window incremental pull and (2) CDC-based ingestion. For each, list implementation steps, pros/cons, and how you'd ensure correctness in presence of late updates/deletes.
MediumSystem Design
73 practiced
Design a data validation framework for nightly ETL jobs that: (1) checks row counts, nullness, value ranges, distribution changes vs baseline, and referential integrity; (2) surfaces failures to Slack and creates Jira tickets when thresholds are exceeded; (3) allows rule versioning and dry-run mode. Provide high-level components, data flow, and example validation rule DSL.

Unlock Full Question Bank

Get access to hundreds of Data Manipulation and Transformation interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.