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
22 practiced
Explain broadcast variables and accumulators in Spark. Describe their lifecycle, typical use-cases, and limitations (size constraints, update semantics, type restrictions). Provide an example scenario where a broadcast variable significantly improves a join performance.
EasyTechnical
27 practiced
Explain the roles and responsibilities of the Spark driver and Spark executors in a distributed Spark application. Your answer should cover where the SparkContext lives, how tasks are scheduled from the driver to executors, what metadata/state is held by the driver versus executors, how memory and cores are allocated to each, and the observable failure modes when a driver or an executor fails in production.
EasyTechnical
31 practiced
In PySpark, demonstrate how to persist a DataFrame using an appropriate StorageLevel, ensure it survives transient executor failures if possible, and show how to properly unpersist it. Include a short code example and explain when to choose MEMORY_ONLY, MEMORY_AND_DISK, or serialized storage.
MediumTechnical
30 practiced
You have a join between a very large fact table and a much smaller dimension table but your job still does massive shuffles and runs slowly. Describe how to detect data skew and three concrete techniques to mitigate skew (code-level and config-level) to speed up the join.
EasyTechnical
32 practiced
Describe the roles of the Catalyst optimizer and Tungsten execution engine in Spark SQL. Explain in plain terms what they optimize (logical rules, physical planning, code generation, memory layout) and how those optimizations lead to faster DataFrame queries compared to naive transformations.

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.