FAANG Data Engineer Interview Preparation Guide - Mid Level
This guide is based on general FAANG interview practices and may not reflect specific company procedures.
FAANG companies typically conduct 8-9 interview rounds for mid-level data engineers, spanning technical assessments (coding, SQL, architecture design), case studies, and behavioral evaluations. Each round is designed to assess different competencies: coding proficiency, SQL and data modeling expertise, data pipeline architecture design, big data framework knowledge, cloud platform expertise, and cultural fit. The process emphasizes problem-solving approach, communication skills, ability to work across teams, and mentorship potential.
Interview Rounds
Recruiter Screening
What to Expect
This initial 30-minute phone call with a recruiter assesses your background, motivation, and basic understanding of the data engineer role. The recruiter will review your resume, discuss your previous experience with data pipelines, infrastructure, and technologies, and verify cultural alignment. Expect questions about why you're interested in data engineering, what excites you about building data systems at scale, and your career trajectory. This round serves as a filter to ensure you meet baseline requirements and have genuine interest in the role before proceeding to technical interviews.
Tips & Advice
Have a clear, concise elevator pitch highlighting your data engineering experience and genuine enthusiasm for building data infrastructure. Review the job description thoroughly and identify 2-3 specific aspects that excite you (e.g., working with petabyte-scale data, designing ETL pipelines, working with Spark, specific cloud platforms mentioned). Discuss your resume in detail, especially projects involving data pipeline development, ETL/ELT processes, data warehousing, or cloud data platforms. Prepare examples of how you've solved data infrastructure problems. Research the company's tech stack if possible and mention relevant experience. Be conversational and authentic—recruiters assess cultural fit and communication as much as technical qualifications. Prepare questions about the role and team that show genuine interest.
Focus Topics
Motivation and Career Alignment
Clear understanding of why you want the data engineer role and how it aligns with career trajectory. Demonstrating thoughtfulness about growth opportunities, technical challenges, and company mission.
Practice Interview
Study Questions
Communication and Professional Presence
Articulating technical concepts clearly and professionally. Demonstrating confidence and enthusiasm without arrogance. Active listening to recruiter questions and authentic engagement in conversation.
Practice Interview
Study Questions
Resume Deep Dive and Experience Walkthrough
Thorough understanding of your background including data pipeline projects, technologies used (Spark, Hadoop, cloud platforms), infrastructure built, metrics/impact achieved, and lessons learned. Connecting past experiences directly to role requirements.
Practice Interview
Study Questions
Technical Screening Call
What to Expect
A 60-minute remote technical interview where you'll solve 1-2 practical coding problems, typically one in Python and one in SQL. The Python problem often involves data manipulation and algorithmic thinking (similar to what you'd implement in a data pipeline). The SQL problem tests ability to write and optimize queries. You'll code in a shared environment, explain your thinking, discuss approaches, and optimize your solution. The interviewer assesses problem-solving methodology, coding fluency, understanding of data structures and algorithms, and ability to communicate technical ideas clearly. They're looking for clean code, correct logic, edge case handling, and optimization thinking.
Tips & Advice
Practice live coding on platforms like LeetCode, HackerRank, or CodeSignal, focusing on medium-difficulty problems involving data manipulation. Start by understanding requirements fully—ask clarifying questions about data size, constraints, and expected output format. Outline your approach verbally before coding, discussing time and space complexity estimates. Write clean, readable code with meaningful variable names. Test edge cases thoroughly (empty inputs, single elements, duplicates, negative numbers). If you get stuck, think out loud; interviewers value your problem-solving process over perfect code. For SQL problems, practice writing queries with CTEs, window functions, and proper indexing considerations. Focus on problems involving data filtering, aggregation, joining datasets, and handling missing data—all common in data engineering. Optimize progressively: first get the correct solution, then improve efficiency. Be ready to discuss further optimizations even after solving.
Focus Topics
Problem-Solving Approach and Code Communication
Systematically breaking down problems, clarifying requirements, discussing approach before coding, and explaining trade-offs. Demonstrating ability to incrementally debug and optimize. Asking clarifying questions and thinking out loud to show reasoning.
Practice Interview
Study Questions
Python Data Manipulation and Algorithms
Proficiency with Python data structures (lists, dictionaries, sets, tuples) and operations. Understanding algorithmic approaches to common problems (searching, sorting, counting, deduplication). Writing Pythonic, efficient code. Familiarity with libraries like collections (Counter, defaultdict) for efficient solutions.
Practice Interview
Study Questions
SQL Query Writing and Optimization
Writing correct SQL queries using WHERE, GROUP BY, HAVING, ORDER BY, JOINs. Understanding JOIN types and when to use each. Query optimization basics: indexes, execution plans, and efficient filtering. Writing CTEs and subqueries appropriately.
Practice Interview
Study Questions
SQL and Data Modeling Deep Dive
What to Expect
A 60-minute on-site or virtual interview focused on advanced SQL and database schema design. You'll tackle complex SQL problems involving multiple joins, window functions, CTEs, aggregations, and subqueries. You may also design database schemas for business scenarios, considering normalization, denormalization trade-offs, and query performance implications. The interviewer assesses SQL expertise, understanding of relational database concepts, ability to optimize queries, and schema design maturity. Expect problems like 'Design a database schema for an e-commerce platform' or 'Write a query to find the top-spending customer per month.' You should clearly communicate reasoning for design choices and discuss alternative approaches and their trade-offs.
Tips & Advice
Practice complex SQL extensively using LeetCode, Mode SQL Tutorial, or HackerRank. Master window functions (ROW_NUMBER, RANK, DENSE_RANK, LAG, LEAD, RUNNING_SUM) and CTEs (WITH clauses). Understand different JOIN types and performance implications. Practice query optimization: use EXPLAIN plans to understand query execution, think about indexing strategies, and consider column selectivity. For schema design problems, start by understanding business requirements and identifying entities, relationships, and access patterns. Normalize appropriately but be ready to discuss denormalization trade-offs for analytical workloads. Use entity-relationship diagrams to communicate your design. Always discuss multiple approaches: why you chose this design over alternatives, what trade-offs you're making (query performance vs. storage, flexibility vs. complexity), and when you'd revisit the design. Practice writing queries and explaining execution plans out loud.
Focus Topics
Query Performance Optimization
Understanding query execution plans and how to read EXPLAIN output. Index design strategies (B-tree, hash) and when to use indexes. Identifying bottlenecks: full table scans, expensive joins, data skew. Proposing optimizations: better indexes, query restructuring, denormalization.
Practice Interview
Study Questions
Relational Database Schema Design and Normalization
Understanding normalization principles (1NF, 2NF, 3NF, BCNF), primary and foreign keys, relationships (one-to-one, one-to-many, many-to-many). Designing efficient schemas considering query patterns. Ability to identify and resolve schema design issues.
Practice Interview
Study Questions
Advanced SQL Query Writing
Writing complex SQL using window functions, CTEs, subqueries, set operations, and common table expressions. Handling multi-table joins, complex aggregations, time-series analysis, and ranking problems. Deep understanding of GROUP BY, HAVING, DISTINCT, and ORDER BY semantics.
Practice Interview
Study Questions
Data Pipeline Architecture and Design
What to Expect
A 75-minute technical interview where you design end-to-end data pipeline and architecture solutions for business problems. You might be asked: 'Design a data pipeline to ingest and process real-time clickstream data from a mobile app' or 'How would you build a data warehouse for an e-commerce company?' You'll clarify requirements, propose architecture (data sources → ingestion → storage → processing → consumption), justify technology choices, address scalability and reliability, and discuss data quality and monitoring strategies. The interviewer assesses architectural thinking, understanding of data engineering patterns (ETL vs. ELT, batch vs. real-time, data warehouse vs. data lake), technology trade-offs, and ability to design systems that handle scale. This is where you demonstrate systems thinking and engineering maturity.
Tips & Advice
Start by asking clarifying questions: What data volume? What's the required latency (real-time vs. batch)? What are key metrics and use cases? Who are consumers (analysts, scientists, business teams)? What's the current state? Draw a clear architecture diagram showing data flow from sources through processing to consumption. For each component, discuss technology choices with explicit reasoning. For example: 'We need Kafka for real-time data streaming because [reason]; S3 for data lake because [reason]; Spark for processing because [reason].' Address non-functional requirements: How does it scale if traffic increases 10x? How do you handle failures and retry logic? How do you monitor and alert? How do you ensure data quality? Discuss partitioning strategies for storage (by date, customer ID, etc.) based on access patterns. Consider batch vs. real-time trade-offs: latency requirements, complexity, costs. For batch: discuss scheduling, dependency management, incremental vs. full refreshes. For streaming: discuss event ordering, exactly-once vs. at-least-once semantics, backpressure handling. Mention lessons from real projects. Be prepared to pivot if questioned—discuss alternatives and why you didn't choose them. Reference trade-offs explicitly throughout.
Focus Topics
Data Quality, Validation, and Observability
Designing data quality frameworks with validation checks, anomaly detection, and SLAs. Building monitoring and alerting for pipeline failures, data quality issues, and performance degradation. Implementing observability: logging, metrics, traces. Designing debugging strategies.
Practice Interview
Study Questions
Technology Selection and System Trade-offs
Comparing and selecting appropriate technologies (Kafka vs. Pub/Sub, Spark vs. Flink, Redshift vs. BigQuery vs. Synapse) based on requirements. Understanding trade-offs: cost, latency, complexity, operational overhead, team expertise, learning curve.
Practice Interview
Study Questions
ETL vs. ELT Patterns and Processing Strategy
Understanding Extract-Transform-Load vs. Extract-Load-Transform approaches. Knowing when to transform before loading (ETL) vs. after (ELT). Trade-offs: data quality, flexibility, performance, and operational complexity. Choosing batch processing, streaming, or hybrid approaches based on requirements.
Practice Interview
Study Questions
Data Pipeline Architecture and Design Patterns
Designing complete data pipelines from ingestion through processing to consumption. Understanding architectural patterns: Lambda architecture (batch + real-time), Kappa architecture (streaming only), event streaming. Designing data flow, component interactions, and integration points. Considering scalability, reliability, and maintainability.
Practice Interview
Study Questions
Apache Spark and Distributed Processing
What to Expect
A 60-minute technical interview assessing proficiency with Apache Spark and distributed data processing. You'll solve coding problems using Spark DataFrames or RDDs, optimize Spark jobs, and discuss distributed computing concepts. Typical problems: 'Write a Spark job to process a large dataset and compute aggregations' or 'Optimize this Spark pipeline that's taking too long.' You may also discuss MapReduce concepts, Hadoop, and other distributed processing frameworks. The interviewer evaluates your understanding of distributed computing principles, Spark architecture, lazy evaluation, partitioning, shuffles, and ability to write scalable data processing code.
Tips & Advice
Practice PySpark or Scala extensively using DataCamp, Spark documentation, or by building sample projects. Understand RDDs vs. DataFrames vs. Datasets and when to use each (generally prefer DataFrames). Master DataFrame API: transformations (select, filter, flatMap, groupBy, agg) and actions (collect, count, write). Understand lazy evaluation: transformations don't execute until an action is called. Learn DAG (Directed Acyclic Graph) concept and how Spark builds execution plans. Practice optimizing Spark jobs: minimize shuffles (they're expensive), use narrow transformations when possible, partition appropriately, cache intermediate results when reused, broadcast small DataFrames for large lookups. Understand memory management and OOM errors. For interview problems, think about data distribution: how many partitions? Will it fit in memory? Explain your reasoning for partitioning and shuffle decisions. Discuss caching strategies and when to cache vs. when it's wasteful. Mention performance implications of operations (which cause shuffles, which are narrow, etc.).
Focus Topics
Spark Performance Tuning and Optimization
Techniques for optimizing Spark jobs: partitioning strategy, caching vs. persistence trade-offs, broadcast variables for efficient lookups, avoiding wide transformations, memory management. Understanding Spark UI for debugging and profiling. Handling data skew.
Practice Interview
Study Questions
Distributed Processing Patterns and Shuffle Optimization
Understanding map-reduce patterns and how Spark distributes computation. Understanding shuffle operations: how they work, why they're expensive, when they occur. Strategies to minimize shuffles: narrow transformations, repartitioning strategically, using broadcast joins for small DataFrames.
Practice Interview
Study Questions
Apache Spark Architecture and DataFrame/RDD Concepts
Understanding Spark's architecture: driver, executors, executor memory, partitions, and DAG. RDDs vs. DataFrames vs. Datasets: when to use each. Lazy evaluation and action vs. transformation distinction. Using DataFrame API for most operations due to Catalyst optimizer benefits.
Practice Interview
Study Questions
Cloud Data Platforms and Infrastructure
What to Expect
A 60-minute interview focused on cloud data platforms and infrastructure. You'll discuss services like AWS (Redshift, S3, EMR, Glue, Kinesis), Azure (Synapse, Data Lake Storage, Data Factory), or GCP (BigQuery, Dataflow, Cloud Storage, Pub/Sub). Expect questions: 'How would you build a data warehouse on AWS?' or 'Design a scalable data ingestion system on GCP.' You'll discuss technology choices, architecture design, cloud-native patterns, cost optimization, security, and governance. The interviewer assesses knowledge of cloud services, architectural decision-making, ability to leverage cloud capabilities effectively, and understanding of operational considerations like cost, compliance, and security in cloud environments.
Tips & Advice
Familiarize yourself thoroughly with at least one major cloud platform by working through tutorials, building sample projects, and understanding pricing. For AWS: study S3 (partitioning, prefixes), Redshift (architecture, distribution keys, sort keys), EMR (launching clusters, Spark on EMR), Glue (ETL jobs, crawlers, data catalog), Kinesis (streams, shards), Lambda. For Azure: learn Synapse (dedicated and serverless SQL pools), Data Lake Storage Gen2 (hierarchical namespace), Data Factory (pipelines, activities), Stream Analytics. For GCP: understand BigQuery (architecture, cost model, ML integration), Dataflow (Apache Beam), Cloud Storage (buckets, lifecycle policies), Pub/Sub. Build hands-on experience: create a data pipeline on your chosen platform, ingest real or sample data, run queries, understand cost implications. Understand cloud-native services vs. traditional approaches. Learn about serverless vs. managed options (trade-offs). Understand data formats for cloud storage (Parquet, ORC, CSV) and partitioning strategies. Learn security basics: IAM, encryption, VPCs. Discuss cost optimization: reserved capacity, data lifecycle management. Be ready to compare platforms for specific use cases—this shows thoughtful decision-making.
Focus Topics
Cloud Security, Governance, and Cost Management
Understanding cloud security practices (IAM roles and policies, encryption at rest and in transit, VPCs, network security). Data governance: access control, audit logging, compliance (GDPR, CCPA). Cost optimization strategies: reserved capacity, lifecycle policies, data tiering. Building secure, compliant data pipelines.
Practice Interview
Study Questions
Azure Data Platforms (Synapse, Data Lake Storage, Data Factory)
Understanding Azure's data ecosystem: Synapse for data warehousing with both dedicated and serverless SQL pools, Data Lake Storage Gen2 for enterprise data lakes, Data Factory for orchestration. Understanding how components integrate and when to use each for different workloads.
Practice Interview
Study Questions
GCP Data Services (BigQuery, Dataflow, Cloud Storage, Pub/Sub)
Proficiency with GCP data services: BigQuery for serverless data warehousing with built-in ML, Dataflow for Apache Beam pipelines, Cloud Storage for data lake, Pub/Sub for messaging. Understanding BigQuery's cost model and performance characteristics. Knowing when to use each service.
Practice Interview
Study Questions
Cloud Data Warehouse Design and Optimization
Designing scalable data warehouses on cloud platforms. Understanding denormalization for analytics (star schema, snowflake schema). Cloud-specific concepts: distribution keys (Redshift), sort keys, partitioning strategies, clustering (BigQuery). Handling incremental loading, slowly changing dimensions, and time-series data efficiently.
Practice Interview
Study Questions
AWS Data Services (Redshift, S3, EMR, Glue, Kinesis)
Proficiency with AWS data ecosystem: S3 for data lake storage and object lifecycle, Redshift for data warehousing and complex queries, EMR for managed Spark/Hadoop clusters, Glue for serverless ETL jobs and data catalog, Kinesis for real-time streaming. Knowing when to use each service and how to integrate them into cohesive solutions.
Practice Interview
Study Questions
Case Study and Project-Based Assessment
What to Expect
A 90-minute comprehensive assessment where you design an end-to-end solution for a realistic data engineering problem. You'll receive a business scenario (e.g., 'Build a data pipeline for real-time analytics serving a mobile app with millions of users' or 'Design a data warehouse for a multi-country logistics company'). You must: clarify requirements, propose architecture, justify technology choices, outline implementation approach, discuss trade-offs, and address non-functional requirements. This may be a live design session or take-home project completed before the interview. You should provide clear documentation: architecture diagrams, technology justifications, trade-off analysis, and implementation roadmap. The interviewer assesses holistic problem-solving, informed decision-making under constraints, communication clarity, and engineering maturity. This round validates that you can apply all skills learned in previous rounds to deliver cohesive, production-ready solutions.
Tips & Advice
Treat this like a real project you'd own. Start by asking clarifying questions: data volume and growth trajectory? Required latency? Key business metrics and use cases? Current systems and constraints? Team size and expertise? Budget constraints? Timeline? Create a clear architecture diagram showing all components (sources, ingestion, storage, processing, consumption) and data flow. For each technology choice, provide explicit reasoning: 'We chose Kafka for streaming because [specific reason]; S3 for data lake because [specific reason]; Spark for processing because [specific reason].' Document trade-offs at each decision point: why Kafka over Pub/Sub? Why Spark over Flink? Acknowledge that different choices fit different constraints. Include non-functional considerations: How does it scale 5x, 10x? How do you handle failures? What monitoring and alerts are needed? How do you ensure data quality? What about security and compliance? Outline implementation phases and team structure. For take-home projects, submit well-documented work with diagrams, clear writing, and thoughtful analysis. In live discussions, be prepared to defend choices and pivot if challenged. Reference patterns and lessons from actual projects. Show maturity by acknowledging limitations, discussing what you'd do differently with more resources, and planning for monitoring/observability from the start.
Focus Topics
Communication and Technical Documentation
Clearly communicating complex technical ideas through diagrams (architecture diagrams, data flow diagrams, ER diagrams), written documentation, and verbal explanation. Making designs easy for others to understand, build upon, and maintain.
Practice Interview
Study Questions
Implementation Planning and Execution Strategy
Creating actionable implementation plans with phases, dependencies, and resource requirements. Identifying risks and mitigation strategies. Outlining development approach, testing strategy, and deployment plan. Understanding project management and cross-functional collaboration.
Practice Interview
Study Questions
Technical Trade-off Analysis and Decision Making
Ability to weigh multiple options (batch vs. real-time, managed vs. self-managed, vendor vs. open-source, cost vs. flexibility) and make informed decisions grounded in requirements. Explicitly acknowledging trade-offs rather than pretending solutions are perfect.
Practice Interview
Study Questions
End-to-End Data Pipeline Design
Designing complete data solutions from problem statement through implementation and operations. Integrating data ingestion, transformation, storage, and consumption layers. Considering scalability, reliability, maintainability, and operational simplicity holistically. Making coherent architectural choices that work together.
Practice Interview
Study Questions
Behavioral and Leadership Interview
What to Expect
A 60-minute interview assessing cultural fit, collaboration, and leadership principles. You'll discuss past experiences using the STAR method (Situation, Task, Action, Result). Expect questions like: 'Tell about a time you resolved conflict with a team member,' 'Describe a project failure and what you learned,' 'Give an example of mentoring a junior engineer,' 'How do you handle ambiguity?' The interviewer evaluates whether you embody FAANG leadership principles, work effectively in ambiguous environments, communicate across teams, demonstrate growth mindset, and have mentorship potential. For mid-level positions, expect emphasis on owning projects, contributing to team culture, and developing others—not executive-level leadership.
Tips & Advice
Prepare 6-8 compelling stories covering diverse themes: overcoming technical challenges, learning from failure, teamwork and collaboration, mentorship and developing others, owning projects and driving impact, conflict resolution, handling ambiguity, and customer focus. Use the STAR method: describe the Situation and your role, explain the Task, detail specific Actions you took, and quantify Results. Practice delivering stories in 2-3 minutes each. Tailor stories to FAANG principles if possible: Amazon (Customer Obsession, Ownership, Invent and Simplify, Think Big), Google (Collaboration, Integrity, Excellence), Meta (Move Fast, Focus on Impact, Be Bold). Be authentic—interviewers detect rehearsed or exaggerated responses. Show self-awareness by discussing mistakes honestly and what you learned. Highlight collaborative examples showing how you worked with others to achieve goals. For mid-level position, emphasize mentorship with concrete examples: helped junior engineer grow from [initial capability] to [improved capability], led onboarding for new team member, etc. Prepare thoughtful questions about team culture, technical direction, growth opportunities, and how they support engineer development. Practice with a friend or mock interviewer to get feedback on delivery and authenticity.
Focus Topics
Mentorship and Developing Team Members
Examples of helping junior engineers and team members grow. Concrete instances of mentoring, knowledge sharing, constructive feedback, and creating learning opportunities. Demonstrating investment in others' success and team capability development.
Practice Interview
Study Questions
Handling Ambiguity and Learning Agility
Comfort with unclear situations and incomplete information. Ability to ask the right questions, break down ambiguity, and move forward. Examples of learning new technologies or domains quickly, adapting to change, learning from failures, and growth mindset.
Practice Interview
Study Questions
Ownership and Impact Orientation
Taking ownership of problems and projects, driving them to completion, and measuring impact. Examples of going beyond requirements to deliver value, solving problems proactively, and owning outcomes rather than just tasks.
Practice Interview
Study Questions
FAANG Leadership Principles and Cultural Values
Understanding and embodying company-specific leadership principles and values. For Amazon: Customer Obsession, Ownership, Invent and Simplify, etc. Aligning experiences and communication with these principles. Demonstrating how your approach reflects company values through concrete examples.
Practice Interview
Study Questions
Teamwork and Cross-Functional Collaboration
Ability to work effectively with diverse team members (data scientists, analysts, platform engineers), communicate clearly, and contribute to collective success. Examples of supporting colleagues, asking for help when needed, and sharing knowledge generously. Demonstrating collaborative rather than individualistic approach.
Practice Interview
Study Questions
Hiring Manager Round
What to Expect
A final 45-minute conversation with the hiring manager or engineering lead for the team. This round is less adversarial than previous technical rounds; it focuses on verification of technical depth, team fit, and long-term potential. The hiring manager will discuss your technical qualifications, potentially dive deeper into 1-2 areas to verify expertise, discuss career trajectory and growth expectations, and explore how you'd work with their specific team. Expect: 'Walk me through your most impressive technical achievement,' 'Where do you want to be in 5 years?' 'What technical areas excite you?' 'How do you stay current with the field?' You'll also have opportunity to assess the team: ask about team challenges, technical direction, culture, and mentorship opportunities. The hiring manager determines if you can succeed in their specific team and environment.
Tips & Advice
Treat this as a genuine conversation rather than an interrogation. Come prepared to discuss your most significant technical contribution with genuine enthusiasm, technical depth, and personal reflection. Explain challenging problems you solved, the lessons learned, and how that experience shapes your approach. Have a clear narrative about your career progression and future trajectory: where you want to be in 2-3 years, what skills you want to develop, whether you're interested in management or technical expertise path. Be authentic about your strengths and areas for growth—hiring managers respect self-awareness. Ask thoughtful questions demonstrating genuine interest in their problems: 'What are the biggest technical challenges your team faces?' 'How does your team approach balancing shipping features with technical infrastructure?' 'What does the team culture value?' 'How do you support engineer growth and learning?' Show interest in their problems and how you'd approach them. If you have concerns about the role or team, raise them now—this is your opportunity to assess fit. Reference positive conversations with other interviewers if relevant. Discuss how you'd approach working with data scientists, analysts, and product teams. End by expressing genuine interest and asking about next steps.
Focus Topics
Career Growth and Role Alignment
Clear vision for career development, technical areas you want to deepen, and how this role aligns with your goals. Demonstrating thoughtfulness about your trajectory—whether you're interested in deep technical expertise, technical leadership, or other paths.
Practice Interview
Study Questions
Team Dynamics and Cultural Fit
Ability to work effectively with the specific team, understanding their composition, challenges, and culture. Asking intelligent questions about team problems and how you'd contribute. Demonstrating genuine interest in team success, not just personal advancement.
Practice Interview
Study Questions
Technical Depth Verification
Deep exploration of 1-2 areas from your background to verify claimed expertise. Discussing real-world challenges you've faced, how you approached them, and technical trade-offs. Demonstrating genuine mastery of claimed skills, not just surface-level knowledge.
Practice Interview
Study Questions
Frequently Asked Data Engineer Interview Questions
Explain when to use broadcast (map-side) join versus shuffle (sort-merge) join in Apache Spark. For a scenario joining a 10B-row fact with a 2M-row dimension, describe the decisions you'd make, configuration knobs (broadcast thresholds, shuffle partitions), and fallback strategies if the dimension is too large to broadcast.
Sample Answer
Direct answer
Use a broadcast (map-side) join whenever one side is small enough to fit comfortably in every executor's memory, since it eliminates the shuffle of the LARGE side entirely; fall back to a shuffle (sort-merge) join when neither side is safely broadcastable. For a 10 billion-row fact against a 2 million-row dimension, broadcast the dimension explicitly (do not rely purely on the automatic threshold) unless profiling shows its actual serialized size is too large for the cluster's executor memory budget, in which case bucketing both sides or accepting a shuffle join are the real fallbacks.
Structured elaboration
The decision. Spark automatically broadcasts a side whose ESTIMATED size is under spark.sql.autoBroadcastJoinThreshold (default 10 MB, deliberately conservative); a 2 million-row dimension table, at a modest row width (say a handful of string/numeric columns, a few hundred bytes per row), plausibly lands well over that DEFAULT threshold even though it may still comfortably fit in executor memory, meaning the automatic decision alone might choose a shuffle join for data that is genuinely broadcast-safe. The FIX is not always "raise the threshold" (which risks Spark deciding to auto-broadcast something ACTUALLY too large elsewhere in the same job); an explicit F.broadcast(dim_df) hint targets just this one join, overriding the automatic estimate for exactly the case validated to be safe.
Configuration knobs. spark.sql.autoBroadcastJoinThreshold: the automatic size cutoff (raising it broadly affects every join in the session, a blunt instrument); F.broadcast() (DataFrame API) or the /*+ BROADCAST(dim) */ SQL hint: an explicit, PER-JOIN override that does not affect other joins in the same job; spark.sql.shuffle.partitions: governs the shuffle side's parallelism for whatever joins DO shuffle, sized against actual data volume (the heuristic) rather than left at Spark's default (200), which is frequently wrong for either a 10-billion-row fact table's genuine shuffle needs or a much smaller job.
Fallback strategies if the dimension is too large to broadcast. (1) Bucket both tables on the join key with a matching bucket count, so a recurring join runs shuffle-free without needing to broadcast anything, appropriate specifically when this exact join recurs. (2) Bloom-filter pre-filtering: if the fact table has a low match rate against the dimension, pre-filter the fact side before the shuffle to reduce shuffle volume even though a full shuffle join still happens. (3) Accept the shuffle join outright, sized correctly (spark.sql.shuffle.partitions tuned to the actual data volume), when neither broadcasting nor bucketing is viable, a fully legitimate, correct outcome, just a more expensive one than a broadcast would have been.
Runtime fallback: the lookup grows unexpectedly. A dimension table that was safely small when the job was first written can grow over time (new dimension rows added as the business grows); a hardcoded F.broadcast() hint does NOT protect against this the way relying on the AUTOMATIC threshold-based decision would, and Adaptive Query Execution (AQE, enabled by default since Spark 3.x) can additionally choose to broadcast a join PLAN-TIME estimate got wrong, or de-escalate away from an explicit broadcast that turns out to be unsafe, at RUNTIME based on actual observed sizes; still, periodically re-validating a hardcoded broadcast hint against the dimension's current actual size (not just trusting it was correct when first written) is the more deliberate practice, since AQE's runtime adjustments are a safety net, not a substitute for validating the assumption in the first place.
Worked example
A 10 billion-row fact_events table joined against a dim_products table with 2 million rows, each row averaging roughly 300 bytes (a handful of string attributes), giving an estimated serialized size around 2,000,000×300 bytes=600 MB.
Decision: 600 MB is well over the DEFAULT 10 MB auto-broadcast threshold (Spark would choose a shuffle join automatically without an explicit hint), but well under a typical executor's available memory (executors with, say, 16-32 GB heap comfortably accommodate a 600 MB broadcast with room to spare); explicitly broadcasting with F.broadcast(dim_products) is the right call here, since it is genuinely safe but would NOT happen automatically at the default threshold.
If dim_products instead grew to 50 million rows (roughly 15 GB estimated), the calculus changes: 15 GB broadcast to EVERY executor (not once cluster-wide) risks exceeding a typical executor's memory budget, especially alongside that executor's other memory needs (both apply); at this size, falling back to a shuffle join (with correctly-sized spark.sql.shuffle.partitions) or bucketing both sides (if this join recurs) is the safer choice, and forcing a broadcast here risks the executor-level OOM as the direct failure mode of over-forcing a broadcast.
Trade-offs and pitfalls
- Common mistake: relying purely on the DEFAULT auto-broadcast threshold and assuming Spark "would have broadcast it if it were safe"; the default (10 MB) is deliberately conservative and frequently misses genuinely safe cases like this question's own 2-million-row dimension, making an explicit hint the more reliable choice once the size has actually been validated.
- Common mistake: raising
autoBroadcastJoinThresholdglobally to cover one specific join's needs, inadvertently causing Spark to auto-broadcast something ELSE in the same session that is actually too large; a targetedF.broadcast()/SQL hint on the SPECIFIC join is the more surgical fix. - Detecting a spilled or failed broadcast. A broadcast that turns out too large for executor memory manifests as an OOM specifically during the broadcast/build phase (visible in executor logs and the Spark UI's failed-stage detail, often distinguishable from a shuffle-stage OOM by WHICH stage fails and at what point in its lifecycle), the concrete signal that the broadcast-safety assumption for that specific join needs re-validating, not a signal to blindly retry with more memory.
- A hardcoded broadcast hint is a point-in-time decision, not a permanent guarantee; re-validate periodically for any dimension table whose size is not fixed by design, since the cost of getting this wrong (an executor OOM in production) is more disruptive than the cost of an occasional size re-check.
How do you stay informed about what a function you regularly work with actually cares about and is measured on, even when you're not in the room for their planning?
Sample Answer
Direct answer
Build a standing information diet from what the partner function already produces for itself, its goals or planning document, the metrics it is measured on, and its retro or release notes, and pair that with a recurring informal check-in with one counterpart in that function. You are not trying to get invited into their planning meeting; you are trying to read what they optimize for, and occasionally confirm your read against a real person.
Structured elaboration
| Channel | Typical cadence | What it surfaces |
|---|---|---|
| Their goals or planning document (OKRs, roadmap) | Once per planning cycle | What they are formally accountable for this period |
| Dashboards or metrics they report on | Check periodically | What "good" looks like for them, in their own numbers |
| Retro notes, release notes, postmortems | As published | What is currently painful or top of mind for them |
| Recurring 1:1 with one counterpart | Biweekly or monthly | Informal context, upcoming priorities, translation of jargon |
| Occasional silent sit-in on their planning | A couple of times a year | Calibrates your read of the artifacts against how they actually talk about trade-offs |
The habit that ties these together: translate their metric into one sentence you could say back to them and have them agree it is accurate, then test that sentence the next time you talk. If you cannot state their current priority in a sentence they would sign off on, your information diet has a gap.
Worked example
Suppose you regularly partner with a support or customer-success function but are not in their planning. Their quarterly goals page (a document they publish for their own team) states the goal is "reduce median response time." Reading that before proposing a change that would meaningfully increase inbound volume lets you flag the likely trade-off to your counterpart ahead of launch, rather than finding out after the fact that you worked against their stated goal. The artifact told you what they were measured on; the counterpart conversation confirmed it was still current.
Trade-offs & pitfalls
- Relying only on artifacts risks reading a goal that is stale or aspirational and no longer reflects what the team is actually prioritizing day to day.
- Relying only on a single counterpart's opinion risks mistaking one person's take for the function's actual priority, especially if that person is not close to how the team's metrics are reviewed.
- A common miss: reading the dashboard but never validating the interpretation with anyone in that function, which produces confidently wrong assumptions that only surface when a decision already went the wrong way.
- The senior differentiator on an easy-sounding question like this is treating it as a standing habit built before you need it, rather than something you scramble to learn only after a conflict has already surfaced.
Name five values or principles that are commonly published by large tech employers as part of a codified leadership-principle or culture framework. For each one, give a one-sentence practical definition in plain language, and one concrete example of an observable behavior, in any technical role, that would demonstrate it.
Sample Answer
Direct answer
Most large employers that codify their interview values name broadly similar underlying traits, even when their specific vocabulary differs: a customer or user-first orientation, taking ownership beyond a narrow scope, moving with appropriate urgency, holding a high quality bar, and being trustworthy and transparent recur across nearly every published framework, just under different labels.
Structured elaboration
| Underlying trait | Plain-language definition | Example observable behavior |
|---|---|---|
| Customer or user focus | Anchoring decisions on the actual impact to the person using what you build, not just internal convenience | Fixing a confusing error message before adding a requested feature, because support tickets showed it was actively costing users time |
| Ownership beyond scope | Treating a problem as yours to fix even when it technically belongs to someone else or falls outside your assigned scope | Noticing a flaky part of a shared pipeline that keeps breaking other teams' builds, and fixing it even though it wasn't assigned to you |
| Bias toward appropriate action | Moving on a decision with enough evidence to be reasonably confident, rather than waiting for a certainty that may never arrive | Shipping a reversible, well-scoped fix immediately rather than waiting a week for a fuller root-cause investigation |
| High quality bar | Refusing to let obviously substandard work through, even under time pressure, and being willing to say so | Declining to approve a change that passed its tests but had no rollback plan, and holding that line until one existed |
| Trust and transparency | Communicating uncomfortable information (a miss, a risk, a mistake) proactively rather than waiting to be asked | Flagging a slipping deadline the moment it became likely, rather than waiting until the deadline itself |
Worked example
The table above is itself the worked example. A strong candidate should be able to reproduce a table like this from memory for whichever specific company's list they are asked about, translating each of that company's named principles onto one of these five underlying traits, rather than treating an unfamiliar company's vocabulary as an entirely new set of ideas to learn from scratch.
Trade-offs and pitfalls
Treating every company's list as identical is itself a mistake; the values differ in emphasis, and in what is explicitly left off the list. A company whose published list omits any explicit ownership language may culturally deprioritize individual initiative in favor of process, for example, and that is worth noticing rather than flattening away. A candidate who can only speak the vocabulary of one company, fluent in one set of terms but unable to translate the same underlying trait into a different company's language, reads as having memorized rather than internalized the competencies involved.
Create a reusable documentation template for describing an ETL job's inputs, outputs, transformation logic, and edge cases. The template should be short enough to be used as a module in a docs-as-code site and include placeholders for code snippets and sample queries.
Sample Answer
Title: {{job_name}} ETL — Overview
Short description:
- Purpose: {{one-line purpose}}
- Owner: {{team/person}} | SLA: {{e.g., hourly/daily}} | Last updated: {{YYYY-MM-DD}}
Inputs
- Source system(s): {{source_name}} (type: {{db/stream/file}})
- Input schema / sample record:
-- Example: source table schema
SELECT column1, column2, column3 FROM {{source_table}} LIMIT 1;
- Ingestion frequency: {{cron or event}}
- Data volume: {{rows/day | GB/day}}
Outputs
- Destination: {{warehouse/table/path}} (format: {{parquet/csv/table}})
- Output schema / primary keys:
-- Example: target DDL
CREATE TABLE {{target_table}} (
id BIGINT PRIMARY KEY,
ts TIMESTAMP,
metric DOUBLE
);
- Consumer(s): {{analytics/model/team}}
Transformation Logic
- High-level steps:
- Extract from {{source}} with filters: {{filter_conditions}}
- Clean/enrich: {{dedupe, null-handling, type-casting}}
- Business rules: {{rule_1; rule_2}}
- Load to {{target}} with partitioning: {{partition_column}}
- Sample implementation (Spark):
# spark: read -> transform -> write
df = spark.read.format("parquet").load("s3://{{source_path}}")
df = df.filter("{{filter_expr}}") \
.withColumn("metric", col("value").cast("double")) \
.dropDuplicates(["{{dedupe_key}}"])
df.write.mode("overwrite").partitionBy("{{partition_col}}").parquet("s3://{{target_path}}")
Monitoring & Alerts
- Metrics: rows_in, rows_out, success_flag, runtime_seconds
- Alert thresholds: {{e.g., rows_out < expected → PagerDuty}}
Edge Cases & Data Quality
- Nulls in {{col}} -> action: {{drop/fill/default}}
- Late-arriving data: {{allow/ignore/backfill_policy}}
- Schema evolution: {{fail/auto-cast/notify}}
- Duplicate records: {{dedupe_key}} strategy
Testing & Validation
- Unit tests: {{test cases}}
- Reconciliation query:
-- row count sanity check
SELECT COUNT(*) FROM {{target_table}} WHERE ds = '{{date}}';
Run / Deploy
- Trigger: {{airflow DAG / cron / event}}
- Config parameters: {{param1=.., param2=..}}
Change log
- {{date}}: {{summary of change}}
You're evaluating managed cloud data warehouse platforms (Snowflake, BigQuery, and Redshift) for a fast-growing analytics team. Walk through the criteria you would use to compare them (architecture model, concurrency handling, pricing model, storage format support, and operational overhead) and make a recommendation for a specific team size and query pattern.
Sample Answer
Direct answer. Compare Snowflake, BigQuery, and Redshift on five axes: architecture model (how compute and storage separate), concurrency handling, pricing model, storage format support, and operational overhead. There is no universal winner; the right choice depends on your team's existing cloud, your query concurrency profile, and how predictable your workload is.
Structured elaboration.
| Criterion | Snowflake | BigQuery | Redshift |
|---|---|---|---|
| Architecture | Multi-cluster, shared-data: storage fully decoupled from compute "virtual warehouses" | Fully serverless: no clusters to manage, Google allocates slots per query | Cluster-based (or Serverless): nodes hold both compute and a share of storage, RA3 nodes decouple storage |
| Concurrency | Scale out via multi-cluster warehouses, each query set can get its own warehouse | Handled by Google's shared slot pool; reservations isolate teams | Managed via WLM queues and Concurrency Scaling (temporary extra clusters) |
| Pricing | Per-second compute credits while a warehouse runs, separate storage cost | On-demand per-byte-scanned or capacity-based slot reservations (BigQuery Editions) | Per-node-hour (provisioned) or per-RPU (Serverless) |
| Storage format | Proprietary micro-partitions, but supports external tables over open formats | Proprietary columnar storage, plus native support for querying Iceberg/external tables | Proprietary columnar, Redshift Spectrum for querying S3 directly |
| Operational overhead | Low: auto-suspend, auto-resume, minimal tuning knobs | Lowest: nothing to provision or pause | Higher: cluster sizing, vacuum/analyze maintenance (provisioned mode) |
Three platform-specific units in that table are worth defining plainly, since the question is explicitly asking about concurrency handling and pricing: a Snowflake compute credit is its per-second billing unit for warehouse compute, so a bigger or longer-running warehouse simply burns credits faster. A BigQuery slot is the platform's unit of parallel query-processing capacity; the "shared slot pool" is the pot of these units Google draws from to run your query, and a slot reservation just reserves a guaranteed number of them for you instead of sharing the pool with every other BigQuery customer. A Redshift WLM (Workload Management) queue is a named lane that routes a query to a specific, bounded share of the cluster's memory and concurrency; hitting a concurrency limit means that particular queue's lane is full, not that the whole cluster is out of capacity.
Worked example. For a fast-growing team with roughly 500 analysts running around 10,000 BI queries a day against a 10TB active dataset, concurrency handling is the deciding factor more than raw performance: Snowflake's ability to spin up independent warehouses per team or workload avoids one group's heavy queries starving another's dashboard, and its per-second billing means idle warehouses cost nothing when auto-suspended. BigQuery is an equally strong fit if the team is already GCP-native and wants zero cluster management, especially if the query pattern is bursty rather than continuously heavy, since on-demand pricing avoids paying for idle capacity at all. Redshift becomes the stronger choice when the workload is large and steady enough that reserved/provisioned capacity is cheaper than pay-per-use, or when the team already has deep AWS-ecosystem integration (IAM, Glue, Lake Formation) that reduces the value of switching platforms. At petabyte scale with a high-concurrency BI user base, total cost of ownership becomes the deciding axis rather than raw price-per-query, since the storage-versus-compute separation and auto-scaling behavior of Snowflake or BigQuery tend to avoid the manual capacity-planning overhead that a large provisioned Redshift cluster requires, while a spiky, bursty query pattern specifically favors either platform's auto-scaling over a fixed-size cluster.
Trade-offs and pitfalls. Benchmarking these platforms fairly is hard: comparing default settings without tuning distribution/clustering keys, using a dataset too small to expose real concurrency behavior, or ignoring egress and data-transfer cost between your existing systems and the new platform will all produce misleading conclusions. Vendor lock-in is real in all three directions (proprietary SQL extensions, proprietary storage formats, ecosystem integrations), so weigh switching cost alongside today's price and performance, not just today's benchmark numbers.
How would you design a postmortem process that ensures technical learnings are converted into team-wide capability improvements (not just archived notes)? Describe concrete actions, owners, follow-up tickets, and ways to measure that the learnings reduced recurrence.
Sample Answer
Situation: At my last data platform role we had repeat incidents where upstream schema changes broke ETL jobs, causing analyst outages and costly re-runs.
Task: I needed a postmortem process that didn't just record lessons but converted them into measurable, team-wide capability improvements to prevent recurrence.
Action:
- Immediate postmortem within 48 hours (blameless) led by the on-call engineer (owner) and facilitated by me as tech lead.
- Template captured timeline, root cause, contributing factors, and proposed action items with clear owners and due dates.
- For every action item we created a tracked ticket in our backlog (Jira) with type tags: policy, automation, test, documentation, training. Example tickets: "add schema-contract enforcement CI" (owner: infra engineer), "add transformation unit tests and sample fixtures" (owner: pipeline owner), "runbook: schema-change checklist" (owner: data steward).
- Small changes (<=3 days) were sprinted; larger work had OKR alignment and roadmap slots.
- We converted lessons into three artifact types: code (PRs), automation (CI jobs), and learning (15-min demo in weekly engineering sync + a short Confluence how-to).
- Quarterly “closure” review: original ticket owners presented status and metrics in a retro; stale items escalated.
- Measurement: defined KPI per action (e.g., number of pipeline failures due to schema changes, mean time to detect, number of downstream broken builds). We set a baseline pre-change and tracked weekly.
- Reinforced via on-call playbooks and automated alerts tied to new CI checks so prevention delivered observable signals.
Result: Within two quarters schema-related incidents dropped 70%, MTTR fell 50%, and the team adopted a contract-first pattern. The combination of owner-assigned tickets, short feedback loops, demonstrable automation, and quantitative KPIs ensured learnings became sustained capability improvements.
Explain the trade-offs between a phased rollout and a big-bang approach for migrating a 10 TB data warehouse serving ~200 dashboard users and nightly ETL jobs. For each approach, list benefits, risks, sequencing implications, rollback complexity, and recommended monitoring during the transition. State which approach you'd pick and why, given constrained engineering resources.
Sample Answer
Phased rollout vs big‑bang for migrating a 10 TB warehouse (200 dashboard users, nightly ETL):
Phased rollout
- Benefits: Lower blast radius, incremental validation (schema, queries, ETLs), easier user feedback, you can migrate high‑value/low‑risk datasets first. Allows parallel run (dual reads/writes) and gradual optimization.
- Risks: Longer project duration, increased operational overhead (maintaining two systems), potential data divergence if replication lag or schema drift occurs.
- Sequencing implications: Start with noncritical tables/popular read‑only dashboards -> replicate and reconcile -> move downstream ETL jobs and materializations -> cut over critical reports last.
- Rollback complexity: Lower per-phase; you can stop at a phase and revert traffic to source if reconciliation fails. Global rollback is still possible but requires careful cutover flags and idempotent pipelines.
- Monitoring recommended: replication lag, row-level reconciliation metrics (counts/hash), query latency and error rates, ETL success/failure, user-facing data freshness, anomaly/delta detectors, resource utilization.
Big‑bang
- Benefits: Fast single cutover, no long dual-run overhead, simpler long‑term architecture and fewer temporary connectors.
- Risks: High blast radius—possible widespread dashboard breaks, ETL failures impacting all consumers, hard to debug under pressure.
- Sequencing implications: Requires exhaustive pre-cut validation (end‑to‑end tests, synthetic workloads), full dress rehearsal and strict freeze windows.
- Rollback complexity: High — reversing 10 TB of changes and restoring ETL state is slow and error‑prone; requires backups and point‑in‑time recovery readiness.
- Monitoring recommended: same metrics but with aggressive pre/post baseline comparisons, synthetic queries, end‑to‑end acceptance tests immediately after cutover, and alerting on any divergence.
Recommendation (constrained engineering resources): Phased rollout. Although it costs more operational overhead, it reduces risk and allows smaller incremental work items that fit limited resources. Prioritize: migrate high‑value, low‑complexity datasets first, automate reconciliation and smoke tests, use feature flags for consumer switching, and schedule small cutovers outside business hours. This approach minimizes user impact and gives time to fix issues without a catastrophic rollback.
A validation check could either block bad records from moving further downstream, or just let them through and raise an alert. For a pipeline feeding a dataset other teams depend on, how do you decide which to do, and where in the pipeline would you put that check?
Sample Answer
Direct answer
Decide by weighing the cost of a false block (delaying or dropping a probably-fine record) against the cost of a false pass (letting a genuinely bad record reach every consumer of a shared dataset), not by a single fixed rule. Checks on a hard, structural guarantee that downstream logic actually depends on, like a required key being present or a value violating a constraint the rest of the pipeline assumes, should block. Checks that are really statistical health signals, like a metric drifting outside a normal range, should let the record through and raise an alert instead. Placement follows the same logic: put blocking checks as early as possible, before the data reaches anything shared, and put statistical checks wherever there's enough context to compute a meaningful baseline, which is often necessarily later.
Structured elaboration
Decision criteria, block versus alert-and-pass:
| Factor | Favors blocking | Favors alert-and-pass |
|---|---|---|
| Blast radius | Many downstream teams depend on this exact field or table | A single, low-stakes internal consumer |
| Nature of the violation | A hard, structural guarantee downstream logic assumes (non-null key, referential integrity, schema type) | A soft, statistical signal (an out-of-range value, a distribution shift) that could still be legitimate |
| Confidence in the check | Deterministic, unambiguous | Probabilistic or threshold-based, prone to false positives |
| Cost of being wrong | Reprocessing a false block is usually cheap once the pipeline can be trusted again | Letting through a false failure that's already mixed into a shared aggregate is often expensive or impossible to fully unwind |
Placement follows the same reasoning, not convenience. Hard, structural, cheap-to-evaluate checks belong as early as possible, ideally at ingestion, before a record can be joined, aggregated, or shared with anyone, because catching a violation before it's mixed into downstream state is strictly cheaper than unwinding it afterward. Statistical checks (drift, anomaly detection against a baseline) often need enough accumulated data to be meaningful, which can genuinely push them later in the pipeline; their outcome should still go to an alert rather than a block, since blocking on a probabilistic signal risks stalling the pipeline on a false positive.
A useful middle option: quarantine-and-continue. For a check that's borderline, confident enough to worry about but not confident enough to trust blindly, setting the record aside (not passed downstream, not silently dropped) while the rest of the batch proceeds avoids both a hasty block and a silent pass.
What kinds of checks tend to fall where. A null check on a required key or a duplicate-key check is usually the hard, deterministic, blocking kind. A range or distributional check on a numeric field is usually the softer, alert-worthy kind, precisely because it's inferring "unusual" rather than checking a fact the schema guarantees.
Worked example
A shared orders table feeds 12 downstream consumers. A schema check finds 0.4 percent of a day's 1,000,000 incoming records missing the required customer identifier, a value every downstream join assumes is present:
1,000,000×0.004=4,000 affected rowsEven at a small fraction of the batch, this is treated as blocking, because those 4,000 rows would otherwise silently break joins for all 12 downstream consumers at once, and the check itself is unambiguous (the key is either present or it isn't).
Separately, a statistical check on average order value shows a shift from a baseline mean of $85 to $102:
85102−85≈20% deviation from baselineThis could be a genuine promotion-driven spike or a data problem; it goes to alert-and-pass rather than blocking, because the check is probabilistic (not every deviation is a defect) and the cost of being wrong in the blocking direction (halting real data from a legitimate business event) is worse here than the cost of a few hours where a chart looks slightly off before a human confirms it either way.
flowchart LR
A[Raw ingestion] --> B[Hard structural checks: block on failure]
B -->|pass| C[Transform and aggregate]
C --> D[Statistical or drift checks: alert, let pass]
D --> E[Shared dataset]
E --> F[Downstream consumers]
B -->|fail| G[Quarantine, do not propagate]
Trade-offs & pitfalls
- Blocking on every check, including soft statistical ones, trades away data availability for a false sense of safety, and will eventually stall the pipeline on a legitimate anomaly like a real traffic spike.
- Letting every check through as alert-only, including hard structural violations, means a genuinely broken record (a missing key that breaks every downstream join) propagates to all 12 consumers before anyone even reads the alert.
- Placing every check right before a report renders catches problems far too late, after the data has already been joined and aggregated into shared state that's expensive to unwind.
- A common wrong turn is picking one block-or-alert policy for the whole pipeline instead of deciding per check, based on that specific check's own confidence and blast radius.
You observe that a particular query's p99 latency doubles during daily ETL loads. How would you instrument and measure to determine whether the cause is CPU, IO, locking, or network-saturation? Provide the metrics and tools you would use.
Sample Answer
Start with a hypothesis-driven, correlational instrumentation plan: collect resource-level metrics, database/query-level metrics, network metrics, and tracing so you can correlate spikes with the p99 latency jump during ETL windows.
Key metrics to capture
- CPU: %util, user/system/idle/iowait/steal, load average, per-core utilization, context-switches/sec. (iostat/pidstat/perf/Node exporter metrics)
- IO: disk IOPS, bytes/sec, avg wait time (await), service time (svctm), queue length (avgqu-sz), fsync latency, read/write latency distributions. (iostat, blktrace, Prometheus node exporter)
- Locks/DB contention: lock wait time, number of blocked queries, longest-waiting lock, deadlocks, pg_stat_activity, pg_locks, wait_event_types, MySQL INFORMATION_SCHEMA.INNODB_LOCK_WAITS, query wait histogram, slow query log, EXPLAIN ANALYZE. For Spark/Hive: task skew, GC pauses, shuffle write/read waits.
- Network: interface throughput (tx/rx), errors, drops, retransmits, RTT, packet loss, TCP retransmits, connection counts, NIC queue depth. (ifstat, ethtool, netstat, tc, Prometheus node exporter)
- Application/Query: p50/p95/p99 latency per query id, QPS, rows processed, plan changes, cache hit ratio, memory usage, GC pauses. (APM or query-level metrics, pg_stat_statements, Spark UI)
- End-to-end tracing: distributed traces to see which span (DB, network, disk) inflates during ETL (OpenTelemetry, Jaeger, Zipkin).
Tools and how to use them
- Metrics ingestion + dashboards: Prometheus + Grafana to chart p99 alongside CPU/iowait/IOPS/net throughput. Add alerts on correlation thresholds.
- Host tools for detailed capture: vmstat, iostat, pidstat, atop, dstat for real-time; blktrace or perf for deep IO.
- DB diagnostics: pg_stat_statements, EXPLAIN ANALYZE, auto_explain, slow query logs, MySQL Performance Schema.
- Tracing/APM: OpenTelemetry/Jaeger or Datadog APM to attribute latency to spans (DB read, network, serialization).
- Network: tcpdump/iftop/iperf for reproducing network saturations and validating retransmits.
Investigation steps
- Baseline: capture metrics before/during/after ETL window. Plot p99 overlayed with CPU%, iowait, disk queue length, network throughput, lock wait counts.
- Correlate spikes: if p99 aligns with high iowait/disk queue → IO bottleneck. High CPU% with low iowait → CPU. Increased lock waits/blocked queries → contention. High network tx/rx or retransmits → network saturation.
- Drill-down: run EXPLAIN ANALYZE on slow queries, enable trace sampling to see span breakdown, use iostat/blktrace to measure disk latency distribution, and check DB lock tables for waiting locks.
- Controlled experiments: run ETL with throttled IO (ionice/blkio), reduced parallelism, or on separate network path to confirm causality.
- Remediation targets: add indexes, tune query plans, increase IO capacity or use faster storage, reduce ETL concurrency, optimize network path or offload heavy shuffles, or introduce resource isolation.
Example: if p99 spikes with iowait and disk avgq grows during ETL, but CPU is low, root cause = IO. If pg_stat_activity shows many queries waiting on locks at same time, root cause = locking. Use tracing to confirm which component's span grows most during the latency window.
Write a function that merges two dictionaries where values in the second override the first, except when both values at a key are themselves dictionaries, in which case they should merge recursively rather than one replacing the other. What does Python's | merge operator (3.9+) get you here, and where does it fall short?
Sample Answer
Approach
Walk both dictionaries key by key. When a key exists in both and both values are themselves dicts, recurse into them; otherwise, the second dictionary's value wins outright (this covers overwriting a scalar, a list, or a value whose type changed between the two inputs).
Code (Python 3.12)
def deep_merge(a: dict, b: dict) -> dict:
"""Merge b into a. Nested dicts are merged recursively;
any other type in b overwrites the corresponding value in a.
Returns a new dict; does not mutate a or b.
"""
result = dict(a)
for key, b_val in b.items():
a_val = result.get(key)
if isinstance(a_val, dict) and isinstance(b_val, dict):
result[key] = deep_merge(a_val, b_val)
else:
result[key] = b_val
return result
a = {"db": {"host": "localhost", "port": 5432}, "debug": False}
b = {"db": {"port": 5433, "user": "admin"}, "debug": True}
print(deep_merge(a, b))
# {'db': {'host': 'localhost', 'port': 5433, 'user': 'admin'}, 'debug': True}
What | (3.9+) gets you, and where it falls short
| (and |=) is a genuine, readable improvement over dict(a, **b) or {**a, **b} for a shallow merge: it is one operator, it clearly reads as "merge these two mappings," and |= mutates in place when you want that. But it merges exactly one level deep: for any key present in both, b's value replaces a's value wholesale, even when both are dicts, so it cannot express "merge these nested config sections together" at all:
print(a | b)
# {'db': {'port': 5433, 'user': 'admin'}, 'debug': True}
Notice db.host is gone entirely: | replaced the whole nested db dict with b's db dict instead of combining them, which is exactly the behavior this question asks you to avoid. | is the right tool when you know your structures are flat, or when "later fully replaces earlier" is the actually-intended semantics for nested values too; it is the wrong tool the moment nested merging matters, which is why deep_merge above cannot be replaced by it.
Key points
isinstance(a_val, dict) and isinstance(b_val, dict)is the single branch point deciding "recurse" vs. "overwrite"; every other type (list, str, int, a value that changed type betweenaandb) falls to the overwrite branch, by design.result = dict(a)creates a shallow copy so the top-level ofais not mutated; nested dicts that are NOT touched by a merge (a key only present ina) are still the same nested object as in the originala, since this is a shallow copy at each level, not a fullcopy.deepcopy. If the caller needs the result to share no mutable structure with the inputs at all, wrapa/bincopy.deepcopybefore merging, at the cost of that copy's own time and memory.
Complexity
Time: O(n) where n is the total number of keys across both structures (every key is visited exactly once, at whatever depth it lives). Space: O(n) for the new dicts constructed along the way (one new shallow dict per merged nesting level).
Trade-offs & pitfalls
- Overwrite vs. combine, the choice this question absorbs from 'sum the values instead' variants: hardcoding "
balways wins" is only one policy. A parametrized version threading acombinecallback through the recursion generalizes to "add the numbers instead of replacing them":
def deep_merge_with(a, b, combine=lambda old, new: new):
result = dict(a)
for key, b_val in b.items():
a_val = result.get(key)
if isinstance(a_val, dict) and isinstance(b_val, dict):
result[key] = deep_merge_with(a_val, b_val, combine=combine)
elif key in result:
result[key] = combine(a_val, b_val)
else:
result[key] = b_val
return result
print(deep_merge_with({"counts": {"x": 3}}, {"counts": {"x": 4, "y": 1}}, combine=lambda old, new: old + new))
# {'counts': {'x': 7, 'y': 1}}
- Merging more than two dicts, the other absorbed variant:
deep_mergeis associative enough (left-to-right) to fold over an arbitrary number of dicts withfunctools.reduce, rather than needing a special many-way version (associative here just means merging A-then-B-then-C gives the same result as merging A-then-(B-then-C), so it is safe to fold the whole list left to right without special-casing more than two dicts at a time):
import functools
dicts = [{"a": 1}, {"a": 2, "b": 3}, {"b": 4, "c": 5}]
print(functools.reduce(deep_merge, dicts, {}))
# {'a': 2, 'b': 4, 'c': 5}
- Lists are treated as scalars here (
b's list replacesa's list entirely); if list concatenation or per-index merging is the intended behavior, that needs its own explicit branch, since there is no single "obviously correct" way to merge two lists. - Cyclic or self-referential nested structures would recurse without terminating; this is an edge case worth naming rather than silently handling, since typical configuration-merge inputs (JSON/YAML-shaped dicts) cannot contain cycles.
Recommended Additional Resources
- LeetCode - Practice coding problems, focus on medium-difficulty data manipulation problems. Tag: Data Engineers
- Mode Analytics SQL Tutorial - Comprehensive SQL practice with real datasets for data analysis and optimization
- Cracking the Coding Interview by Gayle Laakmann McDowell - Classic guide with detailed explanations for technical interviews
- System Design Primer - Excellent resource for understanding distributed systems concepts and architectural trade-offs
- Apache Spark Documentation - Official Spark documentation covering architecture, APIs, and optimization
- Designing Data-Intensive Applications by Martin Kleppmann - Deep dive into distributed systems, consistency models, and data design patterns
- AWS Data Services Documentation - Official AWS guides for Redshift, S3, EMR, Glue, and Kinesis
- Azure Synapse and Data Lake Documentation - Official Azure guides for data warehousing and data lake solutions
- Google Cloud BigQuery Documentation - Official GCP guides for BigQuery, Dataflow, and Cloud Storage
- DataCamp Courses - Structured courses on Python, SQL, Spark, and cloud data engineering
- InterviewQuery - Data engineering specific interview preparation platform with realistic questions
- Blind Coding Interview Platform - Practice mock interviews with candidates and receive feedback
- YouTube Channels: DataTalks.Club, Seattle Data Guy, Seattle Data Engineer - Real-world data engineering architecture discussions
- Medium Articles on Data Engineering - Search for data pipeline design, ETL patterns, and architectural discussions
- DBDesigner.net - Online tool for designing and practicing database schemas
- HackerRank SQL and Python - Additional practice platform for coding and SQL problems
Search Results
Top Python Interview Questions for Data Engineers (2025 Guide)
Mid-Level Data Engineer Interview Questions. Mid-level interviews go beyond syntax. Here, you'll be tested on debugging, optimization, and practical data- ...
36 Data Engineer Interview Questions (With Sample Answers)
6 data engineer interview questions with sample answers · 1. What makes a good data engineer? · 2. What is data engineering? · 3. What design schemata do you use ...
Top Azure Data Engineer Interview Questions You Need to Know
When applying for intermediate-level roles, these are the Azure data engineer interview questions you can expect: 1. What is Blob Storage in Azure? You can ...
Python Coding Interview Questions Series for Data Analysts and ...
We are launching Python Coding Interview Questions Series for Data Analysts and Data Engineers. In this video we will discuss 3 topics : 1- What to expect ...
Top 90+ Data Engineer Interview Questions and Answers
The article will cover over 90+ Data Engineering interview questions, from simpler concepts to advanced topics.
Meta Data Engineer Interview Guide | Sample Questions (2025)
Expect tough SQL and data modeling questions that test both logic and scalability, plus product-sense discussions that assess how well you connect data work to ...
65+ Data Analyst Interview Questions and Answers for 2026
This article brings you the top data analyst interview questions with detailed answers. You'll learn: How to explain core concepts clearly. What to expect in ...
This interview preparation guide was generated using AI-powered research from the sources listed above. While we strive for accuracy, we recommend verifying critical information from official company sources.
Want to create your own tailored preparation guide using our deep research?
Get Started for FreeInterview-Ready Courses
Visual-first, interactive, structured learning paths