InterviewStack.io LogoInterviewStack.io

Apache Spark Architecture Questions

Covers core Apache Spark architecture and programming model, including the roles of the driver and executors, cluster manager options, resource allocation, executor memory and cores, partitions, tasks, stages, and the directed acyclic graph used for job execution. Explains lazy evaluation and the distinction between transformations and actions, fault tolerance mechanisms, caching and persistence strategies, partitioning and shuffle behavior, broadcast variables and accumulators, and techniques for performance tuning and handling data skew. Compares Resilient Distributed Datasets, DataFrames, and Datasets, describing when to use each API, the benefits of the DataFrame and Spark SQL APIs driven by the Catalyst optimizer and Tungsten execution engine, and considerations for user defined functions, serialization, checkpointing, and common data sources and formats.

EasyTechnical
23 practiced
List common Spark transformations/operations that trigger a shuffle (e.g., groupByKey, join). Explain why reduceByKey or aggregateByKey can be more efficient than groupByKey for large-scale aggregations and what 'map-side combine' means in this context.
EasyTechnical
26 practiced
Explain broadcast variables and accumulators in Spark. In a distributed inference or feature-lookup scenario you need a large mapping (e.g., feature id → embedding) accessible to all tasks—how would you use broadcast variables to distribute it, and what limitations or pitfalls must you account for?
HardTechnical
29 practiced
Design an experiment to measure the impact of different partitioning strategies (e.g., default, hash partition by key, range partitioning, bucketing) on model training runtime and resource usage for an ML pipeline. Define the metrics to collect (training time, shuffle bytes, GC time, CPU utilization), the sampling and repeat strategy to ensure statistical significance, and how to present results to stakeholders.
MediumTechnical
25 practiced
Discuss how to achieve fault-tolerant exactly-once semantics for Structured Streaming when writing to sinks like Kafka and files. Explain the role of checkpointing, idempotent sinks, write-ahead logs (WAL), and common pitfalls when using custom sinks for ML inference or feature materialization.
HardTechnical
32 practiced
A mission-critical Spark ML job intermittently runs 10x slower than normal and many executors show frequent GC pauses and spills to disk. Provide a systematic debugging and tuning plan listing specific commands, logs to collect (GC logs, executor heap histograms), configuration knobs to change (`spark.executor.memoryOverhead`, `spark.memory.fraction`, serializer changes), and short-term vs long-term fixes.

Unlock Full Question Bank

Get access to hundreds of Apache Spark Architecture interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.