Cracking ML Interviews

Open in the interactive study hub

Data Architecture

Data architecture is the operating design of how data moves, changes, is governed, and creates value across the enterprise. It is broader than a storage choice and deeper than a reference diagram. A good architecture defines responsibilities, interfaces, failure modes, quality controls, security boundaries, and ownership models that still work when the platform is under real production pressure.

For principal-level work, the goal is not to chase fashionable patterns. The goal is to choose an architecture that matches business volatility, latency needs, team topology, governance obligations, and cost limits.


What Data Architecture Is and Why It Matters

Data architecture answers questions such as:

It matters because architecture determines:

Weak architecture often looks fine in a diagram and fails in operations. Strong architecture reduces ambiguity in how the platform should behave under change, scale, and incident conditions.


Core Principles of Modern Data Architecture

1. Treat Data as a Product

Important data assets need:

2. Separate Storage from Serving Semantics

Raw landing zones, integration layers, curated marts, and low-latency serving layers should not be conflated. They serve different purposes and should be optimized differently.

3. Design for Change, Not Just Current Volume

Most enterprise pain comes from schema drift, source changes, new domains, and evolving ownership, not from the first version of the pipeline.

4. Make Lineage and Observability First-Class

If you cannot explain where a metric came from, who changed a schema, or which downstream assets are affected by a failed job, the architecture is incomplete.

5. Prefer Explicit Contracts Over Tribal Knowledge

Use schema contracts, data product definitions, testable SLAs, and versioned interfaces. Verbal agreements do not scale.

6. Optimize for Business Value, Not Maximal Technical Purity

The most elegant architecture is often the wrong one if the team cannot operate it.


Layers of a Data Platform

The exact implementation differs by organization, but the logical layers are broadly consistent.

Layer Purpose Typical Technologies Key Design Questions
Source systems Systems that generate data SaaS apps, OLTP DBs, event producers, logs, IoT Who owns semantics at the source?
Ingestion Move data into the platform Fivetran, Kafka, Debezium, Airbyte, custom CDC Batch, CDC, or streaming?
Storage Durable raw and curated persistence Data warehouse, object storage, lakehouse tables What is the system of record?
Processing Transform, enrich, reconcile Spark, dbt, Flink, Beam, SQL engines Where do business rules live?
Serving Expose usable data for workloads marts, feature stores, serving DBs, APIs What latency and freshness are required?
Consumption End-user or system usage BI tools, notebooks, ML pipelines, apps Who are the consumers and how self-service is it?
Governance Control policy and trust catalog, lineage, RBAC, contracts, quality tools How are ownership and policy enforced?
Observability Monitor system health and data health logging, metrics, tracing, anomaly detection How do we detect and contain failures?

Practical Platform Flow

Sources -> Ingestion -> Raw Storage -> Processing -> Curated Storage -> Serving -> Consumption
                           |                |             |
                      Governance       Observability   Security

This is intentionally simple. Real platforms add feedback loops, replay paths, quarantine zones, and lineage controls.


Batch vs Streaming Architectures

This is one of the most over-simplified choices in data engineering. The correct decision depends on freshness, correctness, operational overhead, and downstream actionability.

Topic Batch Streaming
Freshness Minutes to days Seconds to sub-second
Complexity Lower Higher
Cost predictability Higher Lower
Operational burden Lower Higher
Typical strengths Simplicity, reprocessing, finance-grade reporting Event-driven use cases, personalization, monitoring

When to Use Batch

When Not to Use Batch

When to Use Streaming

When Not to Use Streaming

Common Mistakes


Batch Layer, Speed Layer, and Serving Layer

These layers matter most in Lambda-style thinking, but the concepts are useful even outside Lambda architecture.

Batch Layer

The batch layer computes complete, authoritative views from the full historical dataset.

Responsibilities:

When the business cares about correctness more than immediacy, the batch layer is the safety net.

Speed Layer

The speed layer computes incremental results from recent events to provide freshness before the batch layer catches up.

Responsibilities:

The speed layer is useful when:

Serving Layer

The serving layer exposes data in a form optimized for consumption. It is not just storage. It is a contract boundary.

Examples:

Serving design questions:

Common mistake: treating the warehouse itself as the serving layer for every workload, including low-latency application features.


Lambda Architecture

Lambda architecture combines:

Incoming events
   | \
   |  \-> Speed layer -> Real-time views
   |
   \----> Batch layer -> Recomputed views
                \          /
                 \-> Serving layer

Pros

Cons

When to Use Lambda Architecture

Typical examples:

When Not to Use Lambda Architecture

Common Mistakes


Kappa Architecture

Kappa architecture removes the separate batch path and treats the streaming log as the primary source for both current processing and replay.

Event log -> Stream processing -> Serving outputs
        \-> Replay same log when logic changes

Pros

Cons

When to Use Kappa Architecture

When Not to Use Kappa Architecture

Common Mistakes


Delta Architecture

The term "Delta architecture" is used inconsistently in the industry. In practice, teams usually mean an incremental architecture centered on transactional lakehouse tables, CDC, and change propagation rather than separate Lambda-style paths.

In this model:

How It Differs from Lambda and Kappa

Topic Lambda Kappa Delta Architecture
Primary abstraction Two computation paths Event log Transactional change tables
Batch vs stream split Explicit Mostly stream-first Often unified on table format
Replay model Batch recompute + stream Replay log Rebuild from raw plus change tables
Common technology fit Hadoop-era hybrid stacks Kafka/Flink-heavy stacks Delta Lake, Iceberg, Hudi, streaming upserts

