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
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.
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
| Module | Minutes | What you should be able to teach back |
|---|---|---|
| 0 Readiness | 15 | Nine skill scores, not a hiring prediction |
| 1 SQL + modeling | 40 | Joins, windows, NULLs, star grain, SCD Type 2 |
| 2 Python | 30 | Bounded memory, validation, idempotent writes |
| 3 Spark | 45 | Driver vs executors, shuffle, skew, broadcast |
| 4 Pipelines + AWS | 40 | Medallion, Parquet, Glue vs EMR, quality gates |
| 5 Lab | 35 | Local pipeline: quarantine, overwrite, backfill |
| 6 Mock | 45–60 | Scored rehearsal in one of five role modes |
| 7 Feedback | 10 | Weakest two skills and a 7-day plan |
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:
- a consumer SLA,
- a fact grain,
- a join explosion check,
- an idempotent write,
- 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.
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
| Module | Minutes | What you should be able to teach back |
|---|---|---|
| 0 Readiness | 15 | Nine skill scores, not a hiring prediction |
| 1 SQL + modeling | 40 | Joins, windows, NULLs, star grain, SCD Type 2 |
| 2 Python | 30 | Bounded memory, validation, idempotent writes |
| 3 Spark | 45 | Driver vs executors, shuffle, skew, broadcast |
| 4 Pipelines + AWS | 40 | Medallion, Parquet, Glue vs EMR, quality gates |
| 5 Lab | 35 | Local pipeline: quarantine, overwrite, backfill |
| 6 Mock | 45–60 | Scored rehearsal in one of five role modes |
| 7 Feedback | 10 | Weakest two skills and a 7-day plan |
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:
- a consumer SLA,
- a fact grain,
- a join explosion check,
- an idempotent write,
- 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.
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
- Read How the assessment works.
- Take the assessment.
- 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
| Skill | What a strong answer sounds like |
|---|---|
| SQL | Grain, WHERE vs HAVING, windows, anti-joins |
| Python | Generators, validation, no uuid4-on-retry |
| Data modeling | Fact grain first, then dimensions |
| Spark | Shuffle vs broadcast, skew evidence |
| Pipeline architecture | Idempotent overwrite, backfill scope |
| AWS | S3 layout, Glue vs EMR, Athena bytes |
| Reliability | Replay, late data policy |
| Data quality | Blocking vs warning gates |
| Troubleshooting | DATA: 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.
- Keep only delivered orders before summing revenue.
- Keep countries whose SUM(revenue) exceeds 10,000.
- Keep customers whose COUNT(*) of orders is at least 3 after grouping.
- 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.
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 grainCustomers 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
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
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
| Weak | Strong |
|---|---|
| “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 = trueon 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.
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_gmvLAST_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
| Pattern | Window sketch |
|---|---|
| Days between orders | LAG(order_ts) OVER (PARTITION BY customer_id ORDER BY order_ts) |
| Percent of category | gmv / SUM(gmv) OVER (PARTITION BY category) |
| Sessionize | gap vs LAG > 30 minutes → new session_id |
| Dedup events | ROW_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
| Weak | Strong |
|---|---|
| “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 DESCwith timestamp collisions and no unique id — Monday’s gold disagrees with Tuesday’s gold.
SENIOR-LEVEL EXPECTATION: Name
ROWSvsRANGE, 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.
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
);| Expression | What interviewers listen for |
|---|---|
COUNT(*) | Rows, including all-NULL rows |
COUNT(email) | Non-null emails only |
NULL = NULL | UNKNOWN, 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'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
| Weak | Strong |
|---|---|
| “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 (
COUNTvsCOUNT(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.
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 fact | On the dimension |
|---|---|
| qty, gross, discount, net_gmv, tax | product name, category, brand |
degenerate order_id | customer attributes (Type 1 or 2) |
| foreign keys / surrogates | store 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
| Weak | Strong |
|---|---|
| “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_regionon 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?
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 | trueJoin (half-open):
sql
ON d.customer_id = f.customer_id
AND f.event_ts >= d.effective_from
AND f.event_ts < d.effective_tois_current is a convenience for “who are they today.” It is the wrong predicate for historical facts.
CDC apply
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
| Weak | Strong |
|---|---|
| “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
effectiveranges. 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.
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-09UTC 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.
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
| Weak | Strong |
|---|---|
| “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.
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-*.parquetOverwrite that prefix (or MERGE on the business key). Do not INSERT into an ever-growing folder.
Staging:
- Write
.../event_date=2026-09-09/_tmp_<run_id>/ - Quality check
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
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
| Weak | Strong |
|---|---|
| “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=appendplus a newrun_idcolumn 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.
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
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
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
| Weak | Strong |
|---|---|
| “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.memoryas 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.
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)
- Spark UI → longest stage.
- Shuffle read/write bytes.
- Task duration histogram (skew).
EXPLAIN/ join strategy.- Output file counts (small files).
- Then executor memory, parallelism, cluster size.
One change at a time. Otherwise you cannot tell what helped.
Broadcast vs shuffle 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
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/repartitionbefore 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
| Weak | Strong |
|---|---|
| “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 oncol— 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.
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
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.
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
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
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
| Weak | Strong |
|---|---|
| “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.
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
| Choose Glue when | Choose EMR when |
|---|---|
| Bounded Spark jobs, little cluster babysitting | Long-lived clusters, custom AMI, mixed engines |
| You want job-level billing | Shuffle-heavy jobs that need instance family control |
| Interview default for nightly lakes | You 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)
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
| Weak | Strong |
|---|---|
| “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.
Read the diagram, then say: Uniqueness and not-null on the grain block. Volume drift warns. Freshness SLO misses page.
What to check (minimum)
| Check | Typical action |
|---|---|
Grain unique (order_item_id) | Block |
| Not-null on keys, amounts | Block |
| Referential (sku exists) | Block or quarantine row |
| Freshness vs SLA | Page |
| Row count vs yesterday ± N% | Warn, then human |
| Recon to source checksum | Block gold if finance table |
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
| Weak | Strong |
|---|---|
| “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.zipYou 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.
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 -qWhat you should be able to point at in the output tree:
- Raw preserved — generated files with duplicates, missing ids, bad amounts.
- Quarantine — invalid rows with reason + run_id.
- Curated Parquet — partitioned by date.
- Quality — checks that would block a gold publish.
- Idempotent rerun — second run of the same date, stable counts.
- Backfill —
--backfill-start/--backfill-endwithout rewriting unrelated dates.
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 → AthenaCross-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 -qThis 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-10Optional AWS
- Copy
terraform/terraform.tfvars.exampletoterraform.tfvarsand set a uniquename_prefix. terraform init && terraform apply- Upload
lake/rawtos3://$BUCKET/raw/ - Run
jobs/glue_transform.pyon Glue 5.1 (Spark 3.5.6 / Python 3.11) or locally if you have PySpark. - Query with Athena (see
sql/analytics.sql). 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 itStop 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 datasetDiscuss 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_idas 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) → BIAdd 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.
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):
| Mode | Emphasis |
|---|---|
| Data Engineer | SQL + pipeline correctness |
| Senior Data Engineer | Spark + idempotency + quality |
| Cloud Data Engineer | AWS map + cost + IAM |
| Data Platform Engineer | contracts, backfills, multi-team |
| Lead Data Engineer | trade-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)
- Define the decision, grain, SLA.
- Profile volume and dirt.
- Ingest immutable bronze + quarantine.
- Process with an idempotent write.
- 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.
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):
| Mode | Emphasis |
|---|---|
| Data Engineer | SQL + pipeline correctness |
| Senior Data Engineer | Spark + idempotency + quality |
| Cloud Data Engineer | AWS map + cost + IAM |
| Data Platform Engineer | contracts, backfills, multi-team |
| Lead Data Engineer | trade-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)
- Define the decision, grain, SLA.
- Profile volume and dirt.
- Ingest immutable bronze + quarantine.
- Process with an idempotent write.
- 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)
- Re-read this sprint’s diagrams for the weak skills. Say the caption sentence out loud.
- Ten question-bank items, spoken, no notes.
- One timed SQL + one Spark UI story (shuffle vs broadcast).
- DATA drill: pick a troubleshooting scenario, write impact → signals → lineage → recon.
- Re-run the local lab; screenshot quarantine + two-run counts.
- Second mock or a recorded 8-minute D-PIPE design.
- 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
Small group
Live 1:1
$349
Introductory $299
Book a session
Request a slot. Invoicing is handled by BayAreaLa8s after the request — no Stripe checkout.