🎯 Data Engineer Interview Question Bank

Comprehensive question set for 5+ years experienced Data Engineers · SQL · Python · PySpark · AWS · Snowflake · Airflow · dbt · Kafka · Data Modeling · System Design · Scenario · Behavioral

Target Level
5+ Years
Categories
15
Total Questions
500+
Stack
AWS + Snowflake

⭐ Top Common Questions (Asked in 80%+ Interviews)

Strategy: These questions appear in nearly every Data Engineer round (TCS / Infosys / Accenture / Cognizant / Tiger Analytics / Mu Sigma / EXL / Fractal / product companies). Prepare crisp 2–3 minute answers with one project example each.

🔥 Introduction & Resume-Based

  1. Walk me through your resume / Tell me about yourself.
  2. Explain your current project — architecture end to end.
  3. What is your day-to-day role as a Data Engineer?
  4. What was the most challenging problem you solved in your last project?
  5. Why are you switching from SAP / Support / Testing to Data Engineering?
  6. Which tools and technologies are you most comfortable with?
  7. What does a typical data pipeline look like in your project?
  8. Draw the architecture diagram of your most recent pipeline on the whiteboard.
  9. How big is your data (volume / velocity / variety)?
  10. What is the team size and how is work divided?
  11. What is your role in design vs development vs production support?
  12. Describe a production incident you handled and the RCA.
  13. What new technology have you learned in the last 6 months?
  14. Have you worked on real-time pipelines or only batch?
  15. Where do you see yourself in 3 years?

🔥 Concept Fundamentals (Every Interview)

  1. What is the difference between ETL and ELT? Which one is preferred today and why?
  2. What is a data lake vs data warehouse vs data lakehouse vs data mart?
  3. Explain OLTP vs OLAP with examples.
  4. What is a star schema vs snowflake schema? Which do you prefer and why?
  5. What are SCD types 1, 2, 3, 4, 6? Write SQL for SCD Type 2.
  6. What is a fact table vs dimension table? Types of fact tables?
  7. What is partitioning vs bucketing vs clustering? When to use each?
  8. Difference between RDBMS and NoSQL — and when to choose which?
  9. What is normalization vs denormalization? Why do warehouses denormalize?
  10. What is data modeling? Walk through your modeling approach for a new domain.
  11. Batch vs micro-batch vs streaming — give use cases for each.
  12. What is idempotency in a data pipeline and how do you achieve it?
  13. What is at-least-once, at-most-once, exactly-once delivery?
  14. How do you handle late-arriving data?
  15. How do you handle schema evolution / schema drift in pipelines?
  16. What is data lineage and why does it matter?
  17. What is the difference between row-based and columnar storage?
  18. Why is Parquet preferred over CSV for big data?
  19. Compare Parquet vs ORC vs Avro vs JSON vs CSV.
  20. What is the CAP theorem? Apply it to a system you have built.

🏆 Quick-Fire Mixed

  1. Difference between WHERE and HAVING.
  2. What is the difference between RANK, DENSE_RANK and ROW_NUMBER?
  3. Difference between UNION and UNION ALL.
  4. What is the difference between coalesce and repartition in Spark?
  5. Difference between cache and persist in Spark.
  6. Difference between map and flatMap.
  7. Difference between DataFrame, Dataset and RDD.
  8. What is a broadcast join? When does Spark do it automatically?
  9. Difference between narrow vs wide transformations.
  10. Difference between Snowpipe and a COPY INTO statement.
  11. Difference between Snowflake Streams and Tasks.
  12. Difference between Airflow operators, sensors and hooks.
  13. What is the difference between S3 Standard, IA, Glacier?
  14. Difference between Glue Crawler and Glue Job.
  15. Difference between dbt seed, source, model, snapshot, test.

🎓 5+ Years Specific Signals

  1. How do you decide when to introduce a new tool in your stack?
  2. How do you do cost optimisation for a cloud data platform?
  3. How do you onboard a new data source from scratch?
  4. How do you handle stakeholder requirements that keep changing mid-sprint?
  5. Walk me through a migration you led (on-prem → cloud, or one stack → another).
  6. How have you mentored juniors / done code reviews?
  7. What is your definition of "production-ready" pipeline?
  8. How do you write a design document before building a pipeline?
  9. What metrics do you track to know a pipeline is healthy?
  10. How do you handle on-call and PagerDuty / alert fatigue?

📊 SQL & Advanced SQL

Reality: SQL is the #1 round that filters candidates. For 5+ years, expect 4–6 hands-on queries on window functions, joins, CTEs, and tricky aggregation. Practice on real datasets (StrataScratch, LeetCode SQL, DataLemur).

🔥 SQL Concepts (Theory)

  1. Difference between INNER, LEFT, RIGHT, FULL OUTER, CROSS and SELF JOIN.
  2. Difference between WHERE and HAVING clause.
  3. Difference between GROUP BY and PARTITION BY.
  4. What is the execution order of an SQL query (FROM, WHERE, GROUP BY, HAVING, SELECT, ORDER BY, LIMIT)?
  5. What is a CTE? Difference between CTE, subquery, temp table, view, materialized view.
  6. What is a recursive CTE? Give a real use case.
  7. Difference between RANK, DENSE_RANK, ROW_NUMBER, NTILE, PERCENT_RANK.
  8. Explain LEAD, LAG, FIRST_VALUE, LAST_VALUE with examples.
  9. What is a window function frame (ROWS vs RANGE, UNBOUNDED PRECEDING)?
  10. What is the difference between DELETE, TRUNCATE and DROP?
  11. Difference between primary key, unique key, candidate key, surrogate key, natural key.
  12. What are ACID properties? Explain with a banking example.
  13. What is normalisation? Explain 1NF, 2NF, 3NF, BCNF.
  14. What is denormalisation? Why is it used in warehouses?
  15. What are indexes? Difference between clustered and non-clustered.
  16. How does an index affect insert/update/delete performance?
  17. What is the difference between EXISTS and IN? Which is faster?
  18. What is a correlated subquery? Why is it expensive?
  19. Difference between UNION and UNION ALL.
  20. What is COALESCE vs NVL vs ISNULL vs NULLIF?
  21. What is the difference between CHAR, VARCHAR, VARCHAR2, TEXT?
  22. What is the difference between CAST and CONVERT?
  23. What is a stored procedure vs function vs trigger?
  24. What are pivot and unpivot operations?
  25. What is a query plan / explain plan? How do you read it?

