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.

HardTechnical
66 practiced

Implement a custom Partitioner in Scala for Spark that colocates related keys (e.g., all keys with the same customerId prefix) into the same partition to reduce shuffle for joins and windowed time-series computations. Provide a code skeleton, describe getPartition logic, and explain how this partitioner reduces shuffle for repeated joins.

EasyTechnical
86 practiced

Explain caching and persistence trade-offs in Spark. Describe at least three storage levels (MEMORY_ONLY, MEMORY_AND_DISK, DISK_ONLY) and when you'd choose each for ML feature pipelines. Discuss eviction, serialization, and the impact on GC and shuffle performance.

HardTechnical
83 practiced

You are migrating Spark workloads from YARN to Kubernetes. Explain differences that impact shuffle behavior, executor lifecycle, dynamic allocation, local disk usage for shuffle files, and how to configure persistent vs ephemeral volumes for shuffle. Describe tuning steps to ensure stable Spark performance on Kubernetes.

EasyTechnical
70 practiced

Explain the difference between repartition and coalesce in Spark. When should you use each? Describe the cost (shuffle vs no shuffle) and a scenario where coalesce with shuffle=true is the right choice. Also explain how these operations affect downstream data locality for ML training jobs.

MediumTechnical
85 practiced

A Spark job experiences long GC pauses and executor OOMs intermittently. Describe a step-by-step troubleshooting approach: what logs and metrics to inspect, how to determine whether storage or execution memory is the issue, and possible fixes such as serialization changes, caching adjustments, executor sizing, and code changes.

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.