šŸ” Ctrl+K
šŸŽ™ļø Introduction & Basics • docs/introduction/intro.md • 35 Questions

Introduction & Basics Q&A

Sample self-introduction + project-based, scenario-based and challenge-based questions from your pipeline (Airflow → S3 → Glue → Athena → Redshift → PowerBI).

Source: docs/introduction/intro.md • Answers are hidden — click a question to reveal its full interview answer. Use bookmarks + Mark as Complete to track prep.

šŸŽ™ļø Sample Introduction — always visible • exact copy from docs/introduction/intro.md

SAMPLE INTRODUCTION

Hi, I’m YOUR NAME, based in YOUR WORK LOCATION. I hold a YOUR QUALIFICATION/DEGREE from COLLEGE/UNIVERSITY AND YEAR OF PASSING.

I have EXPERIENCE IN YEARS of experience as a Data Engineer. Currently, I’m working at CURRENT COMPANY, where I’m working on a project called PROJECT NAME. My client, wanted our team to build 6 Dashboards, out of which I was part of 3. First, we had to identify the source of our data which included sources like mysql databases through JDBC connections for Internal data (transactional and customer data), API integrations into google (trends and analytics) and SFTP folders where the flat files landed. We chose Apache Airflow as our orchestration tool and AWS services such as S3 to store both the raw and processed data, Glue as our ETL tool, Athena for serverless querying and Redshift as our data warehouse. Python scripts were used, using libraries to extract data from various sources and Bash Commands to push data into the S3 bucket. We initiated Glue Crawlers to collect metadata and Glue Data Catalog database to store the metadata. Glue jobs were then initiated using Pyspark code to transform the data based on requirement. Athena was integrated as a serverless query engine using SQL queries to check/validate the data. The filtered data was then loaded into the centralized data repository in S3 Transformed Bucket. When the S3 key sensor sensed data in the S3 bucket it signalled the S3 to Redshift Operator to push clean data from the S3 transformed bucket into Redshift Data Lake, from where the data was consumed by our analytical team through PowerBI. I was primarily responsible for writing functions in Apache Airflow, extracting data from the three data sources, writing PySpark code in Glue jobs and writing SQL query in Athena.

There are a few challenges I have faced in my project. One of them is FIRST CHALLENGE AND IT'S SOLUTION. Another challenge that i have faced is SECOND CHALLENGE AND IT'S SOLUTION.

intro.md — exact text (copy)
SAMPLE INTRODUCTION
Hi, I’m YOUR NAME, based in YOUR WORK LOCATION. I hold a YOUR QUALIFICATION/DEGREE from COLLEGE/UNIVERSITY AND YEAR OF PASSING.
I have EXPERIENCE IN YEARS of experience as a Data Engineer. Currently, I’m working at CURRENT COMPANY, where I’m working on a project called PROJECT NAME. My client, wanted our team to build 6 Dashboards, out of which I was part of 3. First, we had to  identify the source of our data which included sources like mysql databases through JDBC connections for Internal data (transactional and customer data), API integrations into google (trends and analytics) and SFTP folders where the flat files landed. We chose Apache Airflow as our orchestration tool and AWS services such as S3 to store both the raw and processed data, Glue as our ETL tool, Athena for serverless querying and Redshift as our data warehouse. Python scripts were used, using libraries to extract data from various sources and Bash Commands to push data into the S3 bucket. We initiated Glue Crawlers to collect metadata and Glue Data Catalog database to store the metadata. Glue jobs were then initiated using Pyspark code to transform the data based on requirement. Athena was integrated as a serverless query engine using SQL queries to check/validate the data. The filtered data was then loaded into the centralized data repository in S3 Transformed Bucket. When the S3 key sensor sensed data in the S3 bucket it signalled the S3 to Redshift Operator to push clean data from the S3 transformed bucket into Redshift Data Lake, from where the data was consumed by our analytical team through PowerBI. I was primarily responsible for writing functions in Apache Airflow, extracting data from the three data sources, writing PySpark code in Glue jobs and writing SQL query in Athena.
There are a few challenges I have faced in my project. One of them is FIRST CHALLENGE AND IT'S SOLUTION. Another challenge that i have faced is SECOND CHALLENGE AND IT'S SOLUTION.

