BayLearnBayAreaLa8s

BayLearn Interview Sprints

Data Engineering Interview Sprint — Ingest It. Transform It. Scale It. Explain It.

Prepare for modern Data Engineering interviews with SQL, Python, PySpark, data modeling, AWS pipelines, troubleshooting, and a production-style hands-on data pipeline.

Refund terms are drafted and are not a current offer. Refund policy

4-Hour Live 1:1 Intensive
SQL + Python + Spark + AWS
D-PIPE Framework
Local Data Pipeline Lab
270+ Interview Questions
Mock Interview + Feedback

Curriculum

Short lessons in interview order. The production lab runs on your machine with Python — BayLearn does not execute candidate AWS accounts.

·

You will

  • See the full lesson path before you book
  • Know this is a Data Engineering interview sprint, not a Spark tutorial

Course overview5 min

Course overview

Course overview

In one sentence: You take messy data in, keep the grain while you transform it, get the job to scale, and say the trade-off out loud.

Four hours will not make you a Spark expert. You will get a rehearsal method: D-PIPE for design, DATA for incidents, and a scored mock against a Data Engineering rubric.

D-PIPE framework BayLearn data system-design spine. Use it on the 1 TB/day + 15-minute prompt. DDefine decisions + grain PProfile volume + quality IIngest + isolate bronze PProcess + persist EExpose + ensure qualityStart with who decides what, at which grain, with which SLA. Tools come last.Then DATA for incidents: Determine impact, Analyze signals, Trace transforms, Apply + Assure. What does the first D in D-PIPE force you to say out loud?
D-PIPE: define, profile, ingest, process, expose

Read the diagram, then say: I start with the decision and the grain. I do not start with Glue.

Who this is for

You already write SQL and some Python at work — analytics engineer, data engineer, backend engineer moving toward pipelines, or cloud data engineer. You have an interview coming up.

This sprint is a poor fit if you are still learning SELECT.

What the four hours are for

ModuleMinutesWhat you should be able to teach back
0 Readiness15Nine skill scores, not a hiring prediction
1 SQL + modeling40Joins, windows, NULLs, star grain, SCD Type 2
2 Python30Bounded memory, validation, idempotent writes
3 Spark45Driver vs executors, shuffle, skew, broadcast
4 Pipelines + AWS40Medallion, Parquet, Glue vs EMR, quality gates
5 Lab35Local pipeline: quarantine, overwrite, backfill
6 Mock45–60Scored rehearsal in one of five role modes
7 Feedback10Weakest two skills and a 7-day plan
End-to-end data pipeline Quarantine bad rows. Keep bronze immutable. Serve only after a quality gate. Source Ingest Bronzeimmutable raw Quarantinereason + run_id Silver Gold ServeInterview: bronze is the audit trail. Gold is the contract. Quarantine is not a deleted folder.Write path: validate → reject invalid → transform survivors → quality gate → publish. Where does quarantine belong? What is immutable?
End-to-end pipeline with quarantine

Bronze stays immutable. Invalid rows go to quarantine with a reason and a run id. Gold publishes only after a quality gate.

How interviews actually fail people

Listing “I would use Kafka, Spark, and Snowflake” without:

  1. a consumer SLA,
  2. a fact grain,
  3. a join explosion check,
  4. an idempotent write,
  5. a replay story.

The mock scores those five sentences more than a list of tools.

How to use the diagrams

Each teaching lesson puts the picture next to the idea. Read the picture, then say the caption out loud. If you cannot say it, read the picture again.

Guardrails

  • Prices and booking live in the Portal — this package does not hard-code dollar amounts.
  • The lab default is local Python. Optional AWS must be tagged and destroyed.
  • A BayLearn completion certificate is not an industry certification and not a hiring guarantee.

Start here

Start here

Course overview

In one sentence: You take messy data in, keep the grain while you transform it, get the job to scale, and say the trade-off out loud.

Four hours will not make you a Spark expert. You will get a rehearsal method: D-PIPE for design, DATA for incidents, and a scored mock against a Data Engineering rubric.

D-PIPE framework BayLearn data system-design spine. Use it on the 1 TB/day + 15-minute prompt. DDefine decisions + grain PProfile volume + quality IIngest + isolate bronze PProcess + persist EExpose + ensure qualityStart with who decides what, at which grain, with which SLA. Tools come last.Then DATA for incidents: Determine impact, Analyze signals, Trace transforms, Apply + Assure. What does the first D in D-PIPE force you to say out loud?
D-PIPE: define, profile, ingest, process, expose

Read the diagram, then say: I start with the decision and the grain. I do not start with Glue.

Who this is for

You already write SQL and some Python at work — analytics engineer, data engineer, backend engineer moving toward pipelines, or cloud data engineer. You have an interview coming up.

This sprint is a poor fit if you are still learning SELECT.

What the four hours are for

ModuleMinutesWhat you should be able to teach back
0 Readiness15Nine skill scores, not a hiring prediction
1 SQL + modeling40Joins, windows, NULLs, star grain, SCD Type 2
2 Python30Bounded memory, validation, idempotent writes
3 Spark45Driver vs executors, shuffle, skew, broadcast
4 Pipelines + AWS40Medallion, Parquet, Glue vs EMR, quality gates
5 Lab35Local pipeline: quarantine, overwrite, backfill
6 Mock45–60Scored rehearsal in one of five role modes
7 Feedback10Weakest two skills and a 7-day plan
End-to-end data pipeline Quarantine bad rows. Keep bronze immutable. Serve only after a quality gate. Source Ingest Bronzeimmutable raw Quarantinereason + run_id Silver Gold ServeInterview: bronze is the audit trail. Gold is the contract. Quarantine is not a deleted folder.Write path: validate → reject invalid → transform survivors → quality gate → publish. Where does quarantine belong? What is immutable?
End-to-end pipeline with quarantine

Bronze stays immutable. Invalid rows go to quarantine with a reason and a run id. Gold publishes only after a quality gate.

How interviews actually fail people

Listing “I would use Kafka, Spark, and Snowflake” without:

  1. a consumer SLA,
  2. a fact grain,
  3. a join explosion check,
  4. an idempotent write,
  5. a replay story.

The mock scores those five sentences more than a list of tools.

How to use the diagrams

Each teaching lesson puts the picture next to the idea. Read the picture, then say the caption out loud. If you cannot say it, read the picture again.

Guardrails

  • Prices and booking live in the Portal — this package does not hard-code dollar amounts.
  • The lab default is local Python. Optional AWS must be tagged and destroyed.
  • A BayLearn completion certificate is not an industry certification and not a hiring guarantee.

You will

  • Answer 25 scenario questions
  • Show weak categories to the instructor before the live session

How the assessment works5 min

How the assessment works

Module 0 — Readiness assessment

15 minutes. Take a baseline before the live session. These scores show what to practice. They do not predict hiring.

D-PIPE framework BayLearn data system-design spine. Use it on the 1 TB/day + 15-minute prompt. DDefine decisions + grain PProfile volume + quality IIngest + isolate bronze PProcess + persist EExpose + ensure qualityStart with who decides what, at which grain, with which SLA. Tools come last.Then DATA for incidents: Determine impact, Analyze signals, Trace transforms, Apply + Assure. What does the first D in D-PIPE force you to say out loud?
D-PIPE spine you will use all day

Outcomes

  • Complete de-readiness-v1 (25 items) closed-book.
  • Know your two weakest skills before Module 1.
  • Understand that the final exam is a separate 30-item gate (de-final-v1, 75%).

Path

  1. Read How the assessment works.
  2. Take the assessment.
  3. Skim the course overview diagrams so later lessons have a map.

Instructor notes

Adapt the live mock from skill bars. Strong SQL → spend time on Spark shuffle and Type-2. Weak SQL → do not skip joins.

Readiness Assessment15 min

Readiness Assessment

Readiness assessment

In one sentence: Twenty-five short scenarios give you skill scores so the live session can spend time on the gaps.

