AWS Training
Modules Listen Certification

← Data Engineer IV — Role Review

DE4 Interview questions

Read these out loud. Under 90 seconds each. For a level-four role the scoring pattern is consistent: name the seam, give the mechanism, say what you'd check. Anyone can list the services in the posting. The signal is whether you know where they bite each other.


Warm-up

Q. When do you pick Glue over EMR, and when Lambda?

Glue when I want a managed Spark job with a catalog, bookmarks, and nothing to patch — most scheduled ETL lands there. EMR when I need control: a specific Spark build, long-running clusters, instance fleets with Spot, or something that isn't Spark at all. Lambda only when the unit of work is small and bounded, because the fifteen-minute timeout and the ten-gigabyte temp disk aren't adjustable. If I find myself fighting those limits, that's the signal the work belonged in Glue.

Q. What does a job bookmark actually track?

For S3 it's the last-modified time of the files it has seen; for JDBC it's a gapless primary key. The state is written at job.commit(), so if the job dies before commit, the next run re-reads the same input. The thing people miss is that resetting a bookmark doesn't touch the output. So bookmarks only give you correctness if the write side is idempotent — overwrite a partition, or merge on a key. Otherwise a reset means duplicates.

Q. What's the difference between a Kafka Connect connector and a task?

The connector is the configuration and the thing that decides how to split the work. Tasks are the threads that actually move data; a sink with tasks.max of four gets up to four consumers in one group. The operational consequence is that a failed task doesn't rebalance or restart itself — it sits there failed until something restarts it through the REST API. So "connector is running" in a dashboard can be true while a quarter of your partitions are stalled.

Q. What is Athena billing you for?

Bytes scanned, rounded to the nearest megabyte, with a ten-megabyte minimum per query. Failed queries and DDL are free; cancelled ones are not. So every optimisation is really one question: how do I scan less? Columnar formats so you read only the columns you need, compression, and partition pruning so you read only the files you need. The pricing page's own example takes a three-terabyte CSV from fifteen dollars to one and a quarter.

Q. Why is CloudWatch's default missing-data behaviour dangerous for a scheduled job?

Because the default is missing, which means "don't change state". A job that fails publishes a metric and the alarm fires. A job that never started publishes nothing, the alarm sits in insufficient data forever, and nobody is paged. For a pipeline, silence is the failure mode I care about most, so I either treat missing as breaching on a heartbeat metric, or I alert from the scheduler side with an EventBridge rule.

Q. Why do you commit the Terraform lock file?

It pins provider versions by hash so everyone — and CI — resolves exactly the same provider. Without it, two engineers can run plan on the same config and get different diffs because they pulled different provider releases. If we build on more than one platform, I pre-populate the hashes with providers lock for each platform so the file doesn't churn.


Depth

Q. Walk me through how a Connect partitioner ends up affecting an Athena bill.

The sink's partitioner decides the S3 key layout. A time-based partitioner writes dt=2026-10-30/ style prefixes; the default wallclock extractor uses the worker's clock, a field extractor uses a value in the record. Athena prunes on exactly those prefixes, so if the layout matches how analysts filter — usually event date — most queries touch a fraction of the data. If I partition on wallclock but people filter on event time, late-arriving events land in the wrong prefix and the queries either miss them or scan everything to be safe.

Follow-up they ask next: "And exactly-once?" — Exactly-once on the S3 sink needs a deterministic partitioner, and the wallclock extractor is the default and isn't deterministic. Turning on scheduled rotation also invalidates it. So the choice that makes Athena cheap is the same choice that makes the sink exactly-once; that's not a coincidence, both need the file boundaries to be a pure function of the data.

Q. The Glue job ran fine yesterday; today it fails on start with a concurrency exception. What happened?

MaxConcurrentRuns defaults to one. Yesterday's run finished before today's schedule fired; today it didn't — maybe more data, maybe a slow source — and the scheduler tried to start a second run. The exception is the symptom. The question I'd ask is why the run got slower, because raising the concurrency limit just lets two runs fight over the same input and, with bookmarks, risks double-processing.

Follow-up: "Did your alarm catch it?" — Only if I alerted on the state-change event. The failed start never becomes a job run, so it publishes no job metrics. That's why I pair the metric alarm with the EventBridge rule and alert on the scheduler's failure too.

Q. Explain the layers a query passes through before Lake Formation lets it read a column.

Two systems, both must say yes. IAM first: the principal needs the Glue and S3 permissions, and if the location is registered, the registered role is what actually touches S3. Then Lake Formation: the database, table, and column grants, plus any data filter. And there's a trap on a new account: IAMAllowedPrincipals holds Super on everything, which means your fine-grained grants aren't in effect until you remove it.

Follow-up: "Where do you look first when a grant 'doesn't work'?" — list-permissions on the resource to check for that default, then the IAM side with the policy simulator, then whether the location is registered with a role the admin could pass. In that order, because the first one is the cause nine times out of ten.

Q. What makes a Redshift query slow that wouldn't be slow in Postgres?

Distribution and sort. If the join key isn't the distribution key, every row ships across the cluster before the join. If the filter column isn't in the sort key, the zone maps can't skip blocks and you read the whole table. Then WLM: the query may be fine and just queued, and in manual WLM you only get fifty slots across all queues, which isn't adjustable. My checklist is: queue time versus execution time from the system tables, then the explain plan for broadcast or redistribution, then the table's distribution style and sort key against the query's actual predicates.