Word-for-word from docs/introduction/intro.md lines 1–4, including CAPS placeholders and original wording/spacing. Fill the CAPS parts with your details before the interview. Tip: end with 2 challenges + solutions — interviewers always ask a follow-up (see Q33–Q34).

šŸ“‹ Table of Contents

Table of Contents — 35 questions

  1. A. Introduction Basics (Q1–Q6) — self-intro, role, ETL vs ELT, architecture pitch, stack choice, intro structure
  2. B. General Project Understanding (Q7–Q11) — architecture + Airflow, S3 raw/transformed, Athena vs Redshift, Glue vs EMR/Lambda, DAG dependencies
  3. C. Extraction — MySQL, API, SFTP (Q12–Q14) — JDBC, Google API auth, SFTP schema changes
  4. D. Transformation — Glue + PySpark (Q15–Q17) — sample transform, Crawlers/Catalog/Athena, Glue retry/recovery
  5. E. Loading — Athena + Redshift (Q18–Q20) — Athena validation, S3-to-Redshift operator, DISTKEY/SORTKEY
  6. F. Scenario-Based (Q21–Q32) — API failure, crawler mismatch, Redshift OOM, 1 TB scale, small files, stale PowerBI, S3 security, PII columns, S3 sensor debug, duplicates, PySpark OOM, S3 partitioning
  7. G. Challenge-Based (Q33–Q35) — challenge 1, challenge 2, rebuild today

A. Introduction Basics (Q1–Q6)

🟢 Beginner
Q1

Tell me about yourself / walk me through your profile?

click to reveal answer
ā–¶

Interview Answer — say exactly this (from intro.md):

Hi, I’m YOUR NAME, based in YOUR WORK LOCATION. I hold a YOUR QUALIFICATION/DEGREE from COLLEGE/UNIVERSITY AND YEAR OF PASSING.

I have EXPERIENCE IN YEARS of experience as a Data Engineer. Currently, I’m working at CURRENT COMPANY, where I’m working on a project called PROJECT NAME. My client, wanted our team to build 6 Dashboards, out of which I was part of 3. First, we had to identify the source of our data which included sources like mysql databases through JDBC connections for Internal data (transactional and customer data), API integrations into google (trends and analytics) and SFTP folders where the flat files landed. We chose Apache Airflow as our orchestration tool and AWS services such as S3 to store both the raw and processed data, Glue as our ETL tool, Athena for serverless querying and Redshift as our data warehouse. Python scripts were used, using libraries to extract data from various sources and Bash Commands to push data into the S3 bucket. We initiated Glue Crawlers to collect metadata and Glue Data Catalog database to store the metadata. Glue jobs were then initiated using Pyspark code to transform the data based on requirement. Athena was integrated as a serverless query engine using SQL queries to check/validate the data. The filtered data was then loaded into the centralized data repository in S3 Transformed Bucket. When the S3 key sensor sensed data in the S3 bucket it signalled the S3 to Redshift Operator to push clean data from the S3 transformed bucket into Redshift Data Lake, from where the data was consumed by our analytical team through PowerBI. I was primarily responsible for writing functions in Apache Airflow, extracting data from the three data sources, writing PySpark code in Glue jobs and writing SQL query in Athena.

There are a few challenges I have faced in my project. One of them is FIRST CHALLENGE AND IT'S SOLUTION. Another challenge that i have faced is SECOND CHALLENGE AND IT'S SOLUTION.

🟢 Beginner
Q2

What does a Data Engineer do? What was your specific role?

click to reveal answer
ā–¶

