Skip to content
Reliable Data Engineering
Practice problem hard databricksunity-cataloglakeflowauto-loaderdelta
Practise with timer, notes and rubric

Design an End-to-End Databricks Lakehouse for a Retailer

Difficulty: Hard · Topics: Databricks platform design · Time: 45 minutes

Scenario

A retailer with 1,200 stores and an e-commerce site is moving to Databricks. Sources:

Consumers: finance (daily revenue by store, must reconcile with the ERP, ready by 06:00), merchandising dashboards (hourly freshness), a demand-forecasting ML team, and a near-real-time “low stock” alert. GDPR applies to customer data.

Your task

Design the platform on Databricks. Cover ingestion, the medallion pipelines, Unity Catalog layout and security, orchestration and CI/CD, serving, cost and operations. Name concrete Databricks features and justify them.

Hints

Hint 1

Each source has a natural Databricks ingestion path: files → Auto Loader, Postgres → CDC (Lakeflow Connect or Debezium), SaaS → managed connectors, Kafka → Structured Streaming.

Hint 2

Think about which consumers need finalised, reconciled data (finance) versus fresh, approximate data (merchandising, alerts), and design the gold layer and SLAs accordingly.

Solution

Architecture

flowchart LR
    subgraph SRC[Sources]
        POS[POS JSON files<br/>every 5 min]
        PG[(Postgres orders)]
        SAAS[PIM / Salesforce]
        KAF[Kafka clickstream]
    end
    subgraph ING[Ingestion]
        AL[Auto Loader<br/>file notifications]
        LC[Lakeflow Connect<br/>CDC + SaaS connectors]
        SS[Structured Streaming<br/>Kafka source]
    end
    subgraph LH["Unity Catalog: prod_retail"]
        B[(bronze<br/>streaming tables)]
        S[(silver<br/>clean, conformed, SCD2)]
        G[(gold<br/>facts, dims, aggregates)]
    end
    subgraph SERVE[Serving]
        SQLW[Serverless SQL warehouse<br/>AI/BI dashboards, metric views]
        FS[Feature tables + Model Serving]
        ALERT[Low-stock alert job]
    end
    POS --> AL --> B
    PG --> LC --> B
    SAAS --> LC
    KAF --> SS --> B
    B --> S --> G
    G --> SQLW
    G --> FS
    S --> ALERT

Ingestion

Pipelines (Lakeflow Declarative Pipelines)

Unity Catalog layout and security

Orchestration, CI/CD and operations

Serving

Cost controls

Trade-offs to mention

What interviewers look for