What is the role of the Driver in Spark architecture?
The Driver is the main program that controls the Spark application. It converts user code into tasks, schedules them, and collects results.
Click to reveal answer
beginner
What do Executors do in Spark?
Executors run on worker nodes and execute the tasks assigned by the Driver. They also store data in memory or disk for fast access.
Click to reveal answer
beginner
What is the purpose of the Cluster Manager in Spark?
The Cluster Manager allocates resources across the cluster. It manages where Executors run and how many resources they get.
Click to reveal answer
intermediate
How do Driver, Executors, and Cluster Manager work together in Spark?
The Driver sends tasks to Executors. The Cluster Manager assigns resources and starts Executors on worker nodes. Executors run tasks and send results back to the Driver.
Click to reveal answer
beginner
Name two popular Cluster Managers used with Spark.
Two popular Cluster Managers are YARN (Yet Another Resource Negotiator) and Apache Mesos.
Click to reveal answer
What component in Spark is responsible for scheduling tasks?
ADriver
BExecutor
CCluster Manager
DWorker Node
✗ Incorrect
The Driver schedules tasks and coordinates the execution.
Where do Executors run in a Spark cluster?
AOn the Cluster Manager node
BOn the Driver node
COn worker nodes
DOn the client machine
✗ Incorrect
Executors run on worker nodes to execute tasks.
Which Spark component manages resource allocation?
ACluster Manager
BExecutor
CTask Scheduler
DDriver
✗ Incorrect
The Cluster Manager handles resource allocation across the cluster.
What happens if the Driver fails during a Spark job?
AExecutors continue running tasks
BThe job stops because the Driver coordinates the job
CCluster Manager restarts the job automatically
DNothing, the job finishes normally
✗ Incorrect
The Driver controls the job; if it fails, the job stops.
Which of these is NOT a Cluster Manager for Spark?
AYARN
BApache Mesos
CKubernetes
DHDFS
✗ Incorrect
HDFS is a storage system, not a Cluster Manager.
Explain the roles of Driver, Executors, and Cluster Manager in Spark architecture.
Think about who plans, who works, and who manages resources.
You got /3 concepts.
Describe how Spark components interact during a job execution.
Focus on the flow of tasks and resource management.
You got /3 concepts.
Practice
(1/5)
1. Which component in Spark is responsible for planning the tasks and controlling the job execution?
easy
A. Task Scheduler
B. Executor
C. Cluster Manager
D. Driver
Solution
Step 1: Understand the role of the Driver
The Driver is the main program that creates the SparkContext and plans the tasks to run.
Step 2: Compare with other components
Executors run the tasks, and the Cluster Manager manages resources, but only the Driver plans and controls the job.
Final Answer:
Driver -> Option D
Quick Check:
Driver = plans tasks [OK]
Hint: Driver plans tasks; executors run them [OK]
Common Mistakes:
Confusing executors with driver
Thinking cluster manager plans tasks
Mixing driver with resource manager
2. Which of the following is the correct way to describe the role of executors in Spark?
easy
A. They manage cluster resources and allocate executors
B. They plan the job and schedule tasks
C. They run tasks and store data for the application
D. They submit jobs to the cluster manager
Solution
Step 1: Identify executor responsibilities
Executors run the tasks assigned by the driver and store data in memory or disk during processing.
Step 2: Eliminate other options
Cluster manager manages resources, driver plans jobs, and job submission is done by the driver, not executors.
Final Answer:
They run tasks and store data for the application -> Option C
Quick Check:
Executors = run tasks + store data [OK]
Hint: Executors run tasks and keep data [OK]
Common Mistakes:
Confusing executors with cluster manager
Thinking executors plan jobs
Mixing driver and executor roles
3. Consider a Spark application running on a cluster. Which component is responsible for requesting resources from the cluster manager?
medium
A. Driver
B. Executor
C. Cluster Manager
D. Task Scheduler
Solution
Step 1: Understand resource request flow
The Driver requests resources (executors) from the Cluster Manager to run tasks.
Step 2: Clarify roles of other components
Executors run tasks, Cluster Manager allocates resources, but Driver initiates the request.
Final Answer:
Driver -> Option A
Quick Check:
Driver requests resources [OK]
Hint: Driver asks cluster manager for executors [OK]
Common Mistakes:
Thinking executors request resources
Confusing cluster manager with driver
Assuming task scheduler requests resources
4. You see a Spark application failing because no executors are allocated. Which component should you check first to fix this issue?
medium
A. Cluster Manager configuration
B. Executor logs
C. Driver program code
D. Task Scheduler settings
Solution
Step 1: Identify the cause of no executors
No executors means the cluster manager did not allocate resources.
Step 2: Check cluster manager setup
Cluster Manager manages resource allocation; misconfiguration here can block executors.