Interview Answer: A Data Engineer is responsible for making raw data reliable, clean, and easily queryable for analytics. That means ingesting data from different sources, validating it, transforming it into a usable shape, loading it into the right storage, and then orchestrating and monitoring the whole flow.

In this project, my contribution was quite hands-on. I wrote Airflow functions and DAG tasks for extraction and loading, I built the Python extraction logic for all three sources — MySQL over JDBC, the Google APIs, and the SFTP files — and pushed everything into S3. I also wrote the PySpark transformation code inside the Glue jobs, and I wrote the SQL validation queries in Athena that gated the Redshift load. The analytics team then consumed that clean Redshift data directly in PowerBI.

🟢 Beginner
Q3

What is ETL vs ELT? Which did your pipeline use?

click to reveal answer
ā–¶

Interview Answer: ETL means you extract the data, transform it, and only then load it into the warehouse. ELT is the reverse: you load the raw data first and then transform it inside the warehouse or lakehouse.

Our pipeline follows the ETL style, but with a data lake in the middle. We first extract everything into the S3 raw bucket, then we transform it using Glue PySpark jobs and write the clean output to the S3 transformed bucket. Only after that do we load it into Redshift. We also use Athena to query the transformed S3 data for validation, so any bad or incomplete data is caught before it ever reaches PowerBI.

🟔 Intermediate
Q4

Explain your end-to-end pipeline architecture in 2 minutes?

click to reveal answer
ā–¶

Interview Answer: Sure, let me walk you through it from left to right. On the source side, we had three very different inputs: MySQL tables for transactional and customer data, Google Trends and Analytics data coming through APIs, and flat files landing in SFTP folders.

Airflow extracts all three using Python logic — JDBC reads for MySQL, authenticated API calls for Google, and file reads for SFTP — and Bash commands push the output into the S3 raw bucket. From there, Glue Crawlers infer the schema and register it in the Glue Data Catalog. Our Glue PySpark jobs then transform the data and write clean, partitioned output to the S3 transformed bucket. We validate that output with Athena SQL queries, and once it looks good, the S3 Key Sensor triggers the S3-to-Redshift operator, which COPYs the data into Redshift. Finally, the analytical team consumes it in PowerBI. Out of the six dashboards, I personally owned three end to end.

🟔 Intermediate
Q5

Why did you choose Airflow + S3 + Glue + Athena + Redshift + PowerBI?

click to reveal answer
ā–¶

Interview Answer: Each tool was picked for a specific reason. We used Airflow because it is Python-native, so our extraction logic, retries, and sensors all live in one DAG that is easy to monitor. S3 was the natural choice for storage because it is cheap, durable, and it lets us keep the raw and transformed layers separate, which makes replays very easy.

For transformation, we chose Glue because it gives us serverless Spark with Crawlers and the Data Catalog built in, so we could just write PySpark instead of managing clusters. Athena was ideal for validation because it lets us run SQL directly on S3 without loading anything. Redshift works well as the central warehouse for fast BI joins, and PowerBI was already the tool our analytics team used, so it made sense to serve from Redshift straight into PowerBI.

🟢 Beginner
Q6

How do you structure a strong 2-minute introduction?

click to reveal answer
ā–¶

Interview Answer: I follow a simple structure: present, past, project, role, and then challenges. First, I give my name, location, and degree. Then I mention my years of experience as a Data Engineer and my current company.

After that, I describe the project in one flow: we had to build six dashboards, I owned three, here were the three sources, here is how Airflow, S3, Glue, Athena, Redshift, and PowerBI fit together — just one line per system. Then I clearly state what I personally did: the Airflow functions, the three-source extraction, the Glue PySpark work, and the Athena SQL validation. I close with two challenges and how I solved them. I keep the whole thing under two minutes, and I pause briefly after the architecture so the interviewer can ask follow-up questions.

B. General Project Understanding (Q7–Q11)

🟔 Intermediate
Q7