This is de-readiness-v1. It is a baseline, not a hiring prediction and not the final exam (de-final-v1, 30 items, 75% pass).

What you are scoring

SkillWhat a strong answer sounds like
SQLGrain, WHERE vs HAVING, windows, anti-joins
PythonGenerators, validation, no uuid4-on-retry
Data modelingFact grain first, then dimensions
SparkShuffle vs broadcast, skew evidence
Pipeline architectureIdempotent overwrite, backfill scope
AWSS3 layout, Glue vs EMR, Athena bytes
ReliabilityReplay, late data policy
Data qualityBlocking vs warning gates
TroubleshootingDATA: impact, signals, lineage, proof

Bands use the same five levels as other BayLearn sprints: Foundation → Developing → Interview Capable → Interview Ready → Advanced.

How to take it

Do it closed-book once. Then drill the 270-question bank on the two weakest skills. If you read the explanations first, the score cannot tell anyone where to spend the mock.

Instructors see skill rollups, not a pass/fail stamp. Strong SQL usually means the mock leans Spark, SCD, and design. Weak SQL means the mock starts with grain and joins.

After you finish

Bring the scorecard into Module 1. If SQL is the weak skill, do not skip windows and Type-2 joins just to get to Spark.

25 scenario questions. Each card is tagged with the skill it scores. Open a card to read the prompt and the four choices.

  1. Keep only delivered orders before summing revenue.
  2. Keep countries whose SUM(revenue) exceeds 10,000.
  3. Keep customers whose COUNT(*) of orders is at least 3 after grouping.
  4. Keep product categories whose AVG(unit_price) is above 50 after grouping.

Scored take: enroll, open Learn, then this same lesson. One question at a time. After 15 you see your band and eight skill scores.

You will

  • Walk through a fan-out join without losing grain
  • Explain Type 2 history without drawing a textbook diagram

SQL joins10 min

SQL joins

SQL joins and cardinality

In one sentence: A join is a grain decision. If you cannot say what one output row represents, do not write the JOIN.

SQL join types The join type is a grain decision wearing SQL syntax. INNERonly matches LEFTkeep left grain FULLkeep both ANTI / SEMIEXISTS / NOT EXISTSCustomers with no orders: LEFT + WHERE order_id IS NULL, or NOT EXISTS. INNER hides them.CROSS JOIN is a cartesian product. If you did not mean it, you are about to explode GMV. Which join keeps customers who never ordered?
SQL join types

Read the diagram, then say: INNER keeps matches. LEFT keeps the left grain. ANTI finds absences. CROSS is a cartesian product I must justify.

Worked grain: ecommerce

Tables (simplified):

sql

-- customers: 1 row per customer_id
-- orders:    1 row per order_id (customer_id, status, order_ts)
-- order_items: 1 row per order_id + sku  -- this is usually the fact grain

Customers who never ordered

sql

SELECT c.customer_id
FROM customers c
WHERE NOT EXISTS (
  SELECT 1 FROM orders o WHERE o.customer_id = c.customer_id
);

NOT EXISTS (anti-join) is the interview-default. LEFT JOIN ... WHERE o.order_id IS NULL is the same idea if you do not filter the right table in WHERE for other reasons.

The LEFT JOIN + WHERE trap

LEFT JOIN + WHERE trap A filter on the right table in WHERE turns a LEFT JOIN into an INNER JOIN. WrongLEFT JOIN orders o ... WHERE o.status = 'delivered' RightLEFT JOIN orders o ON ... AND o.status = 'delivered'WHERE o.status = 'delivered' drops left rows whose right side is NULL — including customers with no orders.Put right-side predicates in ON (or filter in a subquery) when you must preserve the left grain. Why did my customer count collapse after a LEFT JOIN?
Filter in WHERE turns LEFT into INNER

sql

-- WRONG: drops customers with no delivered orders, including never-ordered
SELECT c.customer_id, o.order_id
FROM customers c
LEFT JOIN orders o ON o.customer_id = c.customer_id
WHERE o.status = 'delivered';

-- RIGHT: preserve customers; only attach delivered orders
SELECT c.customer_id, o.order_id
FROM customers c
LEFT JOIN orders o
  ON o.customer_id = c.customer_id
 AND o.status = 'delivered';

Put right-side predicates in `ON` when the left grain must survive.

Join explosions

Join explosion Type-2 dimensions without valid time duplicate every fact. Fact: 1 order_itemorder_id 1001 Dim Type 2: 3 versionsno date predicate Result: 3 rowsGMV × 3Fix: JOIN dim ON dim.customer_sk = fact.customer_sk AND fact.event_ts >= dim.effective_from AND fact.event_ts < dim.effective_to.Detect: COUNT(*) vs COUNT(DISTINCT order_item_id). If they diverge after a join, you lost grain. How do you detect a fan-out join in 30 seconds?
Type-2 join without valid time triples GMV

Type-2 customer dim with three versions and JOIN dim ON dim.customer_id = fact.customer_id with no time predicate copies every fact three times. If GMV triples, “the join looked correct” will not help.

sql

SELECT f.order_item_id, d.region, f.net_gmv
FROM fact_order_item f
JOIN dim_customer d
  ON d.customer_sk = f.customer_sk
 AND f.event_ts >= d.effective_from
 AND f.event_ts <  d.effective_to;

Prefer half-open intervals: >= from AND < to.

Detect in 30 seconds

sql

SELECT COUNT(*) AS rows_out,
       COUNT(DISTINCT order_item_id) AS grain
FROM joined;

If rows_out > grain, you fanned out. Stop talking about window functions until this is 1:1.

Semi-joins vs pulling columns

If you only need “orders that have a fraud flag in another table,” EXISTS / IN (semi-join) avoids pulling duplicate columns. If you need attributes from both sides, you join — then you immediately check grain.

Weak vs strong answer

WeakStrong
“I always LEFT JOIN so I don’t lose data.”“I pick the join from the grain I must keep, and I put right-side filters in ON.”
“I’ll DISTINCT it.”“DISTINCT hides an explosion. I fix the predicate and prove COUNT vs COUNT DISTINCT.”

COMMON MISTAKE: Filtering dim.current_flag = true on a historical fact. That restates the past into today’s attributes.

SENIOR-LEVEL EXPECTATION: Name the fan-out, show the BETWEEN (or ASOF) join, and name the recon query you would run in production.

SQL window functions10 min

SQL window functions

SQL window functions

In one sentence: A window keeps the row and looks across a partition. An aggregate collapses the partition. Pick one on purpose.

Window ranking ROW_NUMBER picks one survivor. RANK / DENSE_RANK keep ties. ROW_NUMBER1,2,3 even on ties — one winner RANK1,1,3 — gap after ties DENSE_RANK1,1,2 — no gapsLatest address per customer: ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY updated_at DESC, id DESC) = 1.Without a unique tie-breaker, reruns pick different rows. Add a unique id to ORDER BY. Which function do you use to keep exactly one current row?
ROW_NUMBER vs RANK vs DENSE_RANK

Read the diagram, then say: Latest-row is ROW_NUMBER with a deterministic ORDER BY. Ties without a unique id are non-deterministic reruns.

Latest row per customer

sql

SELECT *
FROM (
  SELECT a.*,
         ROW_NUMBER() OVER (
           PARTITION BY customer_id
           ORDER BY updated_at DESC, address_id DESC
         ) AS rn
  FROM customer_address a
) x
WHERE rn = 1;

MAX(updated_at) then join back is slower to get right (ties) and harder to extend. The window makes the survivor rule visible.

RANK / DENSE_RANK are for competitions (“top 3 products, keep ties”). They are the wrong tool for “one current address.”

Frames: running totals

Default frame for many engines is RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW. For a running sum of orders you almost always want rows, not peer groups of equal timestamps:

sql

SUM(net_gmv) OVER (
  PARTITION BY customer_id
  ORDER BY order_ts, order_id
  ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
) AS running_gmv

LAST_VALUE without an explicit frame often returns the current row, not the last in the partition. Spell the frame or use first_value with DESC.