🔥 Hands-On SQL Problems (Most Asked)

  1. Find the Nth highest salary in each department (multiple ways — window, subquery, DENSE_RANK).
  2. Find employees who earn more than their manager.
  3. Find duplicate rows in a table and delete duplicates keeping the latest.
  4. Find consecutive login days for each user (gaps and islands problem).
  5. Find users who logged in for 3 consecutive days.
  6. Calculate running total / cumulative sum per customer.
  7. Calculate 7-day moving average of sales.
  8. Find the second highest salary department-wise without using LIMIT/OFFSET.
  9. Pivot monthly sales data into columns for each month.
  10. Unpivot a wide table into long format.
  11. Find customers who placed orders in 2024 but not in 2025.
  12. Calculate month-over-month growth and YoY growth.
  13. Find the top 3 products per category by revenue.
  14. Split a comma-separated string into rows (STRING_SPLIT / SPLIT_TO_TABLE / LATERAL).
  15. Find the percentage of total per row (window without partition).
  16. Identify sessions: group events that are within 30 minutes of each other.
  17. Find first and last event per user in a single query.
  18. Compute median salary without using PERCENTILE_CONT.
  19. Find customers whose order amount increased in 3 consecutive orders.
  20. Build a calendar table and use it to fill missing dates.
  21. Find employees who never took leave (anti-join).
  22. Identify overlapping date ranges from a table of bookings.
  23. Find products that were sold every month in 2025.
  24. Detect price changes — get previous price vs current price using LAG.
  25. Write SQL for SCD Type 2 implementation (insert new + close old version).
  26. Identify the longest streak of wins for each player.
  27. Find the department with highest average salary.
  28. Calculate retention: % of users from Jan who came back in Feb.
  29. Detect duplicate records across two tables.
  30. Write a query to find friends-of-friends (graph-like in SQL).

🎓 Performance Tuning (5+ Years)

  1. How do you optimise a slow SQL query? Walk through your approach.
  2. How do you read an EXPLAIN plan? What do you look for first?
  3. When does an index hurt performance?
  4. Difference between full table scan, index scan, index seek.
  5. What is a covering index?
  6. How do you reduce shuffle in a large join?
  7. Why are correlated subqueries slow and how do you rewrite them?
  8. How does the database choose join order? Can you force it?
  9. What are statistics on a table and how do they affect query plans?
  10. Difference between hash join, merge join, and nested loop join.
  11. What is predicate pushdown? Give an example with Parquet.
  12. How do you handle parameter sniffing issues?
  13. How do you optimise GROUP BY on a 1 billion row table?
  14. When should you partition vs index a table?
  15. What is a materialised view? How is it different from a view? Refresh strategies?

🐍 Python & Pandas

🔥 Python Core

  1. Difference between list, tuple, set, dict — and when to use each.
  2. What is mutable vs immutable in Python? Give examples.
  3. Explain shallow copy vs deep copy.
  4. What are *args and **kwargs?
  5. What is a generator? Difference between yield and return.
  6. What is the difference between iterator and iterable?
  7. Explain list / dict / set comprehensions.
  8. What is a decorator? Write one that times a function.
  9. What are lambda functions? Why use them?
  10. Difference between map(), filter(), reduce().
  11. What is the GIL (Global Interpreter Lock)? Implications for multithreading?
  12. Difference between multithreading and multiprocessing in Python.
  13. What is asyncio? When would you use it in DE pipelines?
  14. How does Python handle memory management and garbage collection?
  15. What is __init__ vs __new__ vs __call__?
  16. What is a class method vs static method vs instance method?
  17. What is inheritance, polymorphism, encapsulation — give code examples.
  18. Difference between is and == operators.
  19. How do you handle exceptions? try/except/else/finally — when does else run?
  20. Custom exception class — how to write one and why.
  21. What are context managers? Write one using __enter__/__exit__ or @contextmanager.
  22. Difference between pickle and json for serialisation.
  23. How do you read a 10 GB CSV in Python without OOM?
  24. What is the difference between requests.get vs urllib?
  25. How do you parallelise an API call across 1000 URLs?

🐼 Pandas

  1. Difference between Series and DataFrame.
  2. Difference between loc, iloc, at, iat.
  3. How to merge two DataFrames — types of merges?
  4. Difference between merge, join, concat.
  5. How do you handle nulls in Pandas (fillna, dropna, interpolate)?
  6. How to group by multiple columns and aggregate with multiple functions?
  7. Apply vs map vs applymap — when to use each?
  8. Why is apply slow? How do you vectorise instead?
  9. How to read CSV in chunks and process?
  10. Pivot vs pivot_table vs crosstab — differences?
  11. How to detect and remove duplicates?
  12. How to convert column dtypes? Why is it important?
  13. How to handle datetime columns and timezones?
  14. Difference between Pandas DataFrame and Spark DataFrame — when to choose which?
  15. What are Pandas UDFs in Spark? Why are they faster than regular Python UDFs?

🎓 Python for Data Engineering (Advanced)

  1. How do you structure a Python ETL project? (folders, configs, logging, tests)
  2. How do you handle secrets in Python code? (env vars, Secrets Manager, Vault)
  3. How do you write retries with exponential backoff?
  4. How do you implement a singleton DB connection pool?
  5. Walk through a Python script you wrote to call an API, paginate, retry, dedupe, and load to S3 / Postgres.
  6. What is dependency injection in Python? Why use it?
  7. How do you write unit tests with pytest? What about fixtures and mocks?
  8. How do you test code that touches S3 / Snowflake / a DB?
  9. What linters / formatters do you use (black, isort, flake8, ruff, mypy)?
  10. How do you package a Python project (pyproject.toml, setup.py, poetry)?
  11. Difference between virtualenv, venv, conda, poetry, uv.
  12. How do you containerise a Python ETL job in Docker?
  13. How do you schedule a Python job — cron vs Airflow vs Lambda?
  14. How do you profile a slow Python script? cProfile, line_profiler, memory_profiler.
  15. What is logging best practice in production (handlers, levels, JSON logs)?