Walk me through the ETL architecture. Why Apache Airflow for orchestration?

click to reveal answer
ā–¶

Interview Answer: Our flow starts with MySQL data over JDBC, Google API data, and SFTP flat files. Airflow picks all of that up through Python and Bash tasks and lands it in S3 raw. Glue Crawlers then register the schema in the Catalog, Glue PySpark jobs transform the data into the S3 transformed bucket, Athena validates it with SQL, and finally the S3 Sensor triggers the S3-to-Redshift load into Redshift for PowerBI.

We chose Airflow specifically because our sources are so different from each other. The DAG makes the extract, transform, and load dependencies very explicit, and we get retries, the S3 Key Sensor, and the PythonOperator for custom extraction logic out of the box. It also gave us a single place to monitor the three sources and the three dashboards I was responsible for.

🟔 Intermediate
Q8

What is the role of S3? Why separate raw and transformed buckets?

click to reveal answer
ā–¶

Interview Answer: S3 acts as our durable data lake for both the landing and the curated layers. The raw bucket keeps immutable copies of whatever arrived from the source, which is extremely useful for audits and for replaying the pipeline. The transformed bucket, on the other hand, holds cleaned, correctly typed, and partitioned data that is ready for Athena and Redshift.

We keep them separate for three reasons. First, bad data can never overwrite history. Second, we can re-run a Glue job without having to re-extract from MySQL, the API, or SFTP. And third, the S3 Key Sensor can safely trigger the Redshift load only when a curated key appears in the transformed bucket.

🟔 Intermediate
Q9

How did you decide which data goes to Athena vs Redshift?

click to reveal answer
ā–¶

Interview Answer: We use Athena for exploration and validation, and Redshift for serving BI. Athena queries the transformed S3 data directly, so I can quickly check row counts, null rates, duplicates, and whether the source and transformed counts reconcile — all without loading anything or paying for a warehouse.

Only the filtered and validated data is COPYed into Redshift. Redshift is much better for the repeated joins and aggregations that PowerBI runs, thanks to its columnar storage and DIST and SORT keys. So the rule of thumb is simple: explore and validate in Athena, and serve the dashboards from Redshift.

🟔 Intermediate
Q10

Why Glue for ETL over EMR or Lambda?

click to reveal answer
ā–¶

Interview Answer: Glue was the best fit because it is serverless Spark with Crawlers, the Data Catalog, and PySpark jobs built in. That meant we could focus on writing transformation logic instead of provisioning and tuning clusters, which we would have had to do with EMR.

Lambda, on the other hand, is great for small event-driven tasks, but it has strict time and memory limits, so it cannot handle our larger batch transforms. EMR makes sense for long-running, heavily tuned clusters, while Lambda fits lightweight triggers. Since ours is a scheduled batch workload for dashboards, Glue jobs triggered from Airflow were the most practical option.

🟔 Intermediate
Q11

How does your Airflow DAG handle dependencies between extraction, transformation, and loading?

click to reveal answer
ā–¶

Interview Answer: The DAG is designed as a linear chain with a sensor in the middle. The three extraction tasks for MySQL, the API, and SFTP run in parallel, and only when all of them land data in S3 raw do we move forward to the Crawler and then the Glue job.

After the Glue job writes to the transformed prefix, an S3 Key Sensor waits for that exact key before the S3-to-Redshift operator is allowed to run. In code, it looks like extract >> crawl >> transform >> sense >> load. This guarantees the load never runs on partial data, and because retries are configured per task, retrying one source does not force us to rerun everything.

C. Extraction — MySQL, API, SFTP (Q12–Q14)

🟔 Intermediate
Q12

How did you establish JDBC connections from Airflow to MySQL?

click to reveal answer
ā–¶

Interview Answer: We never hard-code credentials. The MySQL host, port, database, username, and password are stored as an Airflow Connection, and the DAG task reads them through a JdbcHook or MySqlHook inside a PythonOperator.

