Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started

Build Real-Time Sales Analytics Pipeline

HardPipelines00:00
Practice interviewer
In session
5 left
00:00

Your question is Build Real-Time Sales Analytics Pipeline. Take a moment with it on the right.

Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).

You need to log in / sign up to chat or submit.

Problem

Scenario

You are designing a real-time sales analytics pipeline for a large commerce platform that serves millions of merchants. Today, merchant dashboards and internal finance reports rely on hourly and daily jobs, which creates visible mismatches during flash sales, payment retries, refunds, and order edits. Leadership wants sales metrics to update within minutes while preserving correctness for financial reporting and merchant-facing dashboards. The main pain point is that the same order can change state multiple times, and current pipelines double-count or miss adjustments under peak load.

Current State

ComponentStatus
Event SourcesCheckout, orders, payments, refunds, and app webhooks emitted as JSON events
IngestionKafka topics for operational events; some legacy hourly object storage drops
ProcessingBatch Spark jobs plus limited stream consumers for operational alerts
StorageData lake in Parquet and warehouse marts in Snowflake
OrchestrationApache Airflow 2.x for batch DAGs and dbt runs

Scale: 8M+ merchants, 150K events/sec average and 600K peak during major sales periods, 1-3 KB/event, multi-region writes, <2 minute freshness target for dashboard aggregates, and 7-year retention for financial facts.

Question

How would you design the end-to-end pipeline so merchant sales analytics remain near real time, financially correct, and resilient to duplicates, late events, replays, and schema evolution at this scale? Explain the architecture, storage model, processing strategy, and operational approach you would use.