The Storage Question: Intermediate
What you will be able to do
Why Parquet?
Explain why Parquet outperforms CSV/JSON for analytics - with numbers, not buzzwords
Row vs. Columnar Layout
The medallion storage layering: bronze keeps raw immutable data, silver is cleaned/conformed, gold is business-ready aggregates serving BI. Each layer trades storage cost for query readiness.
- Reads all columns to access one
- Poor compression - mixed data types per block
- No column statistics for query planning
- Human-readable but bloated at scale
- Reads only columns referenced in query
- 10:1 to 100:1 compression - same types cluster
- Min/max stats enable predicate pushdown
- Binary but 5-20x smaller on disk
Compression and Encoding
Predicate Pushdown
How Would You Partition?
Choose partition keys using cardinality analysis and avoid the over-partition trap
Choosing a Partition Key
- ▸"You have a 500 GB/day event stream. How would you partition it in S3?"
- ▸They want: partition key analysis, cardinality reasoning, file size targets, and awareness of downstream query patterns.
Cardinality Analysis
| Partition Key | Cardinality | Files/Day | Avg File Size | Verdict |
|---|---|---|---|---|
| date | 1 | ~10 | 50 GB | Too coarse - no pruning within day |
| date + hour | 24 | ~240 | 2 GB | Good for hourly queries |
| date + hour + user_id | 24 × 50M | millions | < 1 KB | Catastrophic - small file hell |
| date + region | ~30 | ~300 | 1.7 GB | Sweet spot for region-filtered queries |
The Over-Partition Trap
Delta or Iceberg?
Compare Delta Lake and Iceberg on ACID guarantees, time travel, and schema evolution
The Core Problem They Solve
- JSON-based transaction log (_delta_log/)
- Tight Spark integration - native in its parent platform
- MERGE INTO for upserts since day one
- Optimized for its parent platform ecosystem
- Change Data Feed for downstream CDC
- Log compaction via checkpoints every 10 commits
- Manifest-based metadata (Avro manifest lists)
- Engine-agnostic - Spark, Trino, Flink, Dremio
- Hidden partitioning - partition evolution without rewrite
- Snapshot-based branching and tagging
- Time travel via snapshot isolation
- Adopted by major cloud providers and query engines
Time Travel
Schema Evolution
- ▸"When would you choose Iceberg over Delta Lake?"
- ▸Strong answer: multi-engine environment, need partition evolution, want vendor-neutral format. Mention the compute coupling tradeoff - Delta's platform-specific optimizations are real.
Data Lake or Warehouse?
Articulate when a data lake, warehouse, or lakehouse architecture fits - and why
The Traditional Split
| Dimension | Data Warehouse | Data Lake |
|---|---|---|
| Data format | Proprietary internal format | Open (Parquet, ORC, Avro) |
| Schema | Schema-on-write enforced | Schema-on-read flexible |
| Query engine | Built-in, optimized | Bring your own (Spark, Trino, etc.) |
| Cost model | Compute-time or per-query | Storage + compute separately |
| Best for | BI dashboards, SQL analytics | ML, unstructured data, raw archives |
| Governance | Built-in RBAC and audit | Requires external catalog + policies |
The Lakehouse Convergence
- ▸"Your team has data in both a managed warehouse and S3. How would you unify the architecture?"
- ▸Good answer: migrate warehouse-only tables to Iceberg on S3, use the warehouse as a compute engine via external tables. Keep it for BI workloads, Spark for heavy ETL. One storage layer, multiple compute engines.
When the Warehouse Still Wins
How Much Will This Cost?
Model storage costs including lifecycle policies and format impact on cloud bills
S3 Storage Tiers
| Tier | Cost/GB/Month | Retrieval Cost | Best For |
|---|---|---|---|
| S3 Standard | $0.023 | None | Frequently queried data (< 90 days) |
| S3 Infrequent Access | $0.0125 | $0.01/GB | Monthly reports, 90-365 day data |
| S3 Glacier Instant | $0.004 | $0.03/GB | Compliance archives, rare queries |
| S3 Glacier Deep | $0.00099 | $0.02/GB + 12hr wait | Regulatory retention, never queried |
Format Impact on Cost
Lifecycle Policies
> The interviewer gives you a 500 GB/day event stream landing in S3 with a 2-year retention requirement and asks you to specify the physical layer: format, partitioning, table format, and what it costs. Every follow-up here is a number question.
event_date when 95% of queries filter on date, and defend it with cardinality: three years of daily partitions is about 1,095 directories and a single-day query touches 0.09% of the data.Parquet pop quiz, partitioning, and the physical layer
- Category
- Pipeline Architecture
- Difficulty
- intermediate
- Duration
- 35 minutes
- Challenges
- 0 hands-on challenges
Topics covered: Why Parquet?, How Would You Partition?, Delta or Iceberg?, Data Lake or Warehouse?, How Much Will This Cost?
Lesson Sections
- Why Parquet? (concepts: paColumnarVsRow)
This is asked as a screener because it instantly reveals whether you've worked with production data at scale. The interviewer doesn't want "it's columnar." They want you to connect physical layout to the queries you actually run. Row vs. Columnar Layout CSV and JSON store data row-by-row. To answer "what's the average order amount?" on a 500-column table, a row-oriented reader must load all 500 columns into memory, skip 499 of them, and aggregate the one it needs. Parquet stores each column cont
- How Would You Partition? (concepts: paPartitioning)
Partitioning is how you turn a 10 TB table scan into a 50 GB targeted read. The interviewer wants to hear your thought process for choosing a partition key - not just "partition by date." Choosing a Partition Key Start with how the data is queried. If 95% of queries filter on event_date, that's your partition key. If analysts always filter by region first, consider region. The goal is pruning: the query engine should eliminate partitions before reading any data. A table partitioned by date wit
- Delta or Iceberg? (concepts: paTableFormats)
Both Delta Lake and Apache Iceberg add ACID transactions to files sitting on object storage. They solve the same core problem: Parquet files are immutable, so updates, deletes, and schema changes require a metadata layer. The interviewer wants you to know what each does well and where they diverge. The Core Problem They Solve Without a table format, a "table" is just a directory of Parquet files with a naming convention. There's no atomic commit - if a write fails halfway, you have partial dat
- Data Lake or Warehouse? (concepts: paDataLake)
This question tests whether you understand the economics and tradeoffs, not just the definitions. The answer has shifted dramatically since 2022. The interviewer wants to hear you reason about it, not recite a comparison chart. The Traditional Split Data warehouses couple storage and compute into a managed service. You load structured data, it's optimized for SQL analytics, and you pay per query or per compute-second. Data lakes (object storage + Spark) store raw files in any format. You bring y
- How Much Will This Cost? (concepts: paCostOptimization)
Storage cost is the question that separates engineers who build pipelines from engineers who own pipelines. The interviewer wants to see that you think about money as a first-class engineering constraint. S3 Storage Tiers A common production setup: 500 GB/day ingestion in Parquet. That's ~15 TB/month raw. With 2-year retention, you're looking at 360 TB. At S3 Standard pricing, that's $8,280/month. Move data older than 90 days to IA and older than 1 year to Glacier Instant, and the same 360 TB co