The task itself runs parameterized SELECT queries against the transactional and customer tables, writes the result out, and then uploads it to the S3 raw bucket using Python and Bash. If there is a transient network or JDBC failure, Airflow's retry logic kicks in automatically, which has saved us quite a few times.

🟔 Intermediate
Q13

What authentication did you use for Google Analytics/Trends APIs?

click to reveal answer
ā–¶

Interview Answer: For the Google Trends and Analytics APIs, we use OAuth 2.0 with a service account. The credentials are stored securely in Airflow Connections and Variables, and the Python extraction function handles the token refresh automatically.

Because these APIs are paginated and rate-limited, we loop through the pages carefully, respect the quotas with backoff logic, and land the raw JSON in S3. We also log the request counts and response codes, so if an authentication or quota failure happens, it shows up clearly in the Airflow logs well before the Glue job runs.

🟔 Intermediate
Q14

How do you handle schema changes in incoming SFTP flat files?

click to reveal answer
ā–¶

Interview Answer: Flat files change all the time, so we designed for it. First, we always land the file in S3 raw exactly as it arrived, without modification. Then we let the Glue Crawler detect any new or renamed columns.

In the PySpark code itself, we select columns by name rather than position, we cast types defensively, we fill sensible null defaults for missing columns, and we flag or drop anything unexpected. On top of that, our Athena validation checks catch sudden shifts in row counts or null ratios before the Redshift load. And if the delimiter or header itself changes, the SFTP task fails loudly, so we fix the mapping in one place.

D. Transformation — Glue + PySpark (Q15–Q17)

šŸ”“ Advanced
Q15

Explain a PySpark transformation you wrote in Glue?

click to reveal answer
ā–¶

Interview Answer: One representative transformation combined all three sources. I read the raw MySQL, API, and SFTP frames, standardized the date and amount fields, removed duplicates on the business keys, joined the customer data to the transactions, filtered out invalid rows, and wrote the result as partitioned Parquet to S3 transformed.

The typical pattern looks like this: dropDuplicates(["txn_id"]) → withColumn("amount", col("amount").cast("decimal(12,2)")) → join(customers, "customer_id", "left") → filter("amount IS NOT NULL"). Partitioning the output by date made both the Athena validation and the later Redshift load much more efficient.

🟔 Intermediate
Q16

How do Glue Crawlers update metadata in the Catalog, and how does Athena use it?

click to reveal answer
ā–¶

Interview Answer: Crawlers scan the S3 raw and transformed locations, infer the table names, column types, and partitions, and then create or update those definitions in the Glue Data Catalog database.

Athena uses that same Catalog as its metastore. That means the moment the Crawler registers a table or a new partition, I can query it immediately in Athena with standard SQL for validation, without moving or copying any data. It keeps the metadata and the validation layer perfectly in sync.

🟔 Intermediate
Q17

If a Glue job fails midway, how does the pipeline recover or retry?

click to reveal answer
ā–¶

Interview Answer: Recovery works at two levels. At the orchestration level, Airflow automatically retries the Glue job task with backoff, so transient failures resolve on their own. At the storage level, the Glue job writes to a staging prefix first and only publishes to the final transformed prefix on success.

Because of that, partial files can never trigger the downstream S3 Sensor. We also use job bookmarks and checkpoints, so a retry only reprocesses the incomplete partitions instead of the full dataset. Finally, the CloudWatch and Airflow logs tell us exactly which stage failed, and we rerun just that task.

E. Loading — Athena + Redshift (Q18–Q20)

🟔 Intermediate
Q18

How did you validate data in Athena before pushing to Redshift?

click to reveal answer
ā–¶

Interview Answer: Before anything goes to Redshift, I run a set of Athena SQL checks against the Catalog tables sitting on S3 transformed. I compare row counts between the source and the transformed output, I check null rates on the key columns, I look for duplicates on the business keys, and I verify that amounts and dates fall in sensible ranges. I also run a few sample joins to make sure relationships still hold.

