InterviewStack.io LogoInterviewStack.io

Data Quality and Edge Case Handling Questions

Practical skills and best practices for recognizing, preventing, and resolving real world data quality problems and edge cases in queries, analyses, and production data pipelines. Core areas include handling missing and null values, empty and single row result sets, duplicate records and deduplication strategies, outliers and distributional assumptions, data type mismatches and inconsistent formatting, canonicalization and normalization of identifiers and addresses, time zone and daylight saving time handling, null propagation in joins, and guarding against division by zero and other runtime anomalies. It also covers merging partial or inconsistent records from multiple sources, attribution and aggregation edge cases, group by and window function corner cases, performance and correctness trade offs at scale, designing robust queries and pipeline validations, implementing sanity checks and test datasets, and documenting data limitations and assumptions. At senior levels this expands to proactively designing automated data quality checks, monitoring and alerting for anomalies, defining remediation workflows, communicating trade offs to stakeholders, and balancing engineering effort against business risk.

MediumSystem Design
73 practiced
Design a pipeline to normalize free-form mailing addresses from multiple sources for analytics and geocoding. Include steps such as parsing, standardization (abbreviations), external validation (e.g., USPS or address verification API), storage of a canonical address plus a confidence score, handling PO Boxes and international formats, and cost/latency considerations for API usage.
EasyTechnical
89 practiced
You have an orders table used by dashboards:
orders(order_id INTEGER, user_id INTEGER, amount DECIMAL, discount_amount DECIMAL, order_date DATE)
Some rows have NULL discount_amount. Write an ANSI SQL query that returns total_revenue and avg_discount_per_order for each day in the last 30 days, ensuring that NULL discount_amount is treated as 0 and days with no orders return zero values appropriate for dashboard display. Explain assumptions about NULLs and empty days.
HardTechnical
63 practiced
A legacy warehouse contains 'event_local_time' WITHOUT timezone information, and many rows were written assuming the server timezone. Design a remediation pipeline to detect likely timezone for each record (using user profile timezone, IP geolocation, event patterns), convert to UTC, backfill corrected fields with an audit trail, and update downstream aggregated tables. Describe confidence scoring, rollback strategy, and testing approach.
MediumTechnical
76 practiced
Given tables:
events(user_id INT, event_type VARCHAR, occurred_at TIMESTAMP)
and users(user_id INT), write an ANSI SQL query to compute daily conversion_rate = conversions / exposures for the last 30 days, where exposures = count of users shown a promo and conversions = count of users who clicked. Ensure the query handles nulls, prevents division-by-zero, and emits 0.00% for days with zero exposures rather than NULL. Explain any assumptions.
HardTechnical
92 practiced
Design a suite of synthetic test datasets to validate ETL handling of time edge cases: DST start and end transitions across multiple timezones, leap seconds, historical timezone rule changes, ambiguous local times, and inconsistent offsets. Provide concrete example rows and explain the assertions you would run against the ETL output.

Unlock Full Question Bank

Get access to hundreds of Data Quality and Edge Case Handling interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.