DE patterns worth rehearsing

PatternWindow sketch
Days between ordersLAG(order_ts) OVER (PARTITION BY customer_id ORDER BY order_ts)
Percent of categorygmv / SUM(gmv) OVER (PARTITION BY category)
Sessionizegap vs LAG > 30 minutes → new session_id
Dedup eventsROW_NUMBER on business key + event_ts desc

Performance

Windows sort. A window on an unpartitioned 2 TB table is a shuffle in Spark SQL and a memory/sort cost in warehouses. Partition by a column the query already filters. Do not PARTITION BY user_id on a high-cardinality fact unless you mean it.

Weak vs strong answer

WeakStrong
“RANK and ROW_NUMBER are the same.”“ROW_NUMBER always unique per partition; RANK leaves gaps on ties.”
“GROUP BY can do latest row.”“GROUP BY loses the other columns unless I rejoin; the window keeps the row.”

COMMON MISTAKE: ORDER BY updated_at DESC with timestamp collisions and no unique id — Monday’s gold disagrees with Tuesday’s gold.

SENIOR-LEVEL EXPECTATION: Name ROWS vs RANGE, and why a unique tie-breaker is part of the contract.

SQL nulls and performance8 min

SQL nulls and performance

NULLs and SQL performance

In one sentence: NULL is not a value. If you forget three-valued logic, the query can come back empty. If you wrap a partition column in a function, the engine cannot prune and you pay for a full scan.

SQL logical processing order WHERE is before GROUP BY. HAVING is after. That is WHERE vs HAVING. FROM WHERE GROUP BY HAVING WINDOW SELECT ORDERstatus = 'delivered' is a row filter → WHERE. SUM(gmv) > 10000 is a group filter → HAVING.You cannot put SUM() in WHERE. You can put a column in HAVING only after grouping (or as a post-select trick you should not rely on). Why can't HAVING and WHERE be swapped?
SQL logical processing order

Read the diagram, then say: WHERE filters rows before grouping. HAVING filters groups after aggregation. Order status belongs in WHERE; SUM(gmv) > 10000 belongs in HAVING.

Three-valued logic traps

sql

-- If the subquery returns a NULL, NOT IN is UNKNOWN for every row → empty result
SELECT sku FROM products
WHERE sku NOT IN (SELECT sku FROM recalled_skus);  -- recalled_skus.sku has NULLs

-- Safe
SELECT sku FROM products p
WHERE NOT EXISTS (
  SELECT 1 FROM recalled_skus r WHERE r.sku = p.sku
);
ExpressionWhat interviewers listen for
COUNT(*)Rows, including all-NULL rows
COUNT(email)Non-null emails only
NULL = NULLUNKNOWN, not TRUE — join keys that are NULL never match
COALESCE(discount, 0)Explicit default; say whether that is business-true

Sargable predicates and Athena/Spark SQL

sql

-- BAD: function on the partition column → full scan
WHERE date_trunc('day', event_ts) = DATE '2026-09-09'

-- GOOD: range on the raw column / partition
WHERE event_date = DATE '2026-09-09'
-- or
WHERE event_ts >= TIMESTAMP '2026-09-09'
  AND event_ts <  TIMESTAMP '2026-09-10'
Partitioned data lake Partition by the filter the query actually uses. s3://lake/gold/orders/event_date=2026-09-09/*.parquetHive-style prefix so engines can skip whole days Goodevent_date, region Dangeroususer_id → millions of folders Also checkfile size 128–512 MBPartition explosion + tiny files = Glue/Athena death. Compaction is a pipeline step, not a someday ticket. What happens if you partition by user_id?
Partitioned lake

Read the diagram, then say: I partition by the filter I actually run. user_id partitions create millions of tiny folders.

Also project columns. SELECT * on wide Parquet still reads every column chunk. Athena cost is bytes scanned, not row count.

EXPLAIN as a habit

Before you change cluster size, look at bytes, partitions pruned, and join type. “We’ll add DPUs” is not a SQL fix.

Weak vs strong answer

WeakStrong
“NULLs are zeros.”“NULL means unknown. I define COALESCE at the contract, not in ad hoc SQL.”
“I’ll wrap the date in a function so it matches.”“I keep the predicate sargable so the engine can prune.”

COMMON MISTAKE: WHERE region NOT IN ('US', NULL) — the NULL poisons the list.

SENIOR-LEVEL EXPECTATION: Connect NULL join keys, NOT IN, and recon (COUNT vs COUNT(col)) to a wrong KPI.

Data modeling10 min

Data modeling

Data modeling for interviews

In one sentence: Say the grain of the fact table before you draw boxes. Two grains are two facts, with conformed dimensions.

Star schema Say the grain of the fact before you name a column. FactSales1 row = 1 order_item DimDaterole-playing dates DimProductsku / category DimCustomercurrent or Type 2 DimStorelocation grainMeasures live on the fact (qty, net_gmv). Descriptive attributes live on dimensions. Degenerate order_id can sit on the fact. What is the grain of FactSales?
Star schema with FactSales at order_item grain

Read the diagram, then say: One fact row is one order line. Dates, product, customer, and store are dimensions. net_gmv lives on the fact.

Grain is a sentence

Write it in English first:

  • “One row per order line (order_id + sku + line_number).”
  • Not “orders.” Orders and order lines are different grains. Mixing them is how GMV double-counts shipping.

If marketing wants daily category sales, that is a second fact (or an aggregate table), not extra columns jammed onto fact_order_item.

What belongs where

On the factOn the dimension
qty, gross, discount, net_gmv, taxproduct name, category, brand
degenerate order_idcustomer attributes (Type 1 or 2)
foreign keys / surrogatesstore city, timezone
junk flags that are degenerate (gift_wrap)slowly changing attributes

Additivity: qty and net_gmv add across time and product. unit_price does not — store sold_unit_price on the line and never AVG it as if it were additive without a weighted formula.

Conformed dimensions: dim_date and dim_product used by finance and marketing so “category” means the same thing. If two teams redefine category, a lakehouse will not make the numbers match.

Star vs 3NF vs data vault (interview length)

  • Star: interview default for analytics. Fast SQL, clear grain.
  • 3NF: OLTP and some integration hubs. Do not model a BI mart as 3NF “because it’s normalized.”
  • Data vault: audit-heavy integration. Name it only if the interviewer asked about source-history at enterprise scale — then still expose a star to BI.

Weak vs strong answer

WeakStrong
“I’ll put everything in one wide table.”“Order-item fact plus conformed dims. Daily GMV is an aggregate fact.”
“Star is outdated; we do Data Vault.”“Vault for raw history if we need it; star for the decision.”

COMMON MISTAKE: Putting customer_region on the fact and overwriting it when the customer moves — silent restatement of history.

SENIOR-LEVEL EXPECTATION: Two grains, two facts, one dim_date, and a sentence about additivity.

Slowly changing dimensions7 min

Slowly changing dimensions

Slowly changing dimensions

In one sentence: Type 1 vs Type 2 is a restatement question: does yesterday’s report still need yesterday’s attribute?

SCD Type 2 History is a restatement decision, not a default. Type 1Overwrite in place. No history. Type 2New row + effective_from / to Join rulefact.ts >= from AND fact.ts < toExample: customer 88 moves from CA → NY on 2026-03-01. A Jan order still joins CA. A March order joins NY.Type 1 is correct for fixing a typo in email. Type 2 is correct for region, segment, or price list that reports must reconstruct. When is Type 1 acceptable for a customer name?
SCD Type 2 vs Type 1

Read the diagram, then say: Typos get Type 1. Region, segment, and price list that finance must reconstruct get Type 2 and a valid-time join.

Type 2 mechanics

Keep a surrogate key (customer_sk) on the dimension and a business key (customer_id). Facts store customer_sk or join on business key plus time — pick one pattern and stick to it.

text

customer_id | sk | region | effective_from | effective_to     | is_current
88          | 10 | CA     | 2020-01-01     | 2026-03-01       | false
88          | 11 | NY     | 2026-03-01     | 9999-12-31       | true

