Data Engineering interview questions: pipeline quality, observability & data validation
Reviewed by Mark Dickie · Last updated
10 questions on this page you can answer and see marked on the spot. Go to the first one
Data engineering pipeline quality is the practice of ensuring data moving through ingestion, transformation, and storage layers meets correctness, completeness, and freshness expectations. For a pipeline-quality interview, expect questions on schema validation, freshness SLOs, anomaly detection on volume and distribution, and the tooling that makes these checks observable. You should be able to distinguish between data tests (assertions against values or schema) and pipeline tests (assertions against orchestration behavior), and know where tools like Great Expectations, dbt tests, Soda, and Deequ fit. Interviewers also probe how you alert on anomalies without drowning teams in false positives, how you partition checks by freshness tiers, and how you trace a metric anomaly back to an upstream schema change or backfill.
What does a data engineering observability interview test?
An observability round checks whether you can instrument a pipeline end to end and reason about what the signals mean. The table below maps the four signal families interviewers ask about.
| Signal family | What it measures | Common tools | Typical interview question |
|---|---|---|---|
| Freshness | Time since last successful run or last new record | Airflow sensors, DAG-level SLAs | How do you detect a stalled upstream feed before downstream models break? |
| Volume / completeness | Row count vs. rolling baseline or expected window | dbt tests, Soda checks, custom SQL | What alert threshold would you set so a 5% daily dip is noise but a 40% drop is not? |
| Distribution / anomaly | Mean, null rate, cardinality, quantile drift | Great Expectations, Deequ, Monte Carlo | How do you catch a silent schema change that keeps types but shifts value distributions? |
| Schema | Column presence, type, nullability | dbt schema.yml, Gx ExpectTableColumnsToMatchSet | How do you version a breaking schema change across a shared downstream model? |
How do you design a data validation strategy?
- Identify the critical path. Start from the dashboards or ML features that consume the pipeline, then work backward to the source tables whose errors would break them.
- Define tiered SLOs. Not every table needs a one-minute freshness alert. Tier SLAs by downstream impact so one off-schedule feed does not page the whole team.
- Write assertions close to the transform. Put dbt tests or Great Expectations suites on the model where the data is shaped, not only at the source landing zone.
- Set anomaly baselines on a trailing window. Compare today's row count and null rates to a rolling median, not a fixed number, so seasonal patterns do not trigger false alerts.
- Route alerts by severity. Hard failures block downstream runs; soft anomalies write to an observability dashboard and a Slack channel for triage.
- Make failures debuggable. Store the failing rows, the check that failed, and a link to the run in the alert payload so the on-call engineer can start diagnosis without querying the warehouse first.
Key facts
- Tarmac's Data Engineering interview questions cover 24 questions at difficulty 1–5 of 5.
- Tarmac tracked 1,538 job postings asking for Data Engineering in September 2026.
- Roles asking for Data Engineering advertise a median base salary of £77,500, across 380 job postings as of September 2026.
- Tarmac last reviewed these Data Engineering interview questions on 14 October 2026.
At a glance
| Questions | 24 |
|---|---|
| Difficulty | 1–5 of 5 |
| Formats | True / false, Short answer, Fill in the blank, Multiple choice, Find the bug, Code output, Multiple answer |
What you'll review
- data validation testing pipelines
Practice questions
Try one before you open the answer. Pick an option and press Check; it's marked on the spot.
In a data pipeline, a schema validation check is used to verify that incoming records match an expected structure — such as column names and data types — before the data is loaded downstream.#
Options
Show answer
True. Schema validation in a data pipeline checks that incoming records conform to an expected structure — column names, data types, and constraints — so that malformed data is caught before it reaches downstream consumers.
Schema validation confirms that incoming data conforms to a predefined schema: expected column names, data types, and constraints. This catches structurally incompatible records early so they don't propagate downstream and cause silent errors in dependent tables or analytics.
In a data pipeline, what is data validation, and what kinds of rules does it check on incoming records before they are loaded into downstream tables?#
Show answer
Data validation checks incoming data against defined quality rules, such as schema conformity, nullability, value ranges, and uniqueness, so that bad records are caught before they reach downstream systems.
Data validation means running explicit checks on incoming records against expected rules (schema, null constraints, value ranges, uniqueness) before loading, so invalid or unexpected data is caught early instead of propagating to tables, dashboards, or models. A strong answer names both the purpose (catching bad data before it propagates) and concrete rule types.
In a data engineering pipeline, what is the purpose of data validation checks, and what kinds of rules do they typically enforce?#
Show answer
Data validation checks verify that ingested data conforms to defined quality rules before it reaches downstream systems. Typical rules include schema conformance (expected column names), column data types, nullability constraints, allowed value ranges, and uniqueness of keys.
Data validation checks verify that ingested data conforms to expected quality rules before it reaches downstream systems, so bad records are caught before they corrupt consumers. The typical rules are structural and content-level: column names and schema, data types, nullability, allowed value ranges, and uniqueness. Encrypting sensitive columns is a security concern, scheduling runs is orchestration, and aggregating raw events into dashboards is transformation, so none of those count as validation.
A uniqueness test in a data pipeline checks that a specified column (or combination of columns) contains no _____ values, ensuring each record can be distinctly identified.#
Show answer
A uniqueness test in a data pipeline checks that a specified column (or combination of columns) contains no duplicate values, ensuring each record can be distinctly identified.
A uniqueness test asserts that every value in a column or set of columns is distinct. If any value appears more than once, the test fails — protecting primary-key integrity and preventing double-counted or ambiguous records in downstream models.
Which data validation test checks that a column contains no missing values?#
Options
Show answer
The not-null test checks that a column contains no missing values. It asserts that every row has a non-null value in that column, which flags gaps in the data. Uniqueness, schema, and range tests check different properties and do not guard against nulls.
A not-null test asserts that every row in the target column has a non-null value, so it directly catches missing values. A uniqueness test checks for duplicate values, a schema test checks column types and structure, and a range test checks that values fall within bounds. None of those specifically guard against missing values.
In a data pipeline using Great Expectations (v0.18+), you need to verify that every row in the orders table has a non-null value in the order_id column. Which built-in expectation enforces this constraint? Give its name.#
Show answer
Use expect_column_values_to_not_be_null on the order_id column; it fails validation if any row has a null value there. (In the GX 1.x Python API this is the ExpectColumnValuesToNotBeNull class.)
The built-in expectation expect_column_values_to_not_be_null checks that no value in the specified column is null, which is exactly the constraint required for order_id. Uniqueness checks such as expect_column_values_to_be_unique detect duplicates rather than nulls, while expect_column_values_to_be_in_set and expect_column_values_to_match_regex validate membership and pattern conformance and do not address null detection.
In a dbt schema.yml file (dbt Core v1.7), the built-in generic test that verifies every value in a column is distinct is named _____, and the built-in generic test that ensures a column's values exist as a foreign key in another model is named _____.#
Show answer
In a dbt schema.yml file (dbt Core v1.7), the built-in generic test that verifies every value in a column is distinct is named unique, and the built-in generic test that ensures a column's values exist as a foreign key in another model is named relationships.
dbt ships with four built-in generic tests: unique (all values in a column are distinct), not_null (no nulls), accepted_values (values belong to an allowed set), and relationships (referential integrity, where each value in the child column exists in the parent model's column). The unique test covers the distinctness constraint, and relationships covers the foreign-key constraint.
Consider the following Python snippet from a data validation step in an ETL pipeline. The pipeline should fail the load stage when the user_id column contains any null values, but currently it never raises an error even when nulls are present. Identify the buggy line (1-based line numbers).#
import pandas as pd
def validate_user_ids(df: pd.DataFrame) -> None:
nulls = df[df['user_id'].isna()]
if len(nulls) == 0:
raise ValueError('user_id contains null values')Show answer
The bug is on line 5.
The buggy line is the if len(nulls) == 0: condition on line 5. The filter on line 4 correctly selects the rows where user_id is null, so nulls holds those rows. The condition len(nulls) == 0 is True only when no nulls were found, so the ValueError is raised exactly when the data is clean, and never when nulls are present. Changing the comparison to len(nulls) > 0 (or if not nulls.empty:) makes the error fire when nulls exist.
Which statement correctly describes the purpose of data freshness monitoring in a data observability tool such as Monte Carlo?#
Options
Show answer
Data freshness monitoring checks whether new data has arrived in a table within an expected time window, alerting when the table is stale or delayed. It compares the most recent load or event timestamp against the current time and historical patterns, so a broken upstream pipeline gets flagged. It does not check nulls, duplicates, or value distributions, which are separate data-quality dimensions.
Freshness monitoring tracks how recent the data in a table is, typically by comparing the maximum load-time or event-time timestamp against the current time and against historical arrival patterns. If no new data lands within the expected window, the tool alerts that an upstream pipeline may be broken. The option about NULL values describes completeness checks, the option about repeated primary-key values describes uniqueness checks, and the option about value distributions describes distribution monitoring. Those are separate data-quality dimensions, so none of them is the purpose of freshness monitoring.
In the Great Expectations data validation framework, what is the name of the reusable, named collection of individual Expectations (such as expect_column_values_to_not_be_null or expect_column_values_to_be_between) that together define the expected properties of a dataset?#
Show answer
Expectation Suite. It is a named, reusable collection of individual Expectations that together capture the expected properties of a dataset and serve as the core artifact for data-quality rules.
Great Expectations distinguishes its components precisely. An Expectation Suite is a named, reusable collection of individual Expectations, each such as a not-null check or a range check, that together define the expected properties of a dataset. It is the core artifact that captures data-quality rules, and it is what a validation run evaluates a batch of data against.
In a batch ETL pipeline, a schema validation check that verifies every column's data type matches the expected schema is sufficient on its own to guarantee that the data satisfies all business rules (such as value-range constraints, referential integrity, and uniqueness) specified in the data contract. True or false?#
Options
Show answer
Schema validation alone does not guarantee business-rule compliance in a batch ETL pipeline. A schema check only confirms structure, such as column names, data types, and nullability. Value-range limits, referential integrity, and uniqueness need separate data-quality checks on top of schema validation to satisfy a data contract.
Schema validation verifies structural conformance: column names, data types, and nullability. It does not enforce business-rule constraints such as value ranges, referential integrity, uniqueness, or cross-column relationships. Those require additional column-level and multi-column data-quality checks layered on top of schema validation, so a passing schema check alone cannot guarantee contract compliance.
You need to write a data-quality check for an ETL pipeline. The orders table should always satisfy these rules: the order_id column is a unique primary key, the status column only contains the values 'pending', 'shipped', or 'delivered', and the created_at column is never null. Which of the following is a valid assertion the check should make?#
Options
Show answer
A valid data-quality assertion for the orders table checks that order_id is unique, status is in ('pending','shipped','delivered'), and created_at is not null. Each check directly encodes one business rule as a testable condition, so the pipeline can fail when any rule is violated.
A data-quality assertion must encode each business rule as a testable condition on the dataset. The rule that order_id is a unique primary key becomes a uniqueness check, the rule restricting status to pending, shipped, or delivered becomes a membership check against that allowed set, and the rule that created_at is never null becomes a NOT NULL check. Only the assertion combining these three conditions covers all three stated rules. The other options each contradict one of the rules: allowing arbitrary status strings ignores the allowed set, allowing null created_at ignores the NOT NULL rule, and allowing duplicate order_id values breaks the primary key uniqueness.
A data engineering team runs nightly batch pipelines that load data into a warehouse. They notice intermittent silent data drops: some days the pipeline completes successfully but loads 40% fewer rows than expected, and the issue is only discovered days later by downstream consumers. Answer three things: (1) which observability check should they add, (2) where in the pipeline should it run, and (3) what must be true about the baseline it compares against so that a sustained drop is not masked.#
Show answer
(1) A row count reconciliation check that compares the number of rows received from the source against an independently obtained expected count, and fails the run when the deviation exceeds a configured threshold. (2) It should run at the ingestion boundary, as each batch or file is received from the source and before any transformation or load, so that if extraction itself drops rows (for example a partial API response or truncated file), the shortfall is caught early. (3) The baseline must be independent of the pipeline's own outputs, such as a count queried directly from the source system or a fixed historical reference. It must not be a rolling average of prior pipeline outputs, because a sustained drop would gradually lower that average and hide the anomaly.
A silent row shortfall is a volume anomaly: the pipeline finishes but delivers fewer rows than the source provided. A row count reconciliation check at the ingestion boundary, comparing received rows to an expected count obtained independently from the source, fails the run when the gap exceeds a threshold. Running it immediately after receipt and before transformation means a shortfall introduced during extraction is exposed before it reaches the warehouse. The baseline must not be derived from prior pipeline outputs, since a sustained drop would progressively lower a rolling average and mask itself; an independently sourced count avoids that feedback loop. Null checks, schema validation, and latency monitoring do not measure whether the expected number of rows arrived.
What does the following Python code print?#
def validate_volume(actual, expected, tolerance_pct):
if expected == 0:
return "PASS" if actual == 0 else "FAIL"
lower = expected - expected * tolerance_pct / 100
upper = expected + expected * tolerance_pct / 100
if actual < lower:
return "FAIL"
if actual > upper:
return "FAIL"
return "PASS"
print(validate_volume(95000, 100000, 5))Show answer
PASS
The call passes actual=95000, expected=100000, tolerance_pct=5. Because expected is non-zero, the early return is skipped. The bounds are computed as lower = 100000 - 5000.0 = 95000.0 and upper = 100000 + 5000.0 = 105000.0; these multiplications and divisions are exact in floating point. The first check, 95000 < 95000.0, is False because the comparison is strict, so the lower boundary is accepted. The second check, 95000 > 105000.0, is also False. Neither failure branch runs, so the function returns "PASS", which the print statement outputs. The boundary is inclusive because both checks use strict inequalities.
A nightly ETL job loads a source table into your data warehouse. Yesterday a source-system upgrade silently changed a column's data type from INTEGER to VARCHAR. Which data-validation check should you add to the pipeline to catch this before bad data is loaded?#
Options
Show answer
A schema-validation step at the ingestion boundary is the check to add. It compares incoming column names and data types against a stored contract and fails the run on a mismatch, so a silent INTEGER-to-VARCHAR change is caught before any rows are written to the warehouse.
A type change from INTEGER to VARCHAR is a schema drift event, so it must be detected by comparing the incoming column names and types against a known contract at the ingestion boundary; the pipeline then fails before any rows are written. Row-count reconciliation, statistical outlier detection, and primary-key uniqueness checks all run after the data is already in the warehouse, and none of them inspects the declared column types, so none of them catches this change before loading.
A data engineer wrote the following Python validation function to check a batch of records for missing required fields and duplicate IDs before loading into a warehouse. What exactly does the script print when run? Trace the code step by step and report the exact output printed.#
def validate(records):
required = ['id', 'name', 'email']
missing = 0
duplicates = 0
seen_ids = set()
for row in records:
if any(row.get(f) is None for f in required):
missing += 1
if row['id'] in seen_ids:
duplicates += 1
else:
seen_ids.add(row['id'])
return {'missing': missing, 'duplicates': duplicates}
records = [
{'id': 1, 'name': 'Alice', 'email': '[email protected]'},
{'id': 2, 'name': None, 'email': '[email protected]'},
{'id': 1, 'name': 'Charlie', 'email': '[email protected]'},
{'id': 3, 'name': 'Diana', 'email': None},
]
print(validate(records))Show answer
{'missing': 2, 'duplicates': 1}
The function loops over the four records. Record 1 has every required field non-None, so missing stays at 0; id 1 is not yet in seen_ids, so it is added. Record 2 has name set to None, so missing becomes 1; id 2 is new and is added. Record 3 has all fields present, so missing is unchanged; its id 1 is already in seen_ids, so duplicates becomes 1 and the set is not changed. Record 4 has email set to None, so missing becomes 2; id 3 is new and is added. The function returns a dict with missing equal to 2 and duplicates equal to 1, and print displays it as {'missing': 2, 'duplicates': 1}.
In a production data pipeline that uses a data-validation framework such as Great Expectations, Deequ, or Soda, which of the following are standard practices for maintaining data quality observability? Select all that apply.#
Options
Pick every one that applies.
Show answer
Defining executable expectation suites and persisting validation results as metrics over time are standard practices for data quality observability in frameworks like Great Expectations, Deequ, and Soda. Running checks only in production and muting failing checks both work against this, since checks should run at several pipeline stages and failures must stay visible to catch bad data early.
Expectation suites turn business rules and schema constraints into executable assertions, which is the core mechanism all three frameworks share. Storing validation results as metrics over time lets teams track quality across runs and spot regressions, which is standard observability practice. Running validation only in production is an anti-pattern because checks should shift left and run at multiple stages so bad data is caught before it reaches production or downstream consumers. Muting failures so runs never surface quality problems removes the feedback signal that observability exists to provide, so it is not a standard practice.
You operate a Spark ETL pipeline that reads from Kafka, aggregates events into a daily fact table, and writes partitioned Parquet to S3. Over the past month, total_revenue in downstream dashboards has been drifting downward. No code was deployed, and existing tests (schema validation and row-count reconciliation against the upstream source table) all pass. Which pair of observability checks would detect this kind of value-level corruption that the existing tests cannot?#
Options
Show answer
Column-level distribution checks on the value column (null rate, min/max, percentiles) combined with a SUM reconciliation between source and target detect value-level drift. Schema validation and row-count reconciliation cannot catch this, because the rows and columns stay structurally intact while the values inside them change.
Schema validation and row-count reconciliation both pass, so the problem is not structural change or row-level loss; it is value-level corruption inside existing rows. Distribution checks on the event_value column detect shifts in null rate and percentiles, and a SUM(event_value) reconciliation between source and target detects aggregate value divergence that row counts cannot show. Freshness and file-size checks monitor pipeline health and storage, not content. Primary-key uniqueness targets duplicate rows, which matching row counts already rule out. Dashboard latency and Kafka consumer lag address performance and delivery throughput, and neither detects wrong values when row counts are correct.
A team is building a streaming pipeline: CDC events land in Kafka topics, a stream processor (Flink or Spark Structured Streaming) consumes them, applies light transformations, and writes to a partitioned data lake. Which of the following are well-established, practical data quality validation and observability strategies for this architecture? Select all that apply.#
Options
Pick every one that applies.
Show answer
Schema registry enforcement on Kafka topics, per-window column statistics compared against baselines, and dead-letter queues with failure-volume alerting are well-established validation and observability strategies for streaming pipelines. Each catches bad data at a different stage: ingestion, content drift, or per-record failures. Full-table reconciliation after every micro-batch is prohibitively expensive at that cadence.
The three well-established strategies are enforcing schema compatibility at the topic level with a schema registry (rejects malformed or incompatible records at ingestion), computing windowed column-level statistics such as null rate and distinct-count ratio against baselines to detect anomalies (a standard streaming observability pattern), and routing failing records to a dead-letter queue with volume-based alerting (a standard error-handling pattern in stream processors). Full-table reconciliation after every micro-batch is not practical because the source is a changelog rather than a static snapshot, the destination is continuously appended to, and full scans at micro-batch cadence are prohibitively expensive; incremental or watermark-based checks are the streaming-appropriate alternative. Silently dropping records with null keys without logging or metrics removes all visibility into data loss, so it is the opposite of observability.
The following Python function implements a completeness validation check for a batch of records loaded by a data pipeline. It computes a completeness ratio using the worst-performing required field and a 95% pass threshold. What does it print when run?#
records = [
{"id": 1, "name": "Alice", "email": "[email protected]"},
{"id": 2, "name": "Bob", "email": None},
{"id": 3, "name": None, "email": "[email protected]"},
{"id": 4, "name": "Dave", "email": None},
]
required_fields = ["name", "email"]
threshold = 0.95
max_nulls = 0
for field in required_fields:
null_count = sum(1 for r in records if r.get(field) is None)
max_nulls = max(max_nulls, null_count)
completeness = (len(records) - max_nulls) / len(records)
passed = completeness >= threshold
print({"passed": passed, "null_count": max_nulls, "completeness_ratio": completeness})Show answer
{'passed': False, 'null_count': 2, 'completeness_ratio': 0.5}
There are 4 records. For the name field, only record 3 has None (1 null). For the email field, records 2 and 4 have None (2 nulls). The loop keeps the worst null count, so max_nulls = max(1, 2) = 2. Then completeness = (4 - 2) / 4 = 0.5. Since 0.5 is less than 0.95, the passed flag is False. The printed dict is {'passed': False, 'null_count': 2, 'completeness_ratio': 0.5}.
A data engineering team runs a streaming pipeline: upstream CDC events flow into Kafka, a stream processor (Flink or Spark Structured Streaming) consumes them and writes results to a partitioned data lake. The team already monitors Kafka consumer lag. Propose two additional, complementary data quality validation strategies for this pipeline: one targeting data content/schema integrity and one targeting output completeness. For each, briefly describe the concrete check it performs.#
Show answer
(1) Schema validation: enforce schema contracts using a schema registry (e.g., Confluent Schema Registry with Avro or Protobuf) so CDC events that violate the expected schema are rejected or routed to a dead-letter topic before they reach the stream processor. (2) Output completeness reconciliation: after each partition commit to the lake, compare record counts or checksums against upstream Kafka committed offsets or the stream processor's checkpoint to detect silent data drops, duplicate writes, or stalled partitions.
Consumer-lag monitoring only tracks ingestion throughput; it does not validate data content or detect silent drops between the processor and the lake. Schema validation at the Kafka boundary (typically via a schema registry) catches breaking schema changes and malformed CDC records before they enter processing, preventing downstream corruption from bad input. Output completeness reconciliation compares committed lake partitions against upstream Kafka offsets or stream-processor checkpoint metadata to detect silent data drops, duplicate writes, or stalled partitions, failure modes that lag metrics alone cannot surface. Together the two strategies cover content integrity and delivery integrity.
You are designing the data quality validation and observability layer for a production batch ETL pipeline. The pipeline ingests daily vendor CSV files, transforms them into a dimensional model, and serves a BI tool. Describe the key practices you would implement for production-grade data validation testing and pipeline observability, covering ingestion validation, data quality checks, freshness monitoring, and alerting/observability.#
Show answer
At ingestion, I would validate each vendor CSV against a versioned schema contract before any transformation: check column names, order, types, and required fields, and quarantine files that show schema drift instead of loading them. Inside the pipeline, I would add layered data quality tests at each stage: null checks on required keys, range and validity checks on measures, uniqueness constraints on natural keys, and referential integrity between facts and dimensions, with failing rows routed to a quarantine table and counted. For freshness, I would track the expected arrival time of each vendor file and alert when a delivery is missing or late against its SLA, and I would also alert on the dataset's last successful load time so stale data is never served silently. For observability, I would record test pass/fail rates, row-count and volume anomaly signals, and run metadata, surface data lineage from source files to BI models, and expose dashboards and alerts to both engineering and BI stakeholders with clear ownership and runbooks.
This is an open design question, so it stays a short answer graded on coverage rather than a single key. A strong answer covers all four areas named in the prompt: schema and contract validation at ingestion to stop vendor structure drift before it reaches the dimensional model; layered data quality checks (nulls, ranges, uniqueness, referential integrity) at each stage with quarantining of bad rows; freshness monitoring against vendor delivery SLAs so missing or late files are caught rather than silently serving stale data; and observability through test pass/fail metrics, volume anomaly detection, lineage, and stakeholder-facing dashboards and alerts. Answers that name concrete mechanisms for each area, rather than generic statements about quality, demonstrate the depth expected at this level.
A data-quality observability pipeline applies four row-level validation rules to a batch of records, aggregates each rule into a per-rule pass ratio, and then classifies the pipeline state. Classification uses both per-rule thresholds (strict < comparison) and a weighted overall score. What does this code print when run with the given data?#
records = [n {“id”: 1, “value”: 100, “status”: “active”},n {“id”: 2, “value”: None, “status”: “active”},n {“id”: 3, “value”: 200, “status”: “inactive”},n {“id”: 4, “value”: 50, “status”: “active”},n {“id”: 5, “value”: None, “status”: “inactive”},n]nnrules = {n “completeness”: lambda r: r[“value”] is not None,n “validity”: lambda r: r[“status”] in (“active”, “inactive”),n “freshness”: lambda r: r[“id”] % 2 == 0,n “uniqueness”: lambda r: r[“id”] != 3,n}nnweights = {“completeness”: 2, “validity”: 1, “freshness”: 1, “uniqueness”: 1}nthresholds = {“completeness”: 0.7, “validity”: 1.0, “freshness”: 0.5, “uniqueness”: 0.9}nnndef evaluate(records, rules):n results = {}n for name, rule in rules.items():n passes = [rule(r) for r in records]n total = len(passes)n passed = sum(1 for p in passes if p)n results[name] = passed / total if total else 0.0n return resultsnnndef classify(results, weights, thresholds):n failed_rules = sorted(n name for name, score in results.items()n if score < thresholds.get(name, 1.0)n )n total_weight = sum(weights.values())n weighted = sum(weights[n] * results[n] for n in results) / total_weightn if weighted < 0.8 and failed_rules:n return “critical”, round(weighted, 3), failed_rulesn elif failed_rules:n return “warning”, round(weighted, 3), failed_rulesn else:n return “ok”, round(weighted, 3), []nnresults = evaluate(records, rules)nstatus, score, failed = classify(results, weights, thresholds)nprint(results)nprint(status, score, failed)Show answer
{'completeness': 0.6, 'validity': 1.0, 'freshness': 0.4, 'uniqueness': 0.8}ncritical 0.68 ['completeness', 'freshness', 'uniqueness']
Tracing all 20 rule evaluations: completeness checks value is not None (3 of 5 pass → 0.6), validity checks status membership (all 5 pass → 1.0), freshness uses id % 2 == 0 (2 of 5 pass → 0.4), uniqueness flags id == 3 (4 of 5 pass → 0.8). Three rules fail their thresholds: completeness (0.6 < 0.7), freshness (0.4 < 0.5), and uniqueness (0.8 < 0.9). Validity does NOT fail because the comparison is strict < and its score equals its threshold exactly at 1.0. The weighted score is (2×0.6 + 1×1.0 + 1×0.4 + 1×0.8) / 5 = 3.4 / 5 = 0.68, which rounds to 0.68. Since 0.68 < 0.8 AND there are failed rules, the classify function returns 'critical'.
A data pipeline ingests daily financial transactions from an upstream OLTP system. Existing validation includes schema enforcement (column names and types via a schema registry), NOT NULL constraints on all fields, and range checks (revenue > 0). One day all checks pass, but the downstream revenue dashboard shows a 40% drop. The upstream team had changed the revenue field's unit from cents to dollars (dividing every value by 100) during a refactoring. No field was renamed or re-typed, and the row count is unchanged. Which validation strategy would detect this silent failure?#
Options
Show answer
Statistical distribution monitoring of the revenue field detects silent unit changes like cents-to-dollars. Comparing its mean, standard deviation, and percentiles against a historical baseline reveals a roughly 100x shift. Schema checks, NOT NULL constraints, range checks, and row-count reconciliation all pass because structure, nullability, positivity, and row counts are unchanged.
The failure is semantic: the field name, type, nullability, positivity, and row count are all unchanged, so schema enforcement, NOT NULL checks, range checks, and row-count reconciliation all pass. Schema registry compatibility rules govern structural evolution, not the meaning of values, so they cannot see a unit change. Tightening a lower bound does not help, because dividing by 100 keeps values positive and well above any reasonable floor. Statistical distribution monitoring does catch it: every percentile, the mean, and the standard deviation shift by about 100x relative to the historical baseline, far beyond a threshold such as 3 standard deviations, so the drift is flagged immediately.
Related interview questions
Job market
See data-engineering salaries and hiring demand from live job postings.
Practise these until they stick
That's every question we hold on this topic, and the page marks what you pick. What it can't do is remember. A free account keeps every answer, and what you miss comes back until it's right: after a day, then at longer gaps.
Free · the whole bank · 100 marked answers per 30 days · written feedback on the paid plan