InterviewStack.io LogoInterviewStack.io

Distributed Data Processing with Spark and Hadoop Questions

Distributed compute engines for large-scale data processing, with Apache Spark as the primary focus: driver/executor architecture, the RDD/DataFrame/Dataset APIs, lazy evaluation and the Catalyst/Tungsten optimizers, shuffle and partitioning, data skew detection and mitigation (salting, broadcast joins, adaptive query execution), memory tuning, and caching/persistence strategies. Covers engine-internal execution and recovery within a single job: how the DAG scheduler breaks work into stages and tasks, task retries, speculative execution, stage recomputation from RDD lineage, and Structured Streaming's own checkpointing and write-ahead logs for exactly-once semantics. Also covers the Hadoop ecosystem as historical foundation (HDFS, MapReduce, YARN, Hive) and modern lakehouse table formats (Delta Lake, Iceberg) that have largely replaced it in current interview practice. The distributed-processing depth expected of data engineers at scale: writing and tuning jobs, diagnosing OOMs and skew, and choosing the right engine, storage format, and cluster configuration for a workload. Distinct from workflow-orchestration-and-scheduling, which owns the external, Airflow-style scheduler that invokes jobs like these as steps in a larger multi-system pipeline, and from data-reliability-and-fault-tolerance, which owns designing idempotent, cross-system pipeline behavior around job failures rather than the engine's own internal recovery mechanics.

MediumTechnical
66 practiced

How do you unit test Spark transformations and ETL logic? Describe frameworks and patterns for isolating Spark dependencies, creating small in-memory datasets for tests, asserting DataFrame equality, and mocking external systems. Provide a short example approach in PySpark or Scala for testing a simple transformation.

HardTechnical
61 practiced

You need to aggregate daily active users per country from 100 billion events stored across a distributed cluster. Describe a distributed aggregation plan: map-side partial aggregation, shuffle/partitioning strategy, reduce-side final aggregation, how to minimize network traffic, and strategies to bound memory usage during group-by.

MediumTechnical
65 practiced

Explain how bucketing and sorting in Spark can reduce shuffle cost for repeated joins. Describe how to write DataFrames to a bucketed table (bucketBy, sortBy) and how Spark can leverage compatible bucketed tables to perform joins without a full shuffle. Discuss practical limitations.

MediumTechnical
74 practiced

Explain how join skew can be diagnosed using Spark UI metrics and job logs. What signs in the UI indicate one or a few tasks are handling disproportionate data? Provide a method to programmatically sample and quantify skew before running the full job.

MediumTechnical
68 practiced

Given limited cluster memory and a frequently accessed large intermediate DataFrame, explain the trade-offs between MEMORY_ONLY, MEMORY_ONLY_SER and MEMORY_AND_DISK storage levels. Include serialization impact, CPU overhead, GC behavior, and recovery speed after an executor restart.

Unlock Full Question Bank

Get access to all Distributed Data Processing with Spark and Hadoop interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.