Join (half-open):

sql

ON d.customer_id = f.customer_id
AND f.event_ts >= d.effective_from
AND f.event_ts <  d.effective_to

is_current is a convenience for “who are they today.” It is the wrong predicate for historical facts.

CDC apply

CDC pipeline The log is the source of truth. Replay must be possible. OLTP DB CDC loginsert/update/delete StreamKinesis / Kafka ApplyMERGE / Type 2 Lake / WHidempotent sinkDeletes: tombstone or expire the Type-2 current row. Never silently drop.Replay: keep offsets / binlog position. A sink that is not idempotent will duplicate gold on retry. How do you handle deletes and replay?
CDC path

On an update that changes a Type-2 attribute: expire the current row (effective_to = change_ts) and insert a new current row. Deletes close the current row; they do not DELETE FROM history unless the contract is GDPR physical delete (then you have a legal path, not a silent UPDATE).

Inferred members: a fact arrives for customer_id not yet in the dim. Insert a placeholder Type-2 row (region = 'UNK') so the fact can load, then overlay when the dim arrives. Do not drop the fact.

Valid time vs transaction time

The warehouse cares when the business said the customer lived in NY (valid time). The CDC log time is when we learned it. If those differ, late-arriving dim updates need a restatement policy: reopen affected facts or accept as-of load time. Say which one finance signed.

Weak vs strong answer

WeakStrong
“We Type-2 everything.”“I Type-2 attributes that change the meaning of history.”
“I join on customer_id.”“I join on customer_id and valid time, or I use the surrogate captured at load.”

COMMON MISTAKE: Overlapping effective ranges. Two current rows. Facts duplicate.

SENIOR-LEVEL EXPECTATION: Name inferred members, late dims, and whether restatement is in scope.

You will

  • Explain why a pandas whole-file load fails at scale
  • Defend an idempotent rerun of a daily partition

Python pipelines12 min

Python pipelines

Python for pipelines

In one sentence: Production Python for data stays in bounded memory, checks types at the edge, and keeps counters you can put on a dashboard. Finishing a notebook once is not enough.

Python memory in pipelines Do not load a 20 GB JSON file into a list because it worked on the laptop sample. Boundedgenerator / iterate lines / chunk Unboundedlist(json.load), pandas.read_csv() whole fileJSONL: for line in file. Malformed line → quarantine with reason, continue. Don't fail the whole date on one bad record unless the contract says so.When rows or joins no longer fit memory, that is the Spark/Glue sentence — not 'pandas with more RAM'. When do you leave pandas for Spark?
Bounded vs unbounded memory

Read the diagram, then say: I iterate JSONL. One bad line goes to quarantine. I do not json.load a 20 GB file because the sample was 2 MB.

JSONL ingest sketch

python

def iter_orders(path):
    with path.open() as fh:
        for line_no, line in enumerate(fh, 1):
            try:
                yield json.loads(line)
            except json.JSONDecodeError as exc:
                quarantine(record=line, reason=str(exc), line_no=line_no)

Keep raw bytes in bronze. Quarantine is a first-class dataset: source file, record id if any, reason, timestamp, run_id. If you drop bad rows with no trace, you fail audits and you fail the interview.

Validate at the boundary (TypedDict, pydantic, or hand checks for keys, types, Decimal money). Do not let "19.9900" become float and then argue about pennies.

CLI and ops

bash

python3 pipeline/run.py --date 2026-09-09

UTC dates, structured logs (rows_in, rows_ok, rows_quarantine, bytes_out), no secrets in git. argparse (or equivalent) beats hidden environment magic in a 4-hour lab.

When Python is the wrong engine

If you are shuffling 1 TB or joining two large facts, the next sentence is Spark/Glue, not “pandas with a bigger box.” Interviewers listen for that threshold.

ETL vs ELT The question is where CPU runs, not which acronym is fashionable. ETLTransform in Spark/Glue, then load ELTLoad files, transform in warehouse SQL LakehouseBoth: Spark for heavy, SQL for martsETL wins: messy files, multi-engine, large joins, SCD Type 2 at lake scale.ELT wins: warehouse already holds the data, analysts own the model, cost is SQL slots not clusters. When does warehouse ELT beat Spark ETL?
ETL vs ELT

Python ETL is fine for moderate files into Parquet. Warehouse ELT is fine when the data is already loaded and analysts own SQL. Say which constraint you have.

Weak vs strong answer

WeakStrong
“I’ll read the file into a DataFrame.”“I stream lines, quarantine, and write partitioned Parquet.”
“We use pandas for everything.”“Pandas until memory or join size forces Spark.”

COMMON MISTAKE: Catching all exceptions and continuing with empty output — silent data loss.

SENIOR-LEVEL EXPECTATION: Counters, quarantine schema, and a kill criterion (too many invalid rows abort the date).

Memory and idempotency13 min

Memory and idempotency

Memory and idempotency

In one sentence: A retry must replace the same business keys. If you mint a new uuid4() on every run, you create duplicate facts.

Idempotent partition overwrite A retry must replace the same business keys, not insert a second identity. Retry 1 and retry 2write to tmp/ then os.replace or overwrite event_date=2026-09-09 Anti-patternINSERT + uuid4() on every retryCounts after two runs of the same date stay equal. That is the demo you run in the lab and the sentence you say in the mock.Staging then swap avoids a reader seeing a half-written folder. Dynamic partition overwrite must be scoped — not overwrite the whole table. How do you prove a pipeline is idempotent?
Idempotent partition overwrite

Read the diagram, then say: I write a temp folder and swap, or I overwrite event_date=2026-09-09. Two runs of the same date produce the same counts.

Memory

  • Iterators and generators keep peak RAM near one record (plus buffers).
  • pandas.read_csv(chunksize=...) if you must pandas.
  • Loading the whole day into a list of dicts will blow memory.

When a join no longer fits, you do not “optimize Python.” You move the join to Spark and you say why.

Idempotent writes

text

lake/curated/orders/event_date=2026-09-09/part-*.parquet

Overwrite that prefix (or MERGE on the business key). Do not INSERT into an ever-growing folder.

Staging:

  1. Write .../event_date=2026-09-09/_tmp_<run_id>/
  2. Quality check
  3. os.replace / atomic rename / Spark overwrite of the date partition only

Readers should not see a half-written date. Spark dynamic partition overwrite must be scoped. Overwrite mode on the whole table is how you delete 2019.

Backfills

Orchestration DAG Dependencies, retries, and a backfill that cannot smash today. Extract Validate Transform Quality Publish goldonly if gates passBackfill: date-scoped tasks, isolated partitions, extra capacity. Never 'rerun the whole DAG from 2019' on the prod warehouse.Retries must be idempotent. A retry that INSERTs again is an incident generator. How do you isolate a one-month backfill?
Orchestration DAG

A one-month backfill is a loop of dates (or a bounded range) with extra capacity, not “rerun prod from 2019.” Isolate partitions. Recon each date: COUNT(*) and checksum vs bronze.

Weak vs strong answer

WeakStrong
“Jobs are idempotent if they can rerun.”“Rerun of date D replaces D and only D; counts match.”
“I’ll append and dedupe later.”“Dedupe later is a second pipeline. I overwrite the grain I own.”

COMMON MISTAKE: mode=append plus a new run_id column treated as uniqueness.

SENIOR-LEVEL EXPECTATION: Name tmp+swap, partition overwrite, and the recon query you run after retry.

You will

  • Trace a wide transformation to shuffle files
  • Fix a skewed join with a salting or broadcast trade-off

Spark architecture15 min

Spark architecture

Spark architecture

In one sentence: The driver builds a DAG. Executors run tasks on partitions. You scale executors, not the driver.

Spark architecture The driver plans. Executors run tasks on partitions. DriverSparkContext + DAG Cluster managerYARN / K8s / Glue Executor 1tasks + cache Executor 2tasks + cache Executor ntasks + cacheYou do not 'run Spark on the driver' for 1 TB. The driver must stay small. Wide transformations shuffle between executors. Who holds the SparkContext?
Spark driver and executors

