DataDriven
LearnPracticeInterviewDiscussDailyJobs

An order service handler writes an order to Postgres and publishes order_placed to Kafka in the same

A medium Pipeline Design interview practice problem on DataDriven. Write and execute real pipeline design code with instant grading.

Domain
Pipeline Design
Difficulty
medium

Problem

An order service handler writes an order to Postgres and publishes order_placed to Kafka in the same function. There is no transaction across the two systems. Four outcomes are possible: both succeed, DB-only (silent ghost orders), Kafka-only (phantom events), or both fail (acceptable retry). Two of the four break invariants. A nightly recon job catches drift but enough leaks that notifications fire for orders that never shipped. Distributed transactions (XA, 2PC) do not solve this in modern infra. Spot the dual write by adding four marker nodes off the handler, one per outcome, each named with the invariant that breaks (or that the path is acceptable).

Practice This Problem

Solve this Pipeline Design problem with real code execution. DataDriven runs your solution and grades it automatically.

Related

  • All Practice Problems
  • Mock Interview Mode
  • System Design Interview Questions
  • Data Engineering Interview Prep Guide
  • Daily Challenge
  • Data Engineering Lessons