Menu

Data Engineering interview question · Question 15 of 18

What are the most important data-quality checks in production?

  • Medium
  • conceptual / scenario
  • ~8 min
  • High relevance
  • 2 min read
  • Updated Oct 2026

Short answer

The checks that catch most real problems are: freshness (did new data arrive on time?), volume (is the row count in the expected range?), schema (are the columns and types as expected?), unique keys, no nulls in required fields, valid values and ranges, and references between facts and dimensions that match. The policy matters just as much: serious failures should stop the publish step, so users keep yesterday's correct data, while smaller oddities raise an alert for someone to investigate. Each check needs an owner who gets the alert.

On this page
  1. Detailed explanation
  2. Example
  3. Policy matters as much as checks
  4. Common mistakes

Detailed explanation

Check Question it answers Example
Freshness Is the data recent? Latest loaded_at within 2 hours
Volume Is the amount plausible? Today’s rows within ±30% of the 7-day median
Schema Did the structure change? Expected columns and types present
Uniqueness Are keys unique? COUNT(*) = COUNT(DISTINCT order_id)
Completeness Are required fields present? No NULL in order_id, order_date
Validity Are values sensible? amount >= 0, status in an allowed set
Referential integrity Do facts join to dimensions? No orphan customer_key
Reconciliation Does it match the source? Totals equal between staging and source

Example

CREATE TABLE orders (order_id INT, customer_id INT, amount INT);
INSERT INTO orders VALUES (1, 10, 50), (2, 11, -5), (2, 11, -5), (3, NULL, 20);

SELECT
  COUNT(*) - COUNT(DISTINCT order_id)                    AS duplicate_keys,
  SUM(CASE WHEN customer_id IS NULL THEN 1 ELSE 0 END)   AS missing_customer,
  SUM(CASE WHEN amount < 0 THEN 1 ELSE 0 END)            AS negative_amounts
FROM orders;
duplicate_keys missing_customer negative_amounts
1 1 2

Each non-zero value is a failed check.

Policy matters as much as checks

  • Blocking: uniqueness, schema, required fields. Stop the publish step.
  • Warning: volume and distribution anomalies. Alert and investigate.
  • Record results over time so thresholds can be based on history.

Common mistakes

  1. Checking only after publishing, when consumers have already seen bad data.
  2. Static thresholds that alert every weekend.
  3. Checks with no owner or response plan.

By , Data Engineer and Founder of DataDank · Last reviewed Oct 2026 · Standard SQL. Queries verified against sample data on SQLite 3.45

Progress is saved in this browser only. No account needed.

Search
Filter by type