Read the diagram, then say: SparkContext lives on the driver. Work happens on executors. A fat collect() to the driver is how you OOM the application.

Lazy evaluation

Spark lazy evaluation Transformations build a plan. Actions run it. read / filter / joinnot executed yet Logical plan Optimizepredicate pushdown Actioncount / write / showA bug in a withColumn can sit silent until write. Two actions without cache recompute the DAG twice.Interview: I cache only when I reuse a wide stage. I unpersist. Cache is not a default. Why can a bug appear only at write/count?
Transformations vs actions

filter, select, join construct a plan. count, write, collect run it. Catalyst may push predicates and prune columns only because you have not forced an action yet.

Two actions without cache recompute. Cache the wide reuse, then unpersist. Caching everything is not a plan.

Job / stage / task

Job, stage, task A shuffle boundary starts a new stage. Jobone action Stagenarrow pipeline Taskone partition Partitionunit of parallelismmap / filter / withColumn stay in a stage. groupBy, join, distinct, repartition shuffle and cut a new stage.Spark UI: find the longest stage first. That is usually the shuffle or the skew, not 'need more nodes'. When does a wide transformation start a new stage?
Shuffle boundaries cut stages

Narrow transforms (map-like) stay in a stage. Wide transforms (groupBy, join, distinct, repartition) shuffle and start a new stage. Tasks ≈ partitions. If you have 200,000 tiny files you have 200,000 tiny tasks.

When not Spark

Hundreds of MB that DuckDB, warehouse SQL, or the lab’s Python already handle: say so. Spark startup and shuffle tax are real. It is fine to say “this does not need a cluster.”

On AWS, Glue is the usual serverless Spark. EMR when you need cluster control. See the AWS lesson — do not start with EMR for a nightly 20 GB job.

Weak vs strong answer

WeakStrong
“Spark is distributed pandas.”“Partitioned execution with shuffles at wide transforms.”
“I’ll collect to pandas for the last step.”“collect is a driver trap; I write Parquet and query with Athena/Spark SQL.”

COMMON MISTAKE: df.count() in a loop to “debug” — each count is a full job.

SENIOR-LEVEL EXPECTATION: Point at Spark UI stages, not at spark.executor.memory as the first knob.

Spark performance15 min

Spark performance

Spark performance

In one sentence: Find the longest stage, then the bytes, then the skew. Do not add nodes first — that is how you spend money on a hot key.

Spark shuffle Network + disk + serialization. Required for grouping and most joins. Map sidewrite shuffle files by key Exchangebytes across the network Reduce sideread, combine, computeShuffles are expensive and sometimes the correct answer. Avoiding them with a wrong broadcast is worse.Evidence: shuffle read/write bytes in Spark UI, not a feeling that 'joins are slow'. Why are shuffles expensive but sometimes required?
Shuffle: map, exchange, reduce

Read the diagram, then say: A shuffle is serialization plus disk plus network. I pay it for a correct groupBy or join. I do not pay it because I repartition(1000) out of habit.

Playbook (say this in order)

  1. Spark UI → longest stage.
  2. Shuffle read/write bytes.
  3. Task duration histogram (skew).
  4. EXPLAIN / join strategy.
  5. Output file counts (small files).
  6. Then executor memory, parallelism, cluster size.

One change at a time. Otherwise you cannot tell what helped.

Broadcast vs shuffle join

Broadcast join Copy the small side to every executor. Do not shuffle the large side. Small tablefits in executor memory Executor 1 Executor 2 Executor 3 Large table stays localno shuffle of fact sideEvidence: size in EXPLAIN / Spark UI, not 'I think products is small'. A 20 GB 'small' table will OOM executors. What evidence justifies a broadcast?
Broadcast join

Broadcast when the build side fits in executor memory with evidence (size in UI / stats), not because “products feels small.” A 15 GB dimension will OOM every executor.

Skew

Data skew One key owns the stage. More nodes will not save a 40% hot key. Hot keyone task 40% of bytes Symptomstraggler; others idle Fixespre-agg, salt, AQE skew join, broadcastConfirm first: Spark UI task duration histogram, record counts per key, not a guess.Salting without measuring creates a new shuffle and a messier grain. Measure, then pick one fix. How do you confirm skew before salting?
Hot key straggler

Confirm: one task owns tens of percent of the stage. Fixes: filter the hot key and treat it separately, pre-aggregate, salt with a plan to un-salt, AQE skew join if your Spark version actually does it. Salting just to look busy creates a new grain.

Writes

  • Partition by event_date (the filter you run).
  • Target 128–512 MB files; coalesce/repartition before write if you just exploded partitions.
  • Dynamic partition overwrite for the dates you computed, not the whole table.
  • Compaction (bin-pack / Iceberg rewrite) is a scheduled step.

Weak vs strong answer

WeakStrong
“I’d increase executors.”“The stage is skewed on country='US'; I’d split that key.”
“I’ll broadcast everything.”“Broadcast needs a size proof.”

COMMON MISTAKE: repartition(col) before a join that already shuffles on col — extra shuffle, same skew.

SENIOR-LEVEL EXPECTATION: File counts, AQE on/off as an observed toggle, and a rollback if the “fix” made shuffle worse.

You will

  • Choose Parquet vs JSON for an interview scenario
  • Name detection, quarantine, and backfill steps out loud

Pipelines and storage12 min

Pipelines and storage

Pipelines and storage

In one sentence: Layout, file format, and write mode are the architecture. The orchestrator brand is not.

Bronze / Silver / Gold A convention for quality bars — not a religion and not required names. Bronzeraw, immutable, replayable Silvertyped, de-duped, quarantined Goldgrain + metrics + contractSilver: valid types, keys present, duplicates handled. Gold: business definitions (net GMV) and blocking quality gates.If bronze is mutable, you cannot prove what landed yesterday. That fails interviews and audits. What quality bar belongs in Silver vs Gold?
Bronze, silver, gold

Read the diagram, then say: Bronze is immutable raw. Silver is typed and quarantined. Gold is the grain finance signed, behind a gate.

File format

Row vs columnar storage Analytics usually read few columns over many rows. Row (CSV / JSON / OLTP)A,B,C,D then next record — great for point lookup Columnar (Parquet / ORC)All A, then all B — compression + column pruneGold tables: Parquet (or Iceberg/Delta on Parquet). Bronze landing: keep the original bytes, even if JSON.Athena bills bytes scanned. SELECT * on a wide Parquet table is an expensive habit. Why does Parquet compress better than CSV?
Row vs columnar

Landing: keep the source bytes (JSON/CSV/Avro). Gold: Parquet (column prune, compression). CSV as gold is a weak answer unless a consumer contract forces it.

Lakehouse Table formats add transactions, schema evolution, and time travel on object storage. FilesParquet on S3 Table formatIceberg / Delta / Hudi EnginesSpark, Athena, TrinoThey solve concurrent writes, hidden partitions, and 'who overwrote yesterday'. They do not replace quality gates.Interview: I pick one format per lake and I do not mix Delta and Iceberg on the same table family without a reason. What problem do Iceberg/Delta/Hudi solve?
Lake vs warehouse vs lakehouse

Table formats (Iceberg/Delta/Hudi) add transactions and time travel on the lake. They do not replace quality gates or partitioning discipline.

Batch vs stream

Batch vs streaming SLA decides. Streaming is not a seniority badge. BatchBounded, replayable, cheaper StreamingUnbounded, state, watermark Ask firstWhat latency does the decision need?Finance close and daily GMV: batch. Fraud hold at checkout: stream. 15-minute dashboard: often micro-batch.If they cannot name a consumer SLA, do not design Kafka. What business latency requires a stream?
SLA decides batch vs stream

If the decision can wait for the next hour, batch (or micro-batch) is simpler to replay. Streaming needs watermarks, state, and a rewind story.

Write modes