⚡ PySpark / Apache Spark

Why important: Spark is asked in ~90% of DE interviews. Know architecture, transformations, optimisation, joins, partitioning deeply. Be ready to explain a Spark UI.

🔥 Architecture & Internals

  1. Explain Spark architecture — Driver, Executors, Cluster Manager, Workers.
  2. What happens internally when you run df.show()?
  3. What is a Spark Job vs Stage vs Task?
  4. How does Spark decide stages? (Wide vs narrow transformations.)
  5. What is lazy evaluation in Spark? Why is it powerful?
  6. Difference between RDD, DataFrame, Dataset. Which do you use and why?
  7. What is Catalyst Optimiser? Walk through its phases.
  8. What is Tungsten engine?
  9. What is Adaptive Query Execution (AQE)? Which configs enable it?
  10. Explain DAG and DAG scheduler.
  11. What is the difference between client mode and cluster mode?
  12. How does Spark handle fault tolerance? (Lineage + RDD recomputation.)
  13. What is checkpointing? Difference between persist and checkpoint.
  14. Difference between cache() and persist(). What storage levels exist?
  15. What happens when you call collect() on a 1 TB DataFrame?

🔥 Transformations & Actions

  1. List 10 common transformations and 5 actions.
  2. Difference between map and flatMap with code example.
  3. Difference between reduce and reduceByKey.
  4. Difference between groupByKey and reduceByKey — why is reduceByKey better?
  5. Difference between coalesce and repartition.
  6. How does repartition(10) work internally? Does it cause shuffle?
  7. What are window functions in Spark? Give an example.
  8. How to use when/otherwise for case-style logic?
  9. What is the difference between filter() and where()?
  10. How do you drop duplicates considering only some columns?
  11. How do you write a Spark UDF? Why are UDFs discouraged?
  12. Difference between Python UDF, Pandas UDF, Scala UDF — performance order.
  13. How do you handle nulls in joins?
  14. How do you flatten a nested JSON / array column?
  15. How do you explode and pivot in Spark?

🎓 Joins & Shuffles (5+ Years Hot Topic)

  1. What types of joins exist in Spark? (Shuffle hash, sort-merge, broadcast, BNLJ.)
  2. How does Spark choose a join strategy?
  3. What is a broadcast join? Threshold config (spark.sql.autoBroadcastJoinThreshold)?
  4. How to broadcast a DataFrame manually?
  5. What is data skew? How do you detect it from Spark UI?
  6. How to handle skew — salting, AQE skew join, isolated processing?
  7. Why is GROUP BY on a high-cardinality skewed key slow?
  8. What is partition pruning? Predicate pushdown? Projection pushdown?
  9. How does Spark handle wide rows / very small files (small files problem)?
  10. What is bucketing? When is it useful vs partitioning?
  11. How to repartition before a join to avoid shuffle?
  12. What is spark.sql.shuffle.partitions? Default? How to tune?
  13. How do you handle a join where one side is 5 TB and other is 50 GB?
  14. What is dynamic partition pruning?
  15. What is the cost of a sort-merge join vs broadcast join?

🎓 Performance Tuning

  1. What configs do you usually tune? (executor memory, cores, parallelism, AQE, broadcast threshold.)
  2. How do you decide number of executors, executor cores, executor memory?
  3. What is the formula for executor sizing?
  4. What is off-heap memory in Spark? When to enable?
  5. What causes OutOfMemoryError in driver vs executor?
  6. How do you fix an OOM in the executor?
  7. What is spill to disk? How to reduce it?
  8. What is the small files problem and how to fix it?
  9. How do you read 10,000 small JSON files efficiently?
  10. Difference between coalesce before write vs repartition before write.
  11. How do you write Parquet partitioned by date efficiently?
  12. What is maxRecordsPerFile when writing?
  13. How do you read Spark UI to debug a slow job?
  14. What do you look at in the SQL tab, Stages tab, Storage tab?
  15. How do you debug GC pressure?

🌊 Structured Streaming

  1. What is Structured Streaming? How is it different from Spark Streaming (DStream)?
  2. What is the micro-batch model?
  3. What output modes exist? (append, update, complete.)
  4. What is a watermark? How does it help in late data?
  5. How do you handle stateful aggregations?
  6. Trigger types — default, fixed interval, once, available-now, continuous.
  7. What are checkpoints in streaming and why are they critical?
  8. How do you achieve exactly-once with Spark + Kafka + S3?
  9. How do you handle schema evolution in a streaming job?
  10. How do you join streams with static tables / two streams?

📦 Delta Lake / Lakehouse

  1. What is Delta Lake? Why use it over plain Parquet?
  2. What is the transaction log (_delta_log)?
  3. What is time travel? Give a syntax example.
  4. Difference between OPTIMIZE, VACUUM, ZORDER.
  5. How does Delta handle ACID transactions?
  6. What is MERGE INTO? Write a SCD2 using MERGE.
  7. What are Delta liquid clustering / generated columns?
  8. Difference between Delta Lake, Iceberg and Hudi.
  9. How does Delta avoid the small files problem?
  10. What is Change Data Feed (CDF) in Delta?

☁️ AWS for Data Engineers

🔥 S3 (Storage)

  1. Explain S3 architecture — buckets, objects, keys.
  2. What is S3 storage class? When to use Standard, IA, One Zone-IA, Glacier, Deep Archive?
  3. What is S3 lifecycle policy? Give an example.
  4. How do you secure an S3 bucket? (bucket policy, ACL, IAM, encryption.)
  5. Server-side encryption — SSE-S3, SSE-KMS, SSE-C differences.
  6. What is S3 versioning? When is it useful for data engineers?
  7. What is S3 Object Lock?
  8. How does S3 consistency model work today (strong read-after-write)?
  9. What is S3 Select and Athena Select? When to use it?
  10. What is S3 Event Notification? Use case with Lambda / SQS / EventBridge.
  11. How do you copy 100 TB into S3? (DataSync, Snowball, Snowmobile, parallel multipart upload.)
  12. What is multipart upload?
  13. How do you partition data in S3 for Athena? (Hive-style folders.)
  14. How do you organise a data lake on S3 — bronze/silver/gold or raw/curated/refined?
  15. S3 cross-region replication vs same-region replication — use cases.