Only when all of those counts reconcile and the checks pass does the DAG move on to the S3-to-Redshift load. If any check fails, the downstream sensor is blocked and we get alerted, so bad data never reaches the dashboards.

🟔 Intermediate
Q19

How did you use the S3 → Redshift operator? What parameters were required?

click to reveal answer
ā–¶

Interview Answer: The operator runs only after the S3 Key Sensor confirms that the transformed key actually exists. It then executes a Redshift COPY from S3 into the target table.

The main parameters we pass are the S3 key or prefix, the destination Redshift table, the IAM role used for access, the file format along with delimiters for CSV or the Parquet setting, and COPY options such as TRUNCATECOLUMNS, TIMEFORMAT, and NULL AS. All credentials come from Airflow connections and IAM roles rather than code, and the task is sequenced to run strictly after the Athena validation succeeds.

🟔 Intermediate
Q20

Did you use DISTKEY or SORTKEY in Redshift to optimize queries?

click to reveal answer
ā–¶

Interview Answer: Yes, we did. We set the DISTKEY on the most common join key, which in our case was customer_id. That co-locates matching rows on the same slice, so joins do not require expensive shuffles across the cluster.

We set the SORTKEY on the date column that the dashboards filter on most often, which gives us efficient range pruning. Smaller dimension tables use DISTSTYLE ALL so every node has a local copy. We confirmed the benefit using EXPLAIN plans and the STL system tables, and the PowerBI queries became noticeably faster.

F. Scenario-Based (Q21–Q32)

šŸ”“ Advanced
Q21

If the API fails, how do you retry gracefully without blocking other tasks?

click to reveal answer
ā–¶

Interview Answer: The key is isolation. Each source — MySQL, the API, and SFTP — runs in its own Airflow task with its own retries and exponential backoff, plus a failure callback for alerting. That way, if the API goes down, the MySQL and SFTP extractions keep going in parallel instead of being blocked.

Downstream, the Glue step waits on all three sources when we need a complete day, or it proceeds with a data-quality gate when partial data is acceptable. For quota errors specifically, we use longer delays and pagination checkpoints, so a retry resumes from where it stopped rather than restarting from scratch.

šŸ”“ Advanced
Q22

What if the Glue Crawler fails due to schema mismatch? Fix and prevent?

click to reveal answer
ā–¶

Interview Answer: First, I would look at the crawler logs to find the exact conflicting column — usually it is a type change or a shifted header. Then I would quarantine that bad SFTP or API file in S3 raw so it cannot poison downstream data, fix the Catalog schema or the explicit mapping, and rerun the crawler and the job.

To prevent it in production, we added Athena checks that alert on sudden null-ratio changes, we made the PySpark casts tolerant with sensible defaults, and we version our table definitions. That way, a newly added column simply appears as an addition instead of breaking the whole pipeline.

šŸ”“ Advanced
Q23

Redshift load fails — OOM or bad distribution key. Steps?

click to reveal answer
ā–¶

Interview Answer: I would start with the system tables, particularly STL_LOAD_ERRORS and SVL_QLOG, to see whether it is the COPY itself failing or a downstream query running out of memory. Very often the root cause is skew, where one slice gets hot because of a poor DISTKEY choice.

The fix is to stage the load separately, pick a high-cardinality column that is actually used in joins as the DISTKEY, add a SORTKEY on the date, and run VACUUM and ANALYZE afterwards. If the transformation itself is too wide for Redshift, I would push that logic back into Glue. And because Athena validates the batch first, we avoid reloading the same bad data twice.

šŸ”“ Advanced
Q24

Scale from 100 GB/day to 1 TB/day. What changes?

click to reveal answer
ā–¶

Interview Answer: A tenfold jump means every layer has to become incremental and partitioned. In S3, I would enforce date and source partitioning and standardize on Parquet. In Glue, I would increase DPUs and parallelism and rely on job bookmarks so we only process new data instead of full reloads.