Idempotent partition overwrite A retry must replace the same business keys, not insert a second identity. Retry 1 and retry 2write to tmp/ then os.replace or overwrite event_date=2026-09-09 Anti-patternINSERT + uuid4() on every retryCounts after two runs of the same date stay equal. That is the demo you run in the lab and the sentence you say in the mock.Staging then swap avoids a reader seeing a half-written folder. Dynamic partition overwrite must be scoped — not overwrite the whole table. How do you prove a pipeline is idempotent?
Idempotent overwrite

Partition overwrite for daily grains. MERGE for CDC Type-2. Append-only logs in bronze. Mixing those three without saying which dataset uses which is how duplicates appear.

Weak vs strong answer

WeakStrong
“Medallion architecture.”“Bronze immutable, silver valid, gold contracted — here is the gate.”
“We’ll use Kafka for everything.”“SLA is T+1; I’ll batch off S3 and keep Kafka for the 2-second fraud path only.”

COMMON MISTAKE: Mutable bronze “to save storage.” You cannot replay.

SENIOR-LEVEL EXPECTATION: Partition columns, target file size, and a backfill that cannot smash today’s partition.

AWS data map12 min

AWS data map

AWS data engineering map

In one sentence: Name the constraint first — bytes scanned, job bound, replay, PII — then the service. Listing every AWS analytics product is not an architecture.

AWS batch pipeline Default interview shape: S3 + Glue + Catalog + Athena. Cost is bytes scanned. S3 rawimmutable Glue Sparkor EMR if needed S3 Parquetpartitioned Glue catalog Athenaworkgroup limitsKeep Athena cheap: columnar, partition prune, project columns, scan limits in workgroups.Glue vs EMR: Glue for bounded Spark jobs; EMR when you need cluster control, long-lived, or mixed engines. How do you keep Athena scans cheap?
AWS batch: S3 → Glue → Parquet → catalog → Athena

Read the diagram, then say: Default batch is S3 + Glue Spark + Glue catalog + Athena workgroups. I prune partitions and columns because Athena bills bytes scanned.

Glue vs EMR

Glue vs EMR Name the constraint, then the service. Do not recite a catalog. Glueserverless Spark, bounded jobs, less cluster ops EMRyou need cluster control, mixed engines, long-livedDefault interview batch: Glue + S3 + Athena. Move to EMR when startup, custom AMI, high shuffle, or Spark + Hive + Presto on one fleet matters.Cost trap: idle EMR. Cost trap: Glue DPU overprovision with tiny files. Both are operational answers, not brand loyalty. When is EMR the better interview answer than Glue?
Glue vs EMR
Choose Glue whenChoose EMR when
Bounded Spark jobs, little cluster babysittingLong-lived clusters, custom AMI, mixed engines
You want job-level billingShuffle-heavy jobs that need instance family control
Interview default for nightly lakesYou can explain idle-cost and autoscaling

Step Functions or MWAA (Airflow) orchestrate. They are not transforms. Lambda is for small payloads, not 200 GB Spark.

Streaming (when the SLA actually needs it)

AWS streaming pipeline Replay is a requirement. A firehose you cannot rewind is a trap. Producer Kinesisretention window ProcessorLambda / Flink / Spark S3 curated + checkpointidempotent sinkReplay a bad hour: stop sink, reset checkpoint/offset, overwrite the date partition, recon counts.If retention is 24h and you discover the bug on day 3, you needed bronze files or a longer log. How do you replay a bad hour of events?
Kinesis path with rewind

Kinesis retention is finite. If you must replay last week, you needed S3 bronze or longer retention. Firehose without a lake copy is a one-way door.

Cost sentences that score

  • Athena: workgroup bytes scanned limits, columnar gold, no SELECT *.
  • S3: lifecycle on raw, intelligent tiering with care for tiny files.
  • Glue: DPU × time; tiny files inflate both.
  • Idle EMR: the classic bill shock. Destroy lab clusters.

IAM, KMS, and Lake Formation are part of the design, not an appendix. PII columns do not ride in the same world-readable bucket as clickstream.

Weak vs strong answer

WeakStrong
“I’d use Redshift, Glue, EMR, and Kinesis.”“Batch lake on S3/Glue/Athena; stream only the fraud topic.”
“Athena is free because it’s serverless.”“Athena is bytes scanned; I partition and project.”

COMMON MISTAKE: Putting the data lake and the query engine in the same breath as “we’ll just EMR it” for a 5 GB job.

SENIOR-LEVEL EXPECTATION: Workgroup limits, Glue vs EMR constraint, and a destroy/cleanup story for anything you provision.

Quality and governance11 min

Quality and governance

Quality and governance

In one sentence: If a contract cannot block a publish, it is just a write-up. Finance needs a gate.

Data quality flow Warnings without a gate do not protect finance. Checksnull, unique, freshness, recon Passpublish gold Failblock + quarantine Observeowner, SLO, lineage, ticketBlock uniqueness and not-null on grain keys. Warn on volume drift. Page on freshness SLO miss for a revenue table. Which checks should block the pipeline?
Quality: pass publishes, fail quarantines

Read the diagram, then say: Uniqueness and not-null on the grain block. Volume drift warns. Freshness SLO misses page.

What to check (minimum)

CheckTypical action
Grain unique (order_item_id)Block
Not-null on keys, amountsBlock
Referential (sku exists)Block or quarantine row
Freshness vs SLAPage
Row count vs yesterday ± N%Warn, then human
Recon to source checksumBlock gold if finance table
Data lineage A wrong KPI is a path, not a mystery. orders.json silver_orders gold_order_items finance_gmv_dailythe number on the slideWalk the path: which join exploded? which filter dropped cancelled? which Type-2 missed valid time?If you cannot name producers and consumers, you cannot estimate blast radius. How do you debug a wrong KPI using lineage?
Lineage from file to KPI

When GMV is wrong, walk bronze → silver → gold → dashboard. The bug is usually a join explosion, a cancelled-order filter, or a Type-2 miss — not “Athena is broken.”

PII and deletes

Classify columns. Tokenize or hash what you must store. Column-level security; no SELECT * dumps into Slack. GDPR/CCPA delete is a pipeline (find, tombstone or rewrite, prove), not a one-off SQL in prod.

Ownership

Every gold table has an owner, an SLO, and a runbook. “The data team” is not an owner.

Weak vs strong answer

WeakStrong
“We have Great Expectations.”“These four checks block publish; here is who gets the page.”
“Quality is downstream.”“Gold does not move until the gate passes.”

COMMON MISTAKE: Quarantine folder that nobody queries. If nobody looks at it, you just deleted the rows with extra steps.

SENIOR-LEVEL EXPECTATION: Severity matrix, recon query, and a legal delete path.

Download the full lab (all code)

Local AWS-shaped data pipeline: generate dirty data, validate, quarantine, curate Parquet, quality-check, and backfill. Unzip and run python3 pipeline/run.py locally. BayLearn does not execute candidate AWS accounts.

Download de-aws-data-pipeline-lab.zip

You will

  • Run the local lab path without AWS credentials
  • Prove an idempotent rerun and a date-scoped backfill

Lab 501 — AWS data pipeline (LAB-DE-501)35 min

Lab 501 — AWS data pipeline (LAB-DE-501)

AWS pipeline lab walkthrough

In one sentence: Prove a dirty day can be ingested, quarantined, curated, quality-checked, rerun, and backfilled — on your laptop — without an AWS bill.

Lab architecture (LAB-DE-501) Required path is local Python. AWS is optional and must be destroyed. Local enginegenerate → validate → quarantine → Parquet Optional AWSS3, KMS, Glue catalog, Athena Not in 4 hoursEMR, MSK, Redshift — docs onlyProve: dirty data in, invalid rows quarantined, curated counts stable on rerun, backfill scoped by date.Cost: no idle Glue/EMR. terraform destroy when finished. Tag everything. What is the cheapest correct default lab?
Lab: local required, AWS optional

Read the diagram, then say: The scoring path is local Python. Glue/Athena are optional. EMR and Redshift are documentation, not the four-hour lab.