🔥 Glue, EMR, Lambda

  1. What is AWS Glue? Components — crawler, catalog, jobs, triggers, workflows.
  2. Difference between Glue Crawler and Glue Job.
  3. What is Glue Data Catalog? How is it different from Hive Metastore?
  4. Difference between Glue ETL and Glue Studio.
  5. What are bookmarks in Glue? How do they help with incremental loads?
  6. What is a DPU? How do you size a Glue job?
  7. Glue vs EMR vs Lambda — when to pick each.
  8. What is Glue Spark vs Glue Python Shell?
  9. How do you debug a failing Glue job?
  10. What is EMR? Differences between EMR on EC2, EMR Serverless, EMR on EKS.
  11. How do you submit a Spark job on EMR? (step API, EMR Steps, livy.)
  12. How do you handle EMR cluster autoscaling?
  13. What is Lambda? Limitations (15 min, 10 GB ephemeral, payload).
  14. Use case of Lambda in a DE pipeline (S3 trigger → tiny transform → SNS/SQS).
  15. Lambda vs Step Functions vs MWAA — when to use each.

📂 Athena, Redshift, Lake Formation

  1. What is Athena? How is it priced?
  2. How do you reduce Athena cost? (Partitioning, columnar, compression, projection.)
  3. What are partition projections in Athena?
  4. Difference between Athena and Redshift Spectrum.
  5. What is Redshift? RA3 vs DC2 — differences.
  6. What is distribution style in Redshift? (KEY, ALL, EVEN, AUTO.)
  7. What is sort key? Compound vs interleaved.
  8. How do you load data into Redshift efficiently? (COPY from S3, manifest, max compression.)
  9. What are materialised views in Redshift?
  10. What is Redshift Spectrum? When is it useful?
  11. How does Redshift handle concurrent workloads (WLM, queues)?
  12. What is Lake Formation? When to use it?
  13. How do you implement row-level / column-level security on a data lake?
  14. How do you grant fine-grained permissions via Lake Formation tags?
  15. Difference between Redshift, Snowflake, BigQuery for an analyst workload.

📡 Streaming on AWS

  1. What is Kinesis Data Streams vs Firehose vs Data Analytics?
  2. Difference between Kinesis and MSK (Managed Kafka).
  3. What is a shard in Kinesis? Throughput per shard?
  4. How do you scale a Kinesis stream?
  5. Use case: ingest 1 million events/sec — Kinesis vs MSK?
  6. Difference between SQS, SNS, EventBridge.
  7. What is Step Functions? When do you use it instead of Airflow?
  8. How do you design a CDC pipeline on AWS? (DMS → Kinesis/S3 → Glue/Spark → Snowflake/Redshift.)
  9. What is AWS DMS? Full load vs CDC mode.
  10. How do you handle DMS schema changes?

🎓 IAM, Networking, Cost (Senior)

  1. What is the principle of least privilege? How do you apply it in IAM?
  2. Difference between IAM user, group, role, policy.
  3. What is an instance profile?
  4. What is cross-account access? How do you set it up?
  5. What is a VPC endpoint? Why is it important for S3 access from EMR/Glue?
  6. Difference between Security Group and NACL.
  7. How do you connect Glue to an on-prem database? (Connections, JDBC, VPC.)
  8. What is KMS? Customer-managed vs AWS-managed keys.
  9. How do you monitor a data pipeline? (CloudWatch metrics, logs, alarms, X-Ray.)
  10. How do you set up alerts when a Glue job fails?
  11. How do you optimise cost on a data platform? (S3 lifecycle, spot instances, right-sizing, reserved capacity, query cost.)
  12. What is AWS Budget and Cost Explorer?
  13. What is a Service Control Policy (SCP) in AWS Organisations?
  14. How do you handle multi-account architecture for data? (Landing zone, Control Tower.)
  15. How do you do disaster recovery for a data lake on S3?

❄️ Snowflake

🔥 Architecture & Core

  1. Explain Snowflake's three-layer architecture (storage, compute, cloud services).
  2. Why is Snowflake called "decoupled storage and compute"?
  3. What is a virtual warehouse? Sizes (XS to 6XL)?
  4. What is multi-cluster warehouse? Auto-scaling policies?
  5. Difference between scale up and scale out in Snowflake.
  6. What is a micro-partition? Average size? Are they user-controlled?
  7. What is clustering vs partitioning in Snowflake?
  8. What is a clustering key? When should you define one?
  9. What is automatic clustering? Cost implications?
  10. What is Time Travel? Default retention? Max?
  11. What is Fail-safe? Difference from Time Travel.
  12. What is Zero-Copy Cloning? Cost implications.
  13. What are the types of tables in Snowflake — permanent, transient, temporary, external?
  14. Difference between SECURE and regular view.
  15. What is a materialised view in Snowflake? Limitations?

🔥 Data Loading & Streaming

  1. How do you load data into Snowflake? COPY INTO vs Snowpipe vs Snowpipe Streaming vs Kafka Connector.
  2. What is a stage in Snowflake? Internal vs external (S3/Azure/GCS).
  3. How does Snowpipe work? Auto-ingest with S3 event notifications.
  4. What is Snowpipe Streaming? Latency expectations?
  5. What is a Stream? Standard vs Append-only vs Insert-only stream.
  6. What is a Task? How do you chain tasks (DAG of tasks)?
  7. How do you build a CDC pipeline inside Snowflake using Streams + Tasks?
  8. How do you handle late-arriving / out-of-order data?
  9. How do you load semi-structured data (JSON, XML, Parquet)?
  10. What is the VARIANT data type? How do you query nested JSON?
  11. What is FLATTEN function?
  12. Difference between COPY INTO and INSERT.
  13. What is a file format object?
  14. How do you handle bad rows during COPY? ON_ERROR options.
  15. How do you reload only failed files? (FORCE, VALIDATION_MODE.)