In Airflow, I would raise concurrency and split per-source work into sub-DAGs so one slow source does not hold up the rest. For serving, I would tighten Athena partitioning and scale Redshift with the right node count, proper DIST and SORT keys, and workload management. Finally, I would add CloudWatch monitoring and data-quality gates, because at one terabyte a day, a small failure rate becomes a very large operational problem.

🟔 Intermediate
Q25

Athena is slow — too many small files in S3. Optimize?

click to reveal answer
ā–¶

Interview Answer: The problem with thousands of tiny files is that Athena has to perform a huge number of S3 LIST and GET calls, which makes queries slow and expensive. The fix is compaction inside the Glue job.

I would coalesce or repartition the output into fewer, larger Parquet files — roughly 128 to 256 MB each — partitioned by date, and write them to the transformed prefix. After that, I would update the Catalog partitions. Fewer objects combined with columnar Parquet dramatically reduces both scan time and cost.

🟔 Intermediate
Q26

Power BI shows stale data. Trace across Airflow → Glue → Redshift?

click to reveal answer
ā–¶

Interview Answer: I trace it backwards, starting from the user and moving upstream. First, I check the PowerBI refresh time, then I look at the maximum loaded timestamp in Redshift. If Redshift is behind, I check whether the S3-to-Redshift COPY actually ran.

If the COPY did not run, I check whether the S3 Sensor fired — meaning, is the transformed key even present? If it is missing, I check whether the Glue job succeeded, and if that failed, whether the Airflow extracts landed anything in S3 raw. The first gap I find is the culprit. Longer term, we added Athena freshness checks and Airflow SLA alerts so staleness pages us before users notice it.

🟔 Intermediate
Q27

How do you secure sensitive customer data in S3?

click to reveal answer
ā–¶

Interview Answer: Security has to cover every layer. At rest, we use SSE-S3 or SSE-KMS encryption, and in transit everything goes over TLS. Access is controlled with bucket policies and IAM least-privilege per prefix, so the raw and transformed areas have different permissions. We also block all public access and enable access logging with CloudTrail for auditing.

Most importantly, sensitive PII columns are masked or tokenized inside the Glue job itself, before the data ever reaches the transformed bucket. That way, Athena and Redshift only ever see the safe version, never the raw personal data.

🟔 Intermediate
Q28

New client wants column-level access — Power BI must not see PII. Implement?

click to reveal answer
ā–¶

Interview Answer: I would solve this with a dedicated PII-free layer. In Glue, we either drop the sensitive columns like email and phone entirely or replace them with hashed values, and we write that masked dataset to its own transformed prefix.

Then, in Redshift, we create a view over the masked data and GRANT access only on that view. The PowerBI service connects with a role that simply cannot SELECT the base PII tables. We do the same in Athena by exposing only the masked Catalog view. So access control is enforced by roles and views, not by trusting users to avoid certain columns.

🟔 Intermediate
Q29

DAG failed — S3 Key Sensor never detected files. Debug and fix?

click to reveal answer
ā–¶

Interview Answer: When the sensor times out, it is usually one of three things: a wrong bucket, prefix, or key pattern, a date-templating mistake such as execution_date versus ds, or a missing IAM permission. I start by checking those, and then I verify whether Glue actually wrote to a different prefix or failed silently upstream.

Once I find it, I correct the key template or the prefix, backfill the missed run, and then harden the DAG. I add a sensible sensor timeout with an alert, plus an explicit S3 or Athena existence check, so the next silent upstream miss pages us quickly instead of failing quietly.

🟔 Intermediate
Q30

Duplicate records in Redshift — detect and clean?

click to reveal answer
ā–¶

Interview Answer: I detect duplicates by grouping on the business key with GROUP BY business_key HAVING COUNT(*) > 1 in Athena or Redshift, and I also compare source counts against warehouse counts to see where the extra rows came from.