Local path (required)

bash

cd labs/aws-data-pipeline
python3 pipeline/run.py --date 2026-09-09
python3 -m pytest -q

What you should be able to point at in the output tree:

  1. Raw preserved — generated files with duplicates, missing ids, bad amounts.
  2. Quarantine — invalid rows with reason + run_id.
  3. Curated Parquet — partitioned by date.
  4. Quality — checks that would block a gold publish.
  5. Idempotent rerun — second run of the same date, stable counts.
  6. Backfill — --backfill-start / --backfill-end without rewriting unrelated dates.
End-to-end data pipeline Quarantine bad rows. Keep bronze immutable. Serve only after a quality gate. Source Ingest Bronzeimmutable raw Quarantinereason + run_id Silver Gold ServeInterview: bronze is the audit trail. Gold is the contract. Quarantine is not a deleted folder.Write path: validate → reject invalid → transform survivors → quality gate → publish. Where does quarantine belong? What is immutable?
Quarantine on the end-to-end path

Optional AWS

Copy terraform/terraform.tfvars.example, unique name_prefix, terraform apply, upload raw, run jobs/glue_transform.py on Glue 5.1 (Spark 3.5.6 / Python 3.11) or locally if you have PySpark, query Athena (sql/analytics.sql), then `terraform destroy`. Tag everything. Do not leave jobs running.

Streaming and warehouse extensions are markdown in the lab folder. They are interview talking points, not required clicks.

How to narrate it in the mock

“I generate dirty data so validation is visible. Invalid rows never silently drop. Curated output is a date partition I can overwrite. I prove retry with counts. I backfill a closed range. If we had AWS, Glue would replace the Spark step; Athena would serve SQL; cost is bytes and DPUs, so I destroy the stack.”

COMMON MISTAKE: Spending the lab hour on Terraform while the local pipeline never ran.

SENIOR-LEVEL EXPECTATION: Show quarantine rows, two-run equality, and a destroy plan before you mention EMR.

Lab README

Lab README

AWS Data Pipeline Lab

Cost warning: Default path is local Python on a tiny synthetic dataset. Optional AWS uses on-demand Glue/Athena and a short-lived S3 lake. Do not leave jobs or optional EMR clusters running. Tag everything. Destroy Terraform when finished.

Architecture

text

Batch Files → S3 Raw → Glue/PySpark transform → S3 Validated/Curated (Parquet)
                                         → Glue Catalog → Athena

Cross-cutting: IAM, KMS, CloudWatch, data quality, quarantine.

Local (required)

bash

cd labs/aws-data-pipeline
python3 pipeline/run.py --date 2026-09-09
python3 -m pytest -q

This generates customers.csv, products.csv, orders.json, order_items.json, order_events.json with duplicates, missing customer IDs, invalid amounts, unknown products, malformed timestamps, late events, and schema variation. Raw data is preserved. Invalid rows go to quarantine/ with source, record id, reason, timestamp, and run ID.

Rerun the same date: partition overwrite keeps output counts stable.

Backfill:

bash

python3 pipeline/run.py --backfill-start 2026-09-08 --backfill-end 2026-09-10

Optional AWS

  1. Copy terraform/terraform.tfvars.example to terraform.tfvars and set a unique name_prefix.
  2. terraform init && terraform apply
  3. Upload lake/raw to s3://$BUCKET/raw/
  4. Run jobs/glue_transform.py on Glue 5.1 (Spark 3.5.6 / Python 3.11) or locally if you have PySpark.
  5. Query with Athena (see sql/analytics.sql).
  6. terraform destroy

EMR is optional and not the default because cluster cost is meaningful.

Interview follow-ups

Why preserve raw? Why Parquet? Why this partition? Small files? Safe rerun? Duplicates? Schema evolution? Quarantine? One-month backfill? Correctness checks? When is Spark unnecessary? Shuffle? Skew? Broadcast? Late events? Streaming? Freshness? PII? BI serving? Warehouse? Athena cost? Partial failure? 100× volume?

Cleanup

Cleanup

Cleanup

Resources this lab may create:

  • S3 lake bucket (raw / validated / curated / quarantine / athena-results)
  • KMS key
  • Glue database, optional crawler, optional job
  • Athena workgroup
  • IAM role/policy for Glue
  • Optional Kinesis stream (streaming extension)
  • Optional Redshift workgroup/cluster (warehouse extension — do not enable by default)

bash

cd labs/aws-data-pipeline/terraform
terraform destroy -auto-approve
aws s3 rm s3://YOUR_BUCKET --recursive   # only if destroy did not empty it

Stop Glue jobs in the console if a run is still active. Delete sample prefixes under raw/ if you uploaded data outside Terraform.

Expected cost drivers: Athena bytes scanned, Glue DPU-hours, S3 PUT/GET, optional Kinesis shard-hours, optional Redshift. Default local lab cost is $0.

Streaming extension

Streaming extension

Streaming extension (optional, advanced)

text

Order Event → Kinesis → Processor → S3 → Curated streaming dataset

Discuss in interview: ordering per partition key, checkpoints, duplicates, late events, replay.

Do not enable enable_streaming in Terraform unless the instructor asks. A single Kinesis shard left running is an avoidable cost.

Candidate talking points:

  • Use order_id as partition key if you need per-order ordering.
  • Checkpoint the iterator in the consumer.
  • Deduplicate with an event id + TTL store.
  • Late events update Silver with a watermark, then reconcile Gold.
  • Replay from retained stream or from immutable raw.

Warehouse extension

Warehouse extension

Warehouse extension (optional)

text

Curated S3 → Redshift (COPY or Spectrum) → BI

Add a warehouse when concurrent BI users need governed SQL, workload management, and predictable latency that a lake + Athena path does not provide.

Keep enable_redshift = false unless the instructor provisions a short-lived serverless workgroup. Always-on clusters are out of scope for the default 4-hour lab.

Interview: distribution/sort keys at a high level, COPY from Parquet, Spectrum for external data, and cost of poorly selective scans.

Read the lab source

Same files as the zip. Open one at a time — map the function to the interview sentence.

Pipeline runner

python

"""Local production-style ecommerce data pipeline (no AWS required)."""

from __future__ import annotations

import argparse
import json
import shutil
import sys
from datetime import datetime, timezone
from pathlib import Path

ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT))

from pipeline import generate_data, quality, transform, validate  # noqa: E402
from pipeline.parquet_io import write_records  # noqa: E402


def run(process_date: str, lake: Path, run_id: str | None = None) -> dict:
    run_id = run_id or datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
    raw = lake / "raw" / f"dt={process_date}"
    validated = lake / "validated" / f"dt={process_date}"
    quarantine = lake / "quarantine" / f"dt={process_date}"
    curated = lake / "curated" / "orders"
    quality_dir = lake / "quality" / f"dt={process_date}"
    registry = lake / "ops" / "processed_inputs.json"

    generate_data.write_raw(raw, process_date)
    valid_rows, rejects = validate.validate_orders(raw, run_id=run_id)
    validate.write_split(validated, quarantine, valid_rows, rejects, run_id)
    curated_rows = transform.curate(valid_rows, raw)
    year, month, day = process_date.split("-")
    partition = curated / f"year={year}" / f"month={month}" / f"day={day}"
    if partition.exists():
        shutil.rmtree(partition)
    write_records(partition / "orders.parquet", curated_rows)
    checks = quality.run_checks(curated_rows, valid_rows, rejects)
    quality_dir.mkdir(parents=True, exist_ok=True)
    (quality_dir / "results.json").write_text(json.dumps(checks, indent=2) + "\n")

    registry.parent.mkdir(parents=True, exist_ok=True)
    seen = []
    if registry.exists():
        seen = json.loads(registry.read_text())
    identity = f"orders.json|{process_date}|{run_id}"
    if identity not in [row.get("id") for row in seen]:
        seen.append({"id": identity, "date": process_date, "run_id": run_id, "output_records": len(curated_rows)})
        registry.write_text(json.dumps(seen, indent=2) + "\n")

    summary = {
        "run_id": run_id,
        "process_date": process_date,
        "input_records": len(valid_rows) + len(rejects),
        "valid_records": len(valid_rows),
        "rejected_records": len(rejects),
        "output_records": len(curated_rows),
        "quality": checks,
        "partition": str(partition),
    }
    print(json.dumps(summary, indent=2))
    if checks["blocking_failures"]:
        raise SystemExit("Data-quality blocking checks failed.")
    return summary


