InterviewStack.io LogoInterviewStack.io

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.

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
28 practiced

Given a table of per-entity transactions (an entity id, an amount, and a timestamp), write a SQL query using window functions that computes a rolling N-day average or sum per entity per day, including days where the entity had no activity (rather than silently skipping them). Explain how you generate the calendar of dates needed for this and discuss the RANGE versus ROWS framing for the window.

EasyTechnical
41 practiced

A stakeholder reports that joining two tables produced more rows than either input table (for example, 10,000 orders joined to 200 refunds produced 10,500 result rows). Walk through how you would debug this: what you would check first, what a sample query would look for, and how you would explain the root cause (and the fix) in plain language to a non-technical stakeholder. Separately, describe how you would resolve it when the two tables also share a column name (like id or created_at) that means something different in each source.

MediumTechnical
31 practiced

Given a table (or DataFrame) of user events with a timestamp, derive session boundaries: a new session starts whenever the gap between consecutive events for the same user exceeds a configured timeout. Implement this both in SQL (using LAG/window functions and a running sum to assign session ids) and in pandas (as a reusable function), and return session id, start, end, and event count per session. Discuss how you handle unsorted input and timezone-aware timestamps.

HardTechnical
29 practiced

You must identify probable duplicate records across multiple sources when there is no shared unique identifier and the same real-world entity (for example a customer) may be represented with typos, formatting differences, or partial information (name, address, email). Design an end-to-end approach for finding and resolving these duplicates at scale, and discuss the trade-offs your design makes between catching every true duplicate and avoiding an incorrect merge.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.