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

A dataset has missing values scattered across several columns. Walk through how you would decide what to do about each column's missingness, and how you would document and communicate that decision to stakeholders who will consume the resulting dashboard or model.

EasyTechnical
31 practiced

Given a table with a text column that may be NULL, an empty string, or contain only whitespace, write a SQL query to find all three cases and then normalize them to a single canonical representation (NULL) so that downstream logic treats them consistently. Note any caveats that differ across SQL dialects.

MediumTechnical
41 practiced

A table stores raw event data as a JSON field containing nested objects and arrays (for example a user object and a products array). Write a SQL query that extracts the nested scalar fields into named columns and un-nests (explodes) the array into one row per array element, producing a flat, analysis-ready table. Discuss the trade-off between flattening at ingestion time (fixed schema, faster queries) versus parsing the JSON at query time (flexible, slower) as new nested fields appear.

MediumTechnical
58 practiced

Implement a reusable data-cleaning function that imputes missing values in a DataFrame: numeric columns filled with the column median, categorical columns filled with the mode (or a placeholder), with a configurable strategy per column type. The function should preserve original dtypes, not mutate the input in place, handle an empty DataFrame and a column that is entirely missing without raising an exception, and optionally add a boolean '<column>_imputed' flag so downstream consumers can tell which values were real versus imputed. Discuss how you would adapt this to a dataset too large to fit in memory.

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.

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.