🎓 Performance, Cost, Security

  1. How do you tune a slow Snowflake query? (Query profile, clustering, warehouse size, result cache.)
  2. What are the three caches in Snowflake? (Result, local disk, remote/metadata.)
  3. What is search optimization service? When is it useful?
  4. What is query acceleration service?
  5. How does Snowflake bill compute? Per-second after first 60s.
  6. How do you control cost? (Resource monitors, auto-suspend, right-size warehouses.)
  7. What is a resource monitor?
  8. How do you set up RBAC properly? (Account → role → user; future grants.)
  9. Difference between SYSADMIN, SECURITYADMIN, USERADMIN, ACCOUNTADMIN.
  10. What is row access policy? Column masking policy?
  11. What is dynamic data masking?
  12. How do you do data sharing in Snowflake? (Secure share, reader account, marketplace.)
  13. What is a replication group and failover group?
  14. How do you achieve DR across regions / clouds?
  15. What is Snowpark? When would you use it instead of Spark?

🌀 Apache Airflow

🔥 Concepts

  1. What is Airflow? Why orchestration matters in DE.
  2. Explain Airflow architecture (Scheduler, Webserver, Worker, Metadata DB, Executor, Triggerer).
  3. What is a DAG? Difference between DAG and pipeline.
  4. What are the executors? (Local, Sequential, Celery, Kubernetes, CeleryKubernetes.)
  5. Difference between Operator, Sensor, Hook.
  6. List 10 common operators (PythonOperator, BashOperator, EmailOperator, S3KeySensor, SnowflakeOperator, etc.).
  7. What is XCom? Limitations and best practices.
  8. What is a TaskGroup vs SubDAG? Why is SubDAG deprecated?
  9. What is a Variable, Connection, Pool?
  10. What are Jinja templates / macros? Give examples.
  11. Difference between execution_date, data_interval_start, logical_date.
  12. How does Airflow handle catchup and backfill?
  13. What is depends_on_past and wait_for_downstream?
  14. What is task retry, retry_delay, exponential backoff?
  15. What is SLA in Airflow?

🎓 Advanced Patterns

  1. How do you build dynamic DAGs (generated at parse time)?
  2. Dynamic Task Mapping (Airflow 2.3+) — give an example.
  3. How do you pass large data between tasks? (Hint: not XCom — use S3.)
  4. How do you implement idempotent tasks?
  5. How do you handle data quality checks inside a DAG?
  6. How do you trigger one DAG from another? (TriggerDagRunOperator, ExternalTaskSensor, datasets.)
  7. What are Airflow Datasets (data-aware scheduling)?
  8. How do you secure Airflow connections / secrets? (Secrets backend: AWS Secrets Manager, Vault.)
  9. How do you scale Airflow? (More workers, KubernetesExecutor, multiple schedulers.)
  10. How do you monitor Airflow? (Statsd, Prometheus, Datadog, Grafana.)
  11. How do you handle DAG failures gracefully? (Callbacks: on_failure_callback, on_retry_callback.)
  12. What is a sensor reschedule mode vs poke mode?
  13. How do you write custom operators / hooks?
  14. What are best practices for DAG file structure?
  15. What is MWAA vs Astronomer vs self-managed Airflow? Trade-offs.

🔧 dbt (Data Build Tool)

🔥 Core Concepts

  1. What is dbt? ELT vs ETL — where does dbt fit?
  2. Difference between dbt Core and dbt Cloud.
  3. What are models, sources, seeds, snapshots, tests, macros, analyses?
  4. What are materialisations? (table, view, incremental, ephemeral.)
  5. When do you use incremental vs table materialisation?
  6. What is an incremental model? is_incremental() usage.
  7. Incremental strategies — append, merge, delete+insert, insert_overwrite.
  8. What is a snapshot? How does dbt implement SCD2?
  9. What is ref() vs source()? Why is it important?
  10. What is the staging / intermediate / marts layer pattern?
  11. What are dbt tests? Built-in vs generic vs singular vs custom.
  12. How do you write a custom test?
  13. What are macros? Write one for "current timestamp in UTC".
  14. What is a Jinja loop in dbt?
  15. What is {{ config() }}? Give 3 useful configs.

🎓 Advanced

  1. How does dbt build the DAG?
  2. Difference between dbt run, dbt build, dbt test, dbt compile.
  3. What is dbt deps? How do packages work?
  4. What is dbt_utils? Name 5 useful macros.
  5. What is exposure, metric, semantic layer in dbt?
  6. How do you implement environment separation (dev / staging / prod)?
  7. How do you do CI/CD with dbt? (Slim CI, state:modified+.)
  8. What is a defer flag in dbt?
  9. How do you handle PII / column-level docs / access?
  10. How do you orchestrate dbt — Airflow, dbt Cloud, GitHub Actions? Pros & cons.
  11. How do you debug a failing dbt model?
  12. What is elementary / re_data / great_expectations integration?
  13. How do you write a dbt model that does upsert into Snowflake?
  14. Difference between dbt snapshot and SCD Type 2 in Snowflake Streams + Tasks.
  15. What are the trade-offs of dbt vs Stored Procedures?

📡 Kafka & Streaming

🔥 Kafka Core

  1. What is Kafka? Why use it instead of a queue (RabbitMQ/SQS)?
  2. Explain Kafka architecture (Producer, Broker, Consumer, ZooKeeper / KRaft).
  3. What is a topic, partition, offset, replica, leader, follower?
  4. How is data ordered in Kafka? Per partition guarantee.
  5. What is a consumer group? How does rebalancing work?
  6. What is ISR (in-sync replicas)?
  7. What is acks=0/1/all? Trade-offs.
  8. What is exactly-once semantics in Kafka? (Idempotent producer + transactions.)
  9. How do you choose number of partitions for a topic?
  10. What is retention policy? Log compaction vs time-based.
  11. How do you handle schema evolution in Kafka? (Schema Registry, Avro, backward/forward compatibility.)
  12. Difference between Avro, Protobuf, JSON Schema.
  13. What is Kafka Connect? Source vs Sink connectors.
  14. What is Kafka Streams vs ksqlDB?
  15. Difference between Kafka and Kinesis.

