Practice Test — Spark SQL, Data Frames, RDDs, Structured
Streaming, Performance Optimization, Distributed Processing &
Fault Tolerance — 195 Multiple-Choice Questions with Answers &
Detailed Rationales
SECTION 1: SPARK ARCHITECTURE AND FUNDAMENTALS (Questions 1-25)
Question 1
Which component of Apache Spark is responsible for scheduling tasks across the cluster and
managing resource allocation?
A. Executor
B. Driver Program
C. Cluster Manager
D. Worker Node
Correct Answer: C
Explanation: The Cluster Manager allocates resources and schedules tasks across worker
nodes, while the Driver coordinates the application's execution and Executors run tasks.
Question 2
In Spark's execution model, what is the primary role of the Driver Program?
A. Store intermediate data in memory
,B. Execute tasks on worker nodes
C. Manage the Cluster Manager
D. Maintain application state and coordinate task execution
Correct Answer: D
Explanation: The Driver Program contains the main method, creates SparkContext, converts
user code into tasks, and coordinates execution across executors.
Question 3
A data engineer notices that their Spark application runs slowly because tasks are not evenly
distributed across partitions. Which Spark concept should they investigate?
A. Lazy evaluation
B. Data skew
C. Lineage graph
D. Checkpointing
Correct Answer: B
Explanation: Data skew occurs when data is unevenly distributed across partitions, causing
some tasks to process significantly more data than others, leading to performance
bottlenecks.
Question 4
What happens to an RDD when an action is called in a Spark application?
,A. The RDD is cached automatically
B. The RDD's lineage is discarded
C. The RDD is evaluated and computation is triggered
D. The RDD is persisted to disk
Correct Answer: C
Explanation: Actions trigger the evaluation of RDD transformations through lazy evaluation,
causing the actual computation to execute across the cluster.
Question 5
Which Spark abstraction provides the lowest-level API for distributed data processing?
A. DataFrame
B. Dataset
C. RDD
D. Spark SQL
Correct Answer: C
Explanation: RDDs (Resilient Distributed Datasets) are the fundamental data structure in
Spark, offering low-level control over distributed collections with type safety.
Question 6
A developer needs to process streaming data with exactly-once semantics. Which Spark
component should they use?
, A. Spark SQL
B. Spark Streaming (DStreams)
C. Structured Streaming
D. GraphX
Correct Answer: C
Explanation: Structured Streaming provides exactly-once processing guarantees through
checkpointing and write-ahead logs, unlike basic DStreams which offer at-least-once
semantics.
Question 7
What is the primary purpose of the SparkContext in a Spark application?
A. To execute SQL queries
B. To represent a connection to the Spark cluster
C. To manage individual task execution
D. To store data in memory
Correct Answer: B
Explanation: SparkContext is the entry point to Spark functionality, representing the
connection between the driver program and the Spark cluster's execution environment.
Question 8
In Spark's architecture, what is a "job"?