Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
CDC to Warehouse Data Parity
00:00
5 left

CDC to Warehouse Data Parity

HardSQL · PostgreSQL

Problem

Can you explain how you ensure data quality and parity consistency between change data capture (CDC) sources and a modern data warehouse?

Use the provided CDC event and warehouse customer tables to produce a reconciliation result. Consider the latest event for each customer and identify records that are not consistent between the two sources.

Output

  1. One row per parity exception, ordered by customer_id ascending.
  2. Return customer_id, source fields, warehouse fields, and parity_status.
  3. Include missing warehouse records, warehouse-only records, unapplied deletes, and field mismatches. Exclude fully matched records.

Schema

cdc_customer_events
ColumnTypeDescription
event_idPKINTUnique CDC event identifier
customer_idINTCustomer identifier from the source system
operationVARCHAR(20)CDC operation such as INSERT, UPDATE, or DELETE
customer_nameVARCHAR(100)Customer name included in the CDC payload
account_balanceNUMERIC(14,2)Account balance included in the CDC payload
account_statusVARCHAR(30)Account status included in the CDC payload
event_timestampTIMESTAMPTime at which the CDC event was recorded
warehouse_customers
ColumnTypeDescription
customer_idPKINTCustomer identifier in the warehouse
customer_nameVARCHAR(100)Customer name stored in the warehouse
account_balanceNUMERIC(14,2)Account balance stored in the warehouse
account_statusVARCHAR(30)Account status stored in the warehouse
Tablescdc_customer_eventswarehouse_customers
Interviewer

Your question is CDC to Warehouse Data Parity. 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
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.