Follow-up: "Why not just enable concurrency scaling?" — It helps queueing, not bad plans, and it won't touch a table with an interleaved sort key at all.

Q. How do you lay out Terraform for dev, test, and prod on this stack?

Directory per environment with a shared module, not workspaces. The docs say workspaces aren't appropriate where environments need separate credentials, and prod does. Each environment has its own state key, S3 locking with use_lockfile, and its own role that CI assumes through OIDC. The module is where the Glue job, the alarm, the KMS key, and the Lake Formation grant live, so the only difference between environments is the variables file.

Follow-up: "What stops someone applying from their laptop?" — Nothing technical except the role trust policy. The CI role's trust is conditioned on the repository's sub claim, so a laptop can't assume it. That's the control; code review is the second one.

Q. Your S3 writes start failing with KMS throttling. What do you do?

First, confirm which account is being throttled, because cross-account calls count against the caller. Then look at whether Bucket Keys are on: without them every object is a KMS request, with them it's a per-bucket data key and the docs claim up to ninety-nine percent fewer requests. The request quota itself is adjustable, so a raise is an option — but Bucket Keys usually make the raise unnecessary, and they only apply to new objects, so I'd expect the error rate to fall as the old objects stop being rewritten.

Follow-up: "Any catch with Bucket Keys?" — Cached requests skip the key-policy check, so a key policy change takes effect later than you expect. And they don't apply to dual-layer encryption.

Q. It depends — a stakeholder asks for "real-time" dashboards from the Kafka topics. What do you ask before designing anything?

What "real-time" means in seconds, because a minute changes the design completely. Whether they need every event or an aggregate. Whether the data has late arrivals and how late. And who's paying for the query side — streaming into S3 and querying with Athena is cheap at rest and expensive per query, Redshift is the reverse. I wouldn't pick a sink until I had those four answers, and I'd say that in the room, because the wrong answer here is the confident one.


Design

Q. Design the pipeline for this posting: CDC from Postgres, enriched nightly, queryable by analysts, governed.

Requirements first. CDC means change events, not snapshots, so the raw layer is append-only and keyed by primary key. Analysts query by date and by customer. Governance means some columns are restricted and some analysts see only their region.

The streaming side. Confluent's Postgres CDC source using pgoutput, one task — that's a hard limit — into one topic per table, keyed on the primary key so updates to a row stay ordered. S3 sink with a time-based partitioner on the event timestamp, not wallclock, writing Parquet with Schema Registry handling the Avro-to-Parquet step. Flush size tuned so files are large enough for Athena but under a few minutes of latency. Dead-letter queue on, with headers enabled so I can see why a record failed.

The batch side. A Glue job, bookmarks on, that reads yesterday's partition and merges into an Iceberg table in the catalog — merge, so a bookmark reset can't duplicate. Scheduled by EventBridge, concurrency left at one, and both a failure alarm and a state-change rule on it.

Query. Athena over the Iceberg table for ad hoc; a scheduled OPTIMIZE so the small files from the sink don't pile up. If the analysts' workload becomes steady dashboards, that's when I'd talk about Redshift, not before.

Governance. IAMAllowedPrincipals removed on day one. LF-tags for the restricted columns, a data filter per region on SELECT, and the analysts' role has nothing on S3 directly — only the registered role touches the buckets. SSE-KMS with Bucket Keys, one customer-managed key for the lake.

Infrastructure. All of it in Terraform, directory per environment, OIDC from CI.

What I'd monitor. Connector task state and DLQ rate; consumer lag; Glue job events and duration against a baseline; Athena bytes scanned per workgroup with a cutoff; KMS throttles.


Debug

Q. The nightly Glue job succeeded, but the analysts say yesterday's numbers are missing. What do you check?

  1. The job run's StartedOn and CompletedOn against the partition it was supposed to read — did it run before the sink finished writing yesterday?
  2. The bookmark state. If someone reset it, or the files were rewritten by the sink's rotation, the job may have read a partial partition.
  3. The S3 prefix itself: are there files for yesterday, and are they under the partition value the job filters on? A wallclock partitioner near midnight puts late events in the wrong day.
  4. The DLQ topic. A schema change that failed conversion doesn't stop the connector with errors.tolerance = all; it just siphons the records.
  5. Only then the job code.

Q. The analyst can't query a table in Athena; the error mentions Lake Formation. Checklist?

  1. list-permissions on the table: is there a grant to their role, and is IAMAllowedPrincipals still Super on it, which would mean the grant model isn't even in effect the way we think?
  2. The IAM side: policy simulator for Glue get-table and Athena on the role.
  3. Is the S3 location registered, and with which role? If it's not registered, LF isn't governing it and IAM on S3 is the denial.
  4. Cross-account? Then it's a RAM share and a resource link, and the link is what's usually missing.
  5. Region. LF permissions are per Region; the grant may be in the wrong one.

Q. CI's Terraform plan shows it wants to recreate the KMS key. Nobody changed the key. What now?

  1. Stop. A recreate on a KMS key means every object encrypted under it becomes unreadable once the old key is deleted. Don't apply.
  2. Read the plan for why — which argument forces replacement. Usually it's a change that can't be done in place, or the resource was imported with a different address.
  3. Check whether someone applied from outside CI; the state may describe a key that was replaced by hand.
  4. If it's an address change, write a moved block. If it's a real replacement, prevent_destroy on the key should have blocked this — check it's set, and remember it doesn't protect a resource whose block was deleted.
  5. Only once the plan shows no replacement does it get applied.

Red flags