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

Given a column of monetary strings in inconsistent formats (currency symbols, thousands separators, negative amounts shown in parentheses, various locale conventions, or NULL), write a SQL transformation that normalizes them into a numeric decimal. Explain your assumptions and how you handle formats you cannot confidently parse (fail closed versus a best-effort guess).

MediumTechnical
37 practiced

A numeric column contains both NULLs and extreme outliers. Describe a pragmatic decision process for handling both before analytics: statistical detection methods (IQR, z-score), business-rule thresholds, when to impute versus flag versus drop, and how you would document and test these decisions so downstream analysts understand what happened to their data.

MediumTechnical
38 practiced

Discuss the options for parallelizing a CPU-bound data transformation in Python: threading, multiprocessing, vectorized numpy/pandas operations, and moving to a distributed framework like Dask or Spark. Explain why Python's GIL limits threading for CPU-bound work, and the practical costs (serialization overhead, memory duplication) of multiprocessing. Provide a small code sketch of a multiprocessing-based approach that preserves input order in its output.

MediumTechnical
31 practiced

You are using a Bloom filter to probabilistically deduplicate a high-volume stream. Given an expected number of unique keys N and an acceptable false-positive rate p, derive (or state and apply) the formulas for the bit-array size and the number of hash functions, and explain the operational consequence of a false positive here: does it silently drop a genuinely new record, or does it silently merge two distinct records? Also discuss what happens when two different keys hash to the same underlying bits (a collision) in a deterministic hash-based dedup scheme instead.

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.

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.