KatInterview

Build a Data Quality and Observability Layer for Live Pipelines

System DesignModel answer
HardModel answerSystem Designdata-engineeringobservabilitystreaming

Last updated

Design an end-to-end system for validating, monitoring, and recovering from data failures across both batch and streaming pipelines in a production environment.

The Scenario

Your team owns the data infrastructure for a financial firm where downstream systems — risk models, position tracking, and trading signals — depend on fresh, accurate data arriving on time. Bad data reaching these systems has real consequences: incorrect risk exposure calculations, wrong P&L, or flawed signals.

You have been asked to design a production-grade framework covering pipeline orchestration, data quality validation, and observability. The system must handle both nightly batch workflows and continuous streaming pipelines.

What to Address

1. Orchestration and dependency management

How do you coordinate pipelines that depend on one another? Upstream jobs must complete and pass quality checks before downstream jobs are allowed to proceed. Describe how you model dependencies, handle backfills, and enforce idempotent execution.

2. Data quality checks

What checks do you build into the pipeline? At minimum, discuss:

  • Upstream dependency checks (is the upstream partition ready and certified?)
  • Schema checks (are column names, types, and nullability as expected?)
  • Null and validity checks (required fields present, values in valid ranges?)
  • Primary key checks (no duplicates, no missing keys?)
  • Volume and threshold checks (row count within expected bounds versus a rolling baseline?)

How are check results acted on? What separates a blocking failure from a non-blocking warning?

3. Observability framework

What does your observability layer track and expose? Think about freshness, data lineage, schema drift, distribution metrics, alerting, and incident workflow. How does lineage help reduce alert noise when something breaks upstream?

4. Handling partial validation failures in streaming

A streaming pipeline is processing events and 2% of records are failing validation. Do you stop the entire pipeline? Walk through your decision process and describe your handling strategy in detail.

Expectations

This is a design question with no single right answer. Strong responses will:

  • Scope the problem before designing (scale, SLAs, criticality tiers)
  • Make concrete trade-offs rather than listing every possible feature
  • Show awareness of operational realities: alert fatigue, backfill correctness, consumer impact
  • Give a nuanced answer to the streaming failure question rather than a blanket yes or no

Hints

Hint 1

Before diving into components, define at least two criticality tiers for your datasets and let those tiers drive different SLAs, alerting behavior, and failure responses. A position table and a clickstream table should not be treated the same way.

Hint 2

For the streaming failure question, separate the act of consuming records from the act of publishing results to downstream consumers. Stopping consumption and stopping publication are two different decisions with very different consequences.

Hint 3

Think about the Write-Audit-Publish pattern: data is written to a staging area, quality checks run against the staged copy, and only a passing snapshot gets promoted atomically. This keeps consumers from ever touching unvalidated data.