🎓 Streaming Patterns

  1. How do you design a Kafka + Spark Streaming pipeline?
  2. How do you achieve exactly-once from Kafka → S3 → Snowflake?
  3. How do you handle out-of-order events?
  4. What are watermarks in streaming?
  5. How do you handle a poison message?
  6. How do you backfill a streaming pipeline?
  7. How do you reprocess from a specific offset?
  8. Tumbling vs sliding vs session window — examples.
  9. What is dead letter queue?
  10. How do you size a Kafka cluster? (Throughput, retention, partition count.)
  11. How do you monitor Kafka lag?
  12. How do you handle a consumer that is constantly behind?
  13. How do you guarantee ordering when you need it per user?
  14. What is CDC via Debezium → Kafka → Snowflake / Redshift?
  15. How do you design retries in a streaming consumer?

🧱 Data Modeling & Warehousing

🔥 Modeling Concepts

  1. OLTP vs OLAP — characteristics and example systems.
  2. Star schema vs Snowflake schema vs Galaxy schema — pros/cons.
  3. Fact table vs Dimension table.
  4. Types of fact tables — transactional, periodic snapshot, accumulating snapshot, factless.
  5. Types of dimensions — conformed, junk, degenerate, role-playing, slowly changing.
  6. Explain all SCD types (0, 1, 2, 3, 4, 6) with examples.
  7. Surrogate key vs natural key — why surrogate is preferred.
  8. What is a bridge table?
  9. What is a date dimension? Why mandatory?
  10. Kimball vs Inmon vs Data Vault — when to choose each.
  11. What is Data Vault 2.0? (Hubs, Links, Satellites.)
  12. What is One Big Table (OBT) / wide tables? Pros & cons.
  13. What is medallion architecture (bronze/silver/gold)?
  14. What is a semantic layer?
  15. How do you design a slowly evolving multi-source dimension?

📐 Modeling Scenarios

  1. Design a data model for an e-commerce platform (orders, customers, products, returns, promotions).
  2. Design a model for ride-sharing (Uber-like): trips, drivers, riders, surge pricing, ratings.
  3. Design a model for banking transactions with multi-currency and reversals.
  4. Design a model for SAP PP (production orders, routings, work centres) into Snowflake.
  5. Design a model for SaaS subscriptions (sign-ups, plans, renewals, churn, MRR/ARR).
  6. How would you track currency conversion historical FX rates? (Type 2 dimension.)
  7. Model a clickstream pipeline (events, sessions, users, pages).
  8. Design a slowly changing customer dimension with multiple addresses.
  9. Design data model for IoT sensors (millions of devices, telemetry every second).
  10. Design a model for a healthcare claims processing system.
  11. How do you model many-to-many relationships in a star schema?
  12. How do you handle event-level vs aggregated facts in the same warehouse?
  13. How do you handle product hierarchy changes over time?
  14. Design a model where granularity differs between facts.
  15. Design a model for a BI dashboard with sub-second response time on a billion rows.

🏗 System Design — Data Engineering

How to answer: Use a 6-step framework — (1) Clarify requirements (functional + non-functional, volume, latency, SLA) → (2) High-level architecture (ingest → store → process → serve) → (3) Storage choice (S3, Snowflake, OLTP, KV) → (4) Processing (batch / stream / micro-batch) → (5) Quality, monitoring, security, cost → (6) Trade-offs & bottlenecks.

Always Discuss

  • Functional + non-functional requirements
  • Volume, velocity, variety
  • Latency SLA (real-time vs batch)
  • Schema and data contracts
  • Idempotency and exactly-once
  • Backfill and replay strategy
  • Data quality & observability
  • Security (PII, encryption, RBAC)
  • Cost & right-sizing
  • DR & disaster recovery

Common Building Blocks

  • Source: RDBMS, API, files, Kafka, IoT
  • CDC: Debezium / AWS DMS
  • Queue: Kafka / Kinesis / SQS
  • Lake: S3 (raw / curated / refined)
  • Process: Spark / Glue / EMR / Flink
  • Warehouse: Snowflake / Redshift
  • Transform: dbt
  • Orchestrate: Airflow / Step Functions
  • Serve: BI, API, ML feature store
  • Monitor: CloudWatch / Datadog / Grafana

🔥 Classic DE System Design Problems

  1. Design an end-to-end batch pipeline: ingest 100 GB/day from MySQL → S3 → transform → Snowflake → BI tool.
  2. Design a real-time streaming pipeline: 1 M events/sec clickstream → process → serve dashboards with < 5 s latency.
  3. Design a CDC pipeline: capture changes from 50 production tables and replicate to Snowflake with < 1 min lag.
  4. Design a data lake on S3 with bronze/silver/gold layers, partitioning, file size targets, and access patterns.
  5. Design a data warehouse on Snowflake/Redshift for an e-commerce platform (orders, returns, inventory, marketing).
  6. Design an ingestion framework that onboards a new source in < 1 day via config (no code).
  7. Design a metadata / data catalog with lineage and ownership.
  8. Design a data quality framework with rules, dashboards, alerts, and SLAs.
  9. Design SCD Type 2 at scale for a 100M-row dimension with hourly updates.
  10. Design exactly-once pipeline: Kafka → Spark Structured Streaming → S3 (Delta) → Snowflake.

🎓 Advanced / Senior Problems

  1. Design a multi-tenant data platform with logical isolation and shared compute.
  2. Design a feature store (online + offline) for ML.
  3. Design a GDPR-compliant pipeline: right-to-be-forgotten, encryption, audit log.
  4. Design a streaming join of two unbounded streams (e.g., order events + payment events).
  5. Design a self-service analytics layer for analysts using dbt + BI tool.
  6. Design a migration from on-prem Hadoop/Hive to AWS + Snowflake — phased rollout, validation, cutover.
  7. Design a cost-optimisation framework across S3, Snowflake, EMR — measure ROI.
  8. Design data observability: freshness, volume, schema, distribution, lineage monitoring.
  9. Design a backfill system that can reprocess 1 year of data without breaking incremental loads.
  10. Design a fraud detection pipeline with < 100 ms inference latency.
  11. Design an ad-impressions pipeline handling 10 B events/day with deduplication.
  12. Design a marketplace order pipeline (Uber/Swiggy) — order → assignment → delivery → settlement.
  13. Design an IoT data platform for 10 M devices reporting every 10 seconds.
  14. Design a near-real-time inventory system across 500 warehouses.
  15. Design an A/B testing analytics pipeline with statistical significance computation.