When to Use Delta Architecture

When Not to Use It

Pros

Cons

Common Mistakes


Lakehouse Architecture

Lakehouse architecture combines:

Pros

Cons

When to Use Lakehouse

When Not to Use Lakehouse

Lakehouse vs Data Warehouse

Topic Data Warehouse Lakehouse
Operational model More managed More flexible, more responsibility
Workload breadth Analytics-first Analytics plus DS and ML
Open storage Usually less open Usually more open
Governance defaults Often stronger out of the box Must be implemented carefully

Opinionated guidance: if the organization mainly needs governed analytics and standard BI, a warehouse is often the better operating choice. If the organization needs a shared data platform for analytics, ML, and large-scale raw retention, a lakehouse is often the better architectural choice.


Medallion Architecture

Medallion architecture structures data into quality tiers, commonly:

When to Use

When Not to Use

Common Mistakes


Data Mesh

Data mesh is an organizational and architectural model where domains own their data products and publish them through shared platform standards.

Core Ideas

Pros

Cons

When to Use

When Not to Use

Common Mistakes


Data Fabric

Data fabric focuses on connecting and governing data across distributed systems through metadata, automation, policy, and integration tooling.

It is more about interoperability and intelligent control across a fragmented estate than about domain ownership itself.

Pros

Cons

When to Use

When Not to Use


Data Mesh vs Data Fabric

Topic Data Mesh Data Fabric
Primary focus Ownership model and domain-aligned products Cross-platform integration, metadata, and automation
Main problem solved Central team bottlenecks and domain scalability Fragmented systems and inconsistent governance
Dependency Requires strong platform standards Requires strong metadata and policy tooling
Risk Inconsistent domain execution Tool sprawl without operating model clarity

They are not direct opposites. Large enterprises may use both:


Centralized vs Decentralized Data Platforms

Centralized Platform

A central platform team owns ingestion, transformation, governance, and often modeling standards.

Pros

Cons

Decentralized or Federated Platform

Domain teams own more of their pipelines and data products while a platform team provides shared capabilities and guardrails.

Pros

Cons

Tradeoffs Between Centralized and Federated Ownership

Topic Centralized Federated
Standardization Stronger Harder
Domain responsiveness Lower Higher
Governance overhead Lower initially Higher by design
Platform leverage High High only with good enablement

Practical guidance: centralize foundational platform capabilities, security, metadata, and standards. Federate domain semantics and product ownership only when domain teams are capable of sustaining them.


Monolith vs Domain-Oriented Data Platforms

A monolithic platform often means:

A domain-oriented platform usually means:

Monoliths are not always wrong. Small teams often benefit from one coherent platform until scale and coordination costs justify separation.

When to Use a Monolith

When to Move Toward Domain Orientation


Event-Driven Architectures in Data Engineering

Event-driven architecture treats business events as first-class integration contracts.

Examples:

Benefits

Risks

Best Practices


Real-Time and Near-Real-Time Processing Tradeoffs

Real-time has a cost. The business should earn that cost.

Requirement Recommended Pattern
Seconds matter and action is immediate Streaming or event-driven serving
Minutes are acceptable Micro-batch or incremental table updates
Daily or hourly is fine Batch

Decision Questions

Common mistake: demanding "real-time" for dashboards nobody checks more than twice a day.


Data Orchestration and Workflow Design

Orchestration manages dependency, retries, scheduling, and recoverability. It should not become the home of every transformation detail.

Good Workflow Design

Common Orchestration Mistakes

When to Use Central Orchestration

When Not to Over-Orchestrate


Metadata, Lineage, Governance, and Security

These are not add-ons. They are architectural controls.

Metadata

You need technical metadata and business metadata:

Lineage

Lineage should answer:

Governance

Governance should be implemented as operating controls, not just review boards:

Security

Security design should include:

Common mistake: centralizing sensitive data in one lake without sufficiently granular access boundaries.


Reliability, Scalability, and Cost Optimization

Architecture choices should be evaluated on all three together. Optimizing only one usually backfires.

Reliability

Design for:

Scalability

Design for:

Cost Optimization

Design for:

Practical Guidance


Common Anti-Patterns


Best Practices and Decision Framework

Use this sequence when choosing or revising a data architecture:

  1. Identify the primary workloads.
    • BI
    • regulatory reporting
    • operational analytics
    • machine learning
    • event-driven product features
  2. Identify freshness requirements.
  3. Identify ownership model and team maturity.
  4. Decide where canonical truth lives.
  5. Choose the minimum architecture pattern that satisfies the need.
  6. Define serving contracts explicitly.
  7. Attach metadata, lineage, and quality controls at design time.
  8. Revisit cost, replay, and failure recovery before production rollout.

Opinionated Guidance


Final Summary

Modern data architecture is not a choice between buzzwords. It is the disciplined design of:

Lambda architecture remains useful when correctness and low latency both matter and the organization can afford the complexity. Kappa architecture works well in event-native systems with durable logs and strong stream-processing maturity. Delta-style lakehouse architectures are often the most practical middle ground for modern platforms that need incremental processing, historical traceability, and shared analytics and ML access. Data mesh addresses ownership scaling; data fabric addresses interoperability and metadata-driven control. Lakehouses broaden platform flexibility, while warehouses often remain the better operating model for analytics-first teams that value managed simplicity.

The best architecture is the one that makes data trustworthy, usable, governable, and evolvable under real business conditions.

View or edit this guide on GitHub