Design a Pipeline: Intermediate
What you will be able to do
Ingestion Patterns
Choose an ingestion pattern and defend it
A 5-layer pipeline from source to consumer
File Drops
API Pulls
Change Data Capture
- Simple to implement and straightforward to debug
- Works with any source that can produce an export
- Latency measured in hours; fine for daily reporting
- Duplicate delivery requires manifest-table deduplication
- Sub-second latency from source change to lake
- Captures deletes that timestamp-based extracts miss
- Minimal read load on the source database
- Schema changes in the source can break the connector
- ▸'What if the vendor sends the same file twice?' Tests whether you have an idempotency strategy for file ingestion.
- ▸'The API rate limit is 100 req/min and you need 5M records.' Tests pagination, backoff, and high-water mark strategy.
- ▸'The source Postgres has 200 tables. How do you replicate them?' Expects CDC, not 200 scheduled API calls.
Storage Architecture
Justify a storage layout with query cost math
Medallion Architecture
Each medallion layer serves a different consumer at a different quality level
| Layer | Contents | Owner | Consumers |
|---|---|---|---|
| Bronze | Raw JSON events with duplicates | Ingestion pipeline | Data engineers only |
| Silver | Parsed, typed, deduplicated events | Spark / dbt models | Engineers and scientists |
| Gold | Daily active users by country | dbt models | Analysts and dashboards |
File Format
- Columnar: reads only the columns the query needs
- 10x compression over JSON with Snappy or Zstd
- Preferred by Spark, BigQuery, and Athena for analytics
- Schema must match at write time; no built-in evolution
- Row-oriented: efficient for write-heavy append workloads
- Schema in file header enables safe schema evolution
- Preferred by Kafka and CDC connectors for streaming
- Smaller per-record overhead for high-throughput writes
Table Formats
Partitioning Strategy
- ▸Target 128 MB to 1 GB per Parquet file for optimal S3 read throughput
- ▸Snappy Parquet compresses JSON roughly 10x; Zstd achieves 12 to 15x
- ▸$5 per TB scanned in BigQuery; partitioning routinely cuts cost by 99%
- ▸Iceberg metadata overhead: under 1% of data size for tables below 100 TB
Transformation Strategy
Argue ELT over ETL with reprocessing math
ELT Is the Modern Default
- Transforms data before loading into the warehouse
- Lower warehouse storage: only processed data lands
- Reprocessing requires re-extraction from the source
- Common in legacy Informatica and SSIS architectures
- Loads raw data first, transforms inside the warehouse
- Higher storage cost, but raw data is always available
- Reprocessing is a re-run, not a re-extraction
- Standard in modern Snowflake, BigQuery, Databricks stacks
Full Refresh vs Incremental
Late-Arriving Data
Schema Evolution
- ▸'The transform takes longer than its schedule interval. What now?' Tests overlap safety and idempotency under concurrent runs.
- ▸'A business rule changed. Restate 6 months of data.' Tests whether ELT retained raw data for reprocessing.
- ▸'Where do you validate: before or after the transform?' Tests quality-gate placement in the DAG.
Serving the Consumer
Design serving for distinct consumers
Consumer-Driven Design
| Consumer | Data Shape | Freshness | Example |
|---|---|---|---|
| BI Dashboards | Denormalized aggregates | Hourly | daily_active_users_by_country |
| ML Training | Wide point-in-time snapshots | Daily batch | user_features_snapshot |
| Reverse ETL | Narrow user-keyed rows | Minutes | user_segments_for_braze |
| Ad Hoc Analysis | Silver-layer detail rows | Varies | silver.parsed_events |
Pre-Computed Tables vs Materialized Views
- Warehouse manages refresh on a configured schedule
- Simple to create with a single DDL statement
- No quality gate between computation and exposure
- Refresh timing controlled by warehouse settings
- Pipeline manages refresh as an explicit DAG stage
- Quality checks run before data is exposed to users
- More operational overhead to build and maintain
- Refresh timing matches the pipeline SLA precisely
Freshness and SLAs
When Batch Falls Short
- ▸'How would analysts query this?' Tests whether the gold table was shaped for the consumer's access pattern.
- ▸'The dashboard takes 30 seconds. Fix it.' Expects pre-aggregation, materialized views, or partitioning.
- ▸'An ML engineer needs the same data but in a different shape.' Tests whether you build a separate gold table.
- ▸'What if the downstream team needs real-time but you are batch?' Wants Lambda architecture or a streaming sidecar.
Reliability Under Failure
Name every failure mode before asked
Idempotency
Retries and Dead Letter Queues
Failed records route to DLQ with alerting rather than halting the pipeline
Orchestration
Monitoring and Data Quality
- Make every write idempotent on a natural or deterministic key
- Route failed records to a dead letter queue with alerting
- State the freshness SLA and trace it backward through each stage
- Name monitoring metrics before the interviewer asks about failure
- Use MERGE or ON CONFLICT for all incremental loads
- Jump to tools before asking about volume, latency, and consumers
- Say 'Kafka' without naming the latency requirement it satisfies
- Assume exactly-once delivery without naming the mechanism
- Treat monitoring and alerting as a nice-to-have afterthought
- Build one gold table for consumers with different access patterns
> A payments company processes 40 million card authorizations daily from 3 processors. The risk team needs hourly decline-rate dashboards by card issuer. The ML team needs the raw transaction history for fraud model training. Regulatory audit requires 7-year retention of unmodified source records.
Structure a pipeline answer so every layer carries a tradeoff the interviewer can probe
- Category
- Pipeline Architecture
- Difficulty
- intermediate
- Duration
- 20 minutes
- Challenges
- 1 hands-on challenges
Topics covered: Ingestion Patterns, Storage Architecture, Transformation Strategy, Serving the Consumer, Reliability Under Failure
Lesson Sections
- Ingestion Patterns (concepts: paFileIngestion, paApiIngestion, paCdc, paBatchVsStreaming)
Three ingestion patterns dominate: file drops, API pulls, and Change Data Capture. Each carries a different latency floor and a different failure shape. The choice between them is the first design decision, and the interviewer expects it justified by the source system's constraints rather than by familiarity with a tool. File Drops A source system exports files to cloud storage on a schedule, and the pipeline picks them up. CSV and JSON from legacy vendors, Parquet from modern ones. This is the
- Storage Architecture (concepts: paMedallion, paPartitioning, paColumnarVsRow, paTableFormats, paSmallFiles, paDataLake)
Saying 'I would store it in S3' carries no information. The interviewer needs to hear the organizational model, the file format, the table format, and the partitioning key, because each of those decisions carries a cost that scales with the data. Medallion Architecture Medallion organizes the lake into 3 quality tiers. Bronze holds raw data exactly as ingested, byte-for-byte, including duplicates and malformed records. Silver holds cleaned, typed, and deduplicated records. Gold holds business-re
- Transformation Strategy (concepts: paEltVsEtl, paFullVsIncremental, paLateData, paSchemaEvolution, paDeduplication)
Where the transformation runs and how much data each run processes are the 2 decisions the interviewer probes most heavily. The answers reveal whether you understand data modeling rather than data movement. ELT Is the Modern Default ETL transforms data before loading it into the warehouse. ELT loads raw data first, then transforms it inside the warehouse using SQL or dbt. The real difference is where raw data lives after ingestion. In ETL, the warehouse holds only processed data, so reprocessing
- Serving the Consumer (concepts: paBatchProcessing, paStreamProcessing, paCostOptimization, paLambdaArch)
Most candidates spend 25 minutes on ingestion and transformation, then say 'analysts query it in Snowflake.' That sentence is where the score shifts, because how data is consumed drives every upstream decision. The consumer's query pattern, latency tolerance, and freshness requirement are inputs to the pipeline design, not afterthoughts. Name the consumer before naming the table. Consumer-Driven Design Different consumers need fundamentally different data shapes. Analysts writing dashboard SQL n
- Reliability Under Failure (concepts: paIdempotency, paRetryHandling, paDeadLetterQueue, paDagOrchestration, paMonitoring, paDataQuality)
A pipeline that works on a clean day is not what the interview is scoring. The probes in this layer test what happens when a source sends duplicates, a transform fails mid-run, the warehouse is unreachable for 20 minutes, or a deployment introduces a bug that corrupts 3 days of output. Reliability separates 'hire' from 'strong hire,' because it requires operational experience that a whiteboard cannot fake. Idempotency An idempotent pipeline produces the same output whether it runs once or 5 time