Dataford
Interview QuestionsInterview GuidesExperiencesCoaching
New
Pricing
Get started
Dataford
Popular roles
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Browse
Browse All RolesEvery role hub, from analyst to MLBrowse All CompaniesCompany-specific interview loopsAll Interview GuidesThe full guide library
Top questions by role
Software EngineerData AnalystData ScientistData EngineerBusiness AnalystAI EngineerMachine Learning EngineerProduct Manager
Top questions by skill
SQLPythonStatisticsMachine LearningA/B TestingSystem DesignGenerative AIProduct SenseMetricsBehavioral
Browse all questions →Try a mock interview
Experiences
Practice
Mock InterviewsTimed interview simulations with feedbackCoaching1:1 coaching with people at your target companiesSuccess PathYour 6-week structured planModulesCurated lessons by topicWebinarsTalks from ex-Big Tech data leadsPlaygroundA free-form scratch editor
Learn
BlogInterview strategy and career adviceTech Job Market ReportHiring trends across data and AI rolesFor UniversitiesDataford for career centersAbout DatafordWho we are and how we build
Pricing
Build my plan
Data Quality in High-Volume Pipelines
00:00
5 left

Data Quality in High-Volume Pipelines

HardSQL · PostgreSQL

Problem

How do you ensure data quality and consistency in a high-volume pipeline?

Write a PostgreSQL query that audits each pipeline batch for completeness and record-level quality issues. Return every batch, including batches with no ingested records, and classify each batch as passing or failing.

Output

  1. One row per batch with the batch identifiers, expected and ingested counts, issue counts, and quality_status.
  2. Include duplicate keys, missing values, invalid amounts, and invalid statuses.
  3. Order by batch_date, then batch_id.

Schema

pipeline_batches
ColumnTypeDescription
batch_idPKINTUnique pipeline batch identifier
source_nameVARCHAR(50)Name of the upstream data source
batch_dateDATEDate assigned to the pipeline batch
expected_event_countINTExpected number of events in the batch
ingested_events
ColumnTypeDescription
event_idPKBIGINTUnique ingested event row identifier
batch_idINTPipeline batch containing the event
event_keyVARCHAR(80)Source event identifier expected to be unique within a batch
event_tsTIMESTAMPTimestamp supplied by the source
amountNUMERIC(12,2)Non-negative event amount
statusVARCHAR(20)Event processing status
Tablespipeline_batchesingested_events
Interviewer

Your question is Data Quality in High-Volume Pipelines. Start with the requirements and the two tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
Sign up free to run your codeLog inLn 1
Run your query to see results here.