def backfill(start: str, end: str, lake: Path) -> None:
    from datetime import date, timedelta

    cur = date.fromisoformat(start)
    last = date.fromisoformat(end)
    while cur <= last:
        run(cur.isoformat(), lake)
        cur += timedelta(days=1)


def main() -> None:
    parser = argparse.ArgumentParser(description="BayLearn DE pipeline lab")
    parser.add_argument("--date", default="2026-09-09")
    parser.add_argument("--lake", default=str(ROOT / "lake"))
    parser.add_argument("--backfill-start")
    parser.add_argument("--backfill-end")
    parser.add_argument("--run-id")
    args = parser.parse_args()
    lake = Path(args.lake)
    if args.backfill_start and args.backfill_end:
        backfill(args.backfill_start, args.backfill_end, lake)
        return
    run(args.date, lake, args.run_id)


if __name__ == "__main__":
    main()

You will

  • Sit a 45–60 minute mock
  • Leave with a weighted score and 7-day plan

Mock interview brief5 min

Mock interview brief

Mock interview brief

In one sentence: The mock is a scored rehearsal against the Data Engineering rubric. It is not a hiring decision and not a Spark certification.

DATA troubleshooting A green DAG is not correctness. Wrong totals are an incident. DDetermine impact AAnalyze signals TTrace transforms AApply + assureImpact: which dashboard, which dates, money vs delay vs privacy. Then Spark UI / Athena bytes / lag / row counts.Mitigation without recon is a second incident. Checksums and COUNT DISTINCT grain close the loop. What is the first sentence in a data SEV-1?
DATA troubleshooting spine

Read the diagram, then say: If they inject an incident, I start with impact (who, which dates, money vs delay), then signals, then lineage, then a fix I can prove.

Modes

The instructor picks one (or mixes):

ModeEmphasis
Data EngineerSQL + pipeline correctness
Senior Data EngineerSpark + idempotency + quality
Cloud Data EngineerAWS map + cost + IAM
Data Platform Engineercontracts, backfills, multi-team
Lead Data Engineertrade-offs, stakeholders, 7-day plan

Weighted rubric (0–100 from 1–5 scores): SQL 18, Python 8, Modeling 10, Spark 18, Pipeline 12, AWS 10, Reliability 8, System Design 8, Troubleshooting 5, Communication 3.

How to speak (D-PIPE then DATA)

D-PIPE framework BayLearn data system-design spine. Use it on the 1 TB/day + 15-minute prompt. DDefine decisions + grain PProfile volume + quality IIngest + isolate bronze PProcess + persist EExpose + ensure qualityStart with who decides what, at which grain, with which SLA. Tools come last.Then DATA for incidents: Determine impact, Analyze signals, Trace transforms, Apply + Assure. What does the first D in D-PIPE force you to say out loud?
D-PIPE
  1. Define the decision, grain, SLA.
  2. Profile volume and dirt.
  3. Ingest immutable bronze + quarantine.
  4. Process with an idempotent write.
  5. Expose behind a gate.

If it is on fire: Determine impact → Analyze signals → Trace transforms → Apply and recon.

Timing

~45–60 minutes. Think out loud. When you do not know a service, say the constraint you would look up — do not invent APIs.

Bring: readiness weak skills, one SQL you can write on a whiteboard, one Spark UI story, the lab overwrite sentence.

This resource is rehearsal material for BayLearn. A practice score here does not predict hiring.

Mock process10 min

Mock process

Mock interview brief

In one sentence: The mock is a scored rehearsal against the Data Engineering rubric. It is not a hiring decision and not a Spark certification.

DATA troubleshooting A green DAG is not correctness. Wrong totals are an incident. DDetermine impact AAnalyze signals TTrace transforms AApply + assureImpact: which dashboard, which dates, money vs delay vs privacy. Then Spark UI / Athena bytes / lag / row counts.Mitigation without recon is a second incident. Checksums and COUNT DISTINCT grain close the loop. What is the first sentence in a data SEV-1?
DATA troubleshooting spine

Read the diagram, then say: If they inject an incident, I start with impact (who, which dates, money vs delay), then signals, then lineage, then a fix I can prove.

Modes

The instructor picks one (or mixes):

ModeEmphasis
Data EngineerSQL + pipeline correctness
Senior Data EngineerSpark + idempotency + quality
Cloud Data EngineerAWS map + cost + IAM
Data Platform Engineercontracts, backfills, multi-team
Lead Data Engineertrade-offs, stakeholders, 7-day plan

Weighted rubric (0–100 from 1–5 scores): SQL 18, Python 8, Modeling 10, Spark 18, Pipeline 12, AWS 10, Reliability 8, System Design 8, Troubleshooting 5, Communication 3.

How to speak (D-PIPE then DATA)

D-PIPE framework BayLearn data system-design spine. Use it on the 1 TB/day + 15-minute prompt. DDefine decisions + grain PProfile volume + quality IIngest + isolate bronze PProcess + persist EExpose + ensure qualityStart with who decides what, at which grain, with which SLA. Tools come last.Then DATA for incidents: Determine impact, Analyze signals, Trace transforms, Apply + Assure. What does the first D in D-PIPE force you to say out loud?
D-PIPE
  1. Define the decision, grain, SLA.
  2. Profile volume and dirt.
  3. Ingest immutable bronze + quarantine.
  4. Process with an idempotent write.
  5. Expose behind a gate.

If it is on fire: Determine impact → Analyze signals → Trace transforms → Apply and recon.

Timing

~45–60 minutes. Think out loud. When you do not know a service, say the constraint you would look up — do not invent APIs.

Bring: readiness weak skills, one SQL you can write on a whiteboard, one Spark UI story, the lab overwrite sentence.

This resource is rehearsal material for BayLearn. A practice score here does not predict hiring.

You will

  • Read the readiness report
  • Practice the weakest two skills first

Feedback and 7-day plan10 min

Feedback and 7-day plan

Feedback and 7-day plan

In one sentence: Practice the two weakest skills first. A certificate preview is not an industry cert and not a job offer.

Read the scorecard like an engineer

The mock score is a weighted 0–100 from 1–5 dimension scores. It is a rehearsal signal. It does not predict hiring. Pair it with readiness skill bars. If SQL is 40 and Spark is 80, the 7-day plan is joins and Type-2, not another Kafka article.

Seven days (template)

  1. Re-read this sprint’s diagrams for the weak skills. Say the caption sentence out loud.
  2. Ten question-bank items, spoken, no notes.
  3. One timed SQL + one Spark UI story (shuffle vs broadcast).
  4. DATA drill: pick a troubleshooting scenario, write impact → signals → lineage → recon.
  5. Re-run the local lab; screenshot quarantine + two-run counts.
  6. Second mock or a recorded 8-minute D-PIPE design.
  7. Light review only. Sleep. Do not cram services.

Certificate

BayLearn may preview a completion certificate after a scored mock. It states you completed this Interview Sprint. It does not claim AWS certification, Spark certification, or that you will be hired.

If you need depth beyond four hours, that is a Professional Program (for example Cloud-Native Data Engineering on AWS) — a different product on BayLearn, not this weekend package.

Pricing

Choose a delivery mode. BayAreaLa8s invoices after you request a session.

This text is a draft. It is not a current BayLearn offer and it does not change existing bookings. Read the draft refund policy

Self-paced

$59

Small group

$129

Live 1:1

$349

Introductory $299

Book a session

Request a slot. Invoicing is handled by BayAreaLa8s after the request — no Stripe checkout.

Log in or enroll to request a live session time.