To clean them, I load the data into a staging table, keep only the latest record per key using ROW_NUMBER() OVER (PARTITION BY key ORDER BY updated_at DESC) where rn equals one, and then swap it into the final table. To prevent recurrence, we deduplicate in Glue with dropDuplicates on the business keys and add a key-uniqueness check before the S3-to-Redshift COPY runs.

šŸ”“ Advanced
Q31

How do you optimize PySpark jobs in Glue to prevent OOM?

click to reveal answer
ā–¶

Interview Answer: Out-of-memory errors almost always come from shuffles, skew, or reading too much data too early. So I start by filtering as early as possible and selecting only the columns I actually need. Then I make sure the data is repartitioned to match the available parallelism.

For joins, I broadcast the small customer table instead of shuffling it, and I salt any hot transaction keys that cause skew. I persist only the frames that are genuinely reused, and if needed, I scale up to larger G.1X or G.2X workers with more executor memory. I also check the Glue metrics for spill and garbage-collection pressure before adding resources, and I always write the final output as partitioned Parquet.

🟔 Intermediate
Q32

How do you partition S3 data for better Athena performance?

click to reveal answer
ā–¶

Interview Answer: I use Hive-style prefixes like year=/month=/day=/source= in the transformed bucket, stored as Parquet. This matches the way our dashboards filter, which is almost always by date, so Athena can prune entire partitions instead of scanning everything.

I also keep file sizes balanced so we avoid both tiny files and giant ones, and I make sure the Catalog partitions are updated after every Glue run. One thing I avoid is partitioning on very high-cardinality columns like customer_id, because that creates far too many tiny partitions and hurts performance instead of helping it.

G. Challenge-Based (Q33–Q35)

šŸ”“ Advanced
Q33

You mentioned FIRST CHALLENGE. Describe it, debugging, and final solution?

click to reveal answer
ā–¶

Interview Answer: You should replace this template with your real story, but here is how I would frame it. In my case, the SFTP headers kept changing every week, which broke the Glue job. I debugged it by checking the crawler errors and noticing sudden null spikes in the Athena validation queries.

To fix it, I quarantined the bad files in S3 raw so they could not flow downstream, I made the PySpark code tolerant to header changes with an explicit column mapping and default values, and I added an Athena header check as a gate before the Redshift load. After that fix, we had zero broken dashboard loads from that cause. The key is to always close with a measurable result.

šŸ”“ Advanced
Q34

Tell me about SECOND CHALLENGE. What alternatives did you evaluate?

click to reveal answer
ā–¶

Interview Answer: Again, use your own experience here. As an example, my second challenge was a Glue out-of-memory failure caused by a heavily skewed join. I evaluated three options: simply adding bigger workers, using a broadcast join, or applying salting to the hot keys.

I ended up combining the last two: I broadcast the small customer table and salted the hot transaction key. That turned out to be both the cheapest and the fastest solution. When you answer, walk through the trade-offs clearly — cost versus speed versus complexity — and explain why the option you picked won.

šŸ”“ Advanced
Q35

If you rebuilt this pipeline today, what would you change?

click to reveal answer
ā–¶

Interview Answer: I would keep the same overall stack, because it fits the workload well, but I would make it properly incremental, idempotent, and observable from day one. First, I would standardize on Parquet with date partitioning right away, so Athena and Redshift pruning work from the start.

Second, I would use Glue bookmarks for incremental loads instead of reprocessing full days. Third, I would add proper data-quality gates in Athena before the Redshift load, similar to a Great Expectations suite. I would also parameterize the Airflow DAGs per dashboard so each one can run and backfill independently, create masked views for any PII columns, and add CloudWatch and SLA alerts on sensor timeouts and data freshness. The result would be the same architecture, but cheaper to run in Athena and Redshift, and noticeably faster and more reliable for PowerBI users.

← All Interview Lessons šŸ  Hub Home