Data Quality and Validation Questions
Ensuring correctness and trust in data: validation rules, constraints, completeness/accuracy/timeliness checks, and quality frameworks. Covers designing validation into pipelines, quality gates before publishing, and handling edge cases and real-world dirty data. Central to any data engineering or analytics role.
Write a query to find duplicate rows on a natural key (for example, the same email or the same combination of columns appearing more than once). Show both the GROUP BY / HAVING COUNT(*) > 1 form and the ROW_NUMBER() OVER (PARTITION BY ... ORDER BY ...) form that lets you keep exactly one canonical row per group, and explain when you would reach for each.
Write a query that computes a ratio metric (for example a conversion rate, a success rate, or a percentage) from a numerator and a denominator, and make sure it never errors or silently returns NULL when the denominator is zero: guard the division, return a sensible default (like 0.00% or a boolean flag) for the zero-denominator case, and explain your choice.
That is every published Data Quality and Validation question for Backend Developer so far. Browse the other topics in this category, or practice this one interactively.