A meal-kit subscription company runs two reports off the same Postgres orders database
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
A meal-kit subscription company runs two reports off the same Postgres orders database. The canvas has both consumers in place: a Looker chart read once Monday mornings (last week's orders by region) and a fulfillment fraud-blocking service that flags suspicious orders within 30 minutes before fulfillment ships. Apply the three-question test this section just taught and pick the rhythm per consumer: the Monday chart tolerates daily or weekly freshness (Tier 4 or 5; batch wins on cost), and the fraud signal needs sub-15-minute freshness (Tier 1 or 2; streaming wins because batch cannot meet the floor). Build two side-by-side pipelines from the same Postgres source: pipeline A is daily batch (an orchestrator like Airflow plus a warehouse like Snowflake plus the Looker chart, slaFreshness < 24h on the warehouse table), and pipeline B is sub-15-min streaming (Kafka CDC plus a streaming engine like Flink, Spark Structured Streaming, or Kafka Streams plus a low-latency serving store plus the fraud service, slaFreshness real-time or < 1min on the streaming side). The same Postgres source feeds both; do not duplicate the source.
Practice This Problem
Solve this Pipeline Design problem with real code execution. DataDriven runs your solution and grades it automatically.