📐 Non-Functional Deep-Dives

  1. How would you handle 10x growth in data volume next year?
  2. What is your strategy if the warehouse is becoming the bottleneck?
  3. How would you reduce monthly cloud bill by 30% without compromising SLAs?
  4. How would you migrate a critical pipeline with zero downtime?
  5. How would you design DR with RPO = 15 min and RTO = 1 hour?
  6. How would you handle PII across the whole platform?
  7. How would you implement role-based access on 5000 tables across 200 teams?
  8. How would you do tenant-level chargeback in a shared warehouse?
  9. How would you set up automated data contracts between producer and consumer teams?
  10. How would you implement a data mesh in a 1000-employee org?

🧩 Scenario-Based / Troubleshooting

📞 Production Incidents

  1. Your daily pipeline missed SLA and stakeholders are angry — what do you do in the next 30 minutes?
  2. A Spark job that ran in 1 hour yesterday is taking 5 hours today. How do you debug?
  3. You see duplicate rows in the final fact table. Walk through your investigation.
  4. The source system started sending an extra column. Pipeline silently failed. What's wrong with your design? How do you fix it?
  5. Snowflake bill spiked 3x last month. How do you investigate and fix?
  6. Airflow scheduler is unresponsive in production. What checks do you run?
  7. A consumer in Kafka is lagging by 1 hour. How do you triage?
  8. Glue job fails intermittently with timeout — what could be wrong?
  9. Data quality dashboard shows row count dropped by 20% today. What do you check?
  10. Reports show wrong numbers but pipeline succeeded. What's the playbook?
  11. The data lake on S3 grew from 50 TB to 500 TB in 6 months. How do you control it?
  12. A Redshift query is taking 30 minutes — same query was 30 seconds a week ago. Steps?
  13. A dbt model is producing NULLs in primary key column. Where do you start?
  14. Snowflake task chain stops mid-way every 3rd day. Investigation?
  15. Lambda function processing S3 events is throttling. Why and how to fix?

⚙️ Design Trade-Offs

  1. Should I use Snowflake or Redshift for this workload?
  2. Should this be batch or streaming?
  3. Should I store this in S3 or in Snowflake directly?
  4. Should I write this transformation in Spark or in dbt + Snowflake SQL?
  5. Should I use Glue or EMR for this ETL?
  6. Should I use Airflow or Step Functions?
  7. Should I use Kafka or Kinesis?
  8. Should I do CDC via DMS, Debezium, or hand-rolled?
  9. Should I use Iceberg, Hudi, or Delta?
  10. Should I partition by date or by customer_id?
  11. Should the warehouse use SCD2 or daily snapshots?
  12. Should I de-duplicate at ingest or at transformation?
  13. Should we centralise transformations or push down to source?
  14. Should the team adopt data mesh or stay centralised?
  15. Should we adopt dbt Cloud, dbt Core on Airflow, or stored procedures?

🚨 Edge Cases & Gotchas

  1. How do you handle timezone differences across multiple source systems?
  2. How do you handle UTF-8 vs Latin-1 / weird characters in CSV?
  3. How do you handle nested JSON with arrays of objects?
  4. How do you handle PII columns that need to be hashed?
  5. How do you reprocess only one day of data without breaking history?
  6. How do you handle a producer that occasionally sends bad schema?
  7. How do you detect a silent failure where pipeline runs but data is wrong?
  8. How do you handle a slowly evolving dimension whose key is reused?
  9. How do you handle delete events in CDC?
  10. How do you handle clock skew between source and target?
  11. How do you handle currency rounding in financial pipelines?
  12. How do you handle GDPR right-to-be-forgotten request for a record in 100 places?
  13. How do you handle file size of 10 MB vs 10 GB in the same job?
  14. How do you handle a source that disappears for 3 days then sends backlog?
  15. How do you handle two pipelines writing to the same Snowflake table?

🛠 DevOps · CI/CD · Docker · Git · Terraform

🔥 Git

  1. Explain Git branching strategies: Git Flow, GitHub Flow, Trunk-based.
  2. Difference between merge and rebase. When to use each?
  3. What is a fast-forward merge?
  4. How do you resolve merge conflicts?
  5. Difference between git fetch and git pull.
  6. How to undo the last commit? (reset, revert, checkout.)
  7. What is git cherry-pick?
  8. What is a detached HEAD?
  9. How do you handle a large binary file in Git? (Git LFS.)
  10. How do you squash multiple commits before PR?
  11. What is rebase --interactive?
  12. How do you set up pre-commit hooks?
  13. What's a good PR review checklist?
  14. What is semantic commit message style?
  15. How do you handle secrets accidentally committed?

🐳 Docker & Containers

  1. What is Docker? Image vs container vs Dockerfile vs registry.
  2. Difference between CMD and ENTRYPOINT.
  3. What is multi-stage build? Why use it?
  4. How do you reduce image size?
  5. What is .dockerignore?
  6. How do you pass secrets to a container? (env, build secrets, mount.)
  7. What is Docker Compose? Use case in DE.
  8. Difference between Docker volumes and bind mounts.
  9. How do you debug a container that exits immediately?
  10. How do you run a Spark / Airflow / dbt project locally with Docker?

⚙️ CI/CD

  1. What is CI vs CD vs CD (delivery vs deployment)?
  2. How do you set up CI for a dbt project? (GitHub Actions / GitLab CI.)
  3. How do you do CI for an Airflow DAG repo?
  4. What is Slim CI in dbt?
  5. How do you do environment promotion (dev → staging → prod)?
  6. How do you test SQL pipelines automatically?
  7. What is feature branching vs trunk-based deployment for DE?
  8. How do you do blue-green deployment for a data pipeline?
  9. How do you roll back a bad deployment?
  10. How do you handle pipeline migrations / schema migrations safely?

🎓 Terraform / IaC & Kubernetes (Bonus)

  1. What is IaC? Why is it important for data platforms?
  2. What is the Terraform state file? Where do you store it for a team?
  3. Difference between terraform plan and apply.
  4. How do you handle multiple environments in Terraform? (workspaces vs folders.)
  5. What is a Terraform module? When to write one?
  6. What is drift in Terraform?
  7. What is Kubernetes? Pod vs Deployment vs Service.
  8. What is the role of Helm?
  9. What is a CronJob in Kubernetes? Use case for DE.
  10. How do you run Spark on Kubernetes?

💻 Coding / DSA (Mostly Python)

What to expect: Data Engineer coding rounds are not hard algorithm rounds like SDE. Expect easy–medium problems on strings, lists, dicts, files, and one or two design-coding questions. Master string manipulation, deduplication, frequency counts, sorting, sliding window, two-pointer.

🔥 Most Asked Coding Problems

  1. Reverse a string / sentence / linked list.
  2. Find the first non-repeating character in a string.
  3. Check if two strings are anagrams.
  4. Find all anagrams of a word in a list.
  5. Find duplicates in a list / array.
  6. Remove duplicates while preserving order.
  7. Two sum / three sum problem.
  8. Find longest substring without repeating characters.
  9. Find the missing number in a list of 1..n.
  10. Find the most frequent element / top-k frequent words.
  11. Merge two sorted lists / arrays.
  12. Implement word count for a 100 GB log file (chunked reading).
  13. Flatten a nested dictionary / JSON.
  14. Group anagrams.
  15. FizzBuzz with twist.
  16. Find pairs of elements that sum to K (single pass).
  17. Compute the moving average of a stream.
  18. Implement LRU cache.
  19. Validate parentheses / balanced brackets.
  20. Rotate a list / array by K positions.
  21. Find the intersection / union of two arrays / lists.
  22. Reverse words in a sentence in-place.
  23. Find the kth largest element (heap).
  24. Compress a string (aaabb → a3b2).
  25. Implement an iterator class (or generator) over a paginated API.

🐍 Python-Heavy DE Coding

  1. Read a JSON file line by line and aggregate counts by field X.
  2. Given two CSV files (orders, customers), join them in Python without Pandas.
  3. Compute SCD Type 2 for a small dataset in Pandas / Python.
  4. Detect schema drift between two JSONs (added/removed/changed keys).
  5. Parse a deeply nested JSON and flatten to a single-level dict.
  6. Compute top 10 customers by revenue from a 5 GB CSV (chunked).
  7. Implement an idempotent retry decorator with exponential backoff.
  8. Write a function that detects duplicates across millions of rows efficiently (hash, Bloom filter).
  9. Implement a producer-consumer pattern with queue.Queue and threads.
  10. Implement a generator that paginates an API and yields records.
  11. Parse a CSV with quoted commas correctly (csv module nuances).
  12. Compute the percentile of a list without numpy.
  13. Find the shortest path / dependencies in a DAG of tasks (topological sort).
  14. Implement rate-limited API client (token bucket).
  15. Build a small ETL framework class with extract / transform / load methods.

🎓 PySpark Coding Snippets

  1. Read all CSVs in a folder, union them, dedupe on a key (latest), write Parquet partitioned by date.
  2. Implement SCD Type 2 in PySpark using MERGE on a Delta table.
  3. Compute 7-day rolling average per user using window functions.
  4. Handle skew on join — implement salting.
  5. Read JSON with nested arrays, explode, flatten and write as Parquet.
  6. Group by user and collect last 5 events as an array.
  7. Compute the difference between consecutive timestamps per user.
  8. Pivot a DataFrame: from long to wide.
  9. Read from Kafka, transform, write to Snowflake (Structured Streaming).
  10. Implement de-duplication on a stream using dropDuplicatesWithinWatermark.

🤝 Behavioral / HR / Managerial

Framework: Use STAR — Situation, Task, Action, Result. Keep stories crisp (90 seconds). Have at least 5 reusable stories: one about ownership, one about failure, one about conflict, one about scale/impact, one about learning.

🟢 Leadership & Ownership

  1. Tell me about a time you led a project end-to-end.
  2. Describe a time you took ownership beyond your role.
  3. How do you handle ambiguous requirements?
  4. How do you mentor / onboard a junior?
  5. Describe a decision you made that significantly impacted the business.
  6. Tell me about a time you influenced without authority.
  7. Describe how you drive a cross-team initiative.
  8. What's the biggest improvement you brought to your team's processes?
  9. Tell me a time you owned a production incident from detection to RCA.
  10. How do you balance tech debt vs new features?

🟢 Conflict, Failure, Learning

  1. Tell me about a disagreement with your manager / peer. How did you resolve it?
  2. Describe a project that failed. What did you learn?
  3. Tell me about feedback you received that was hard to hear.
  4. A time when you missed a deadline — what happened, what did you change?
  5. A time you made a major production mistake — how did you recover?
  6. How do you handle a stakeholder who keeps changing scope?
  7. Tell me about a time you had to push back on a request.
  8. Describe a peer code review that turned into a conflict.
  9. How do you handle being on call?
  10. How do you handle stress / tight deadlines?

🟢 Scale, Impact, Growth

  1. Tell me about the biggest project you worked on by data volume / impact.
  2. How did you measure success of a pipeline you built?
  3. How have you saved cost / time / effort in past role?
  4. What is the most innovative thing you have built?
  5. Tell me about a time you simplified a complex process.
  6. What's your approach to continuous learning?
  7. What new tool did you introduce in your team — how did it go?
  8. How do you prioritise when everything is "P1"?
  9. What is your long-term career goal?
  10. Why are you leaving your current company?

🟢 HR & Closing

  1. Why do you want to join our company?
  2. What do you know about our team / product?
  3. Why should we hire you?
  4. Why this role vs your current job?
  5. What are your strengths and weaknesses (3 each, with examples)?
  6. What is your expected salary / current CTC / notice period?
  7. Are you interviewing elsewhere? What stage?
  8. How do you keep yourself updated on data engineering trends?
  9. What books / blogs / podcasts do you follow?
  10. Do you have any questions for us? (Always have 3 ready.)
3 Smart Questions to Ask the Interviewer:
1. What does success in this role look like in 6 months?
2. What is the biggest data engineering challenge the team is facing right now?
3. What does the data stack look like, and what are you considering changing?