Data Transformation and Processing Logic Questions

Implementing transformation logic: joins, aggregations, deduplication, pivoting/reshaping, and business-rule application over datasets. Covers writing correct and maintainable transformation code, handling edge cases in the transform layer, and preparing data for downstream consumption. Focuses on the logic of turning raw data into analytics-ready outputs.

EasyTechnical
39 practiced

Given a table of records that can contain exact or near-exact duplicates for the same logical entity (for example customers or events), write a SQL query using window functions that deduplicates rows keeping one record per key: prefer the most recent row by an updated-at timestamp, and define a deterministic tie-break rule for rows with identical timestamps. Explain how your query behaves when the tie-break column is also NULL.

MediumTechnical
34 practiced

Compare CSV, JSON, Parquet, and Avro as formats for data you are transforming and storing: schema support and evolution, compression, read/write performance for analytical queries versus streaming ingestion, and the small-files problem. Give concrete scenarios for when you would choose each. Separately: when reading many partitioned Parquet or ORC files, you discover the same column has an inconsistent type across files (e.g. integer in some, string in others) - explain how you would detect, reconcile, and prevent this in your transformation code.

MediumTechnical
42 practiced

Implement a Python generator that reads a large CSV file in fixed-size chunks, applies a transformation to each chunk, and yields (or persists) the transformed results without ever loading the whole file into memory. Handle header rows, malformed lines, and different encodings, and describe how the job could resume from the last successfully processed chunk after a failure.

MediumTechnical
40 practiced

You receive phone numbers from several partners in inconsistent formats (with or without country codes, extensions, punctuation, or leading zeros). Design a normalization and validation workflow that produces a single canonical format suitable for matching and analytics, including how you would flag numbers you cannot confidently normalize and any privacy considerations for storing them.

HardTechnical
61 practiced

Two large files (or datasets) that do not fit into memory must be joined on a common key. Describe (pseudocode is fine) an external sort-merge join: sorting each side into runs on disk, merging the runs, and streaming a join over the two sorted streams. Explain how you would parallelize this across CPU cores or machines and how you would handle a skewed join key.

Unlock Full Question Bank

Get access to all 42 Data Transformation and Processing Logic interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.