Recall & Review
beginner
What is lazy evaluation in Spark?
Lazy evaluation means Spark delays running computations until an action is called. It builds a plan first, then runs all steps together.
Click to reveal answer
beginner
Why does Spark use lazy evaluation?
Spark uses lazy evaluation to optimize performance by combining steps and reducing data movement, saving time and resources.
Click to reveal answer
beginner
Which Spark operations trigger execution in lazy evaluation?
Actions like count(), collect(), saveAsTextFile(), and take() trigger Spark to run the planned computations.
Click to reveal answer
beginner
What is the difference between transformations and actions in Spark?
Transformations create a new dataset and are lazy (not executed immediately). Actions compute and return results, triggering execution.
Click to reveal answer
beginner
How does lazy evaluation help when working with large datasets?
It avoids unnecessary work by only computing what is needed, which saves memory and speeds up processing on big data.
Click to reveal answer
What triggers Spark to execute computations in lazy evaluation?
✗ Incorrect
Only actions like collect() trigger execution; transformations are lazy and do not run immediately.
Which of these is an example of a Spark transformation?
✗ Incorrect
filter() is a transformation and is lazy; count(), saveAsTextFile(), and take() are actions.
Why is lazy evaluation useful in Spark?
✗ Incorrect
Lazy evaluation helps Spark optimize by delaying execution and combining steps.
Which Spark operation will NOT trigger execution?
✗ Incorrect
map() is a transformation and does not trigger execution; others are actions.
What happens if you define multiple transformations before an action?
✗ Incorrect
Spark builds a plan with all transformations and runs them together when an action is called.
Explain lazy evaluation in Spark and why it is important.
Think about when Spark actually runs your code.
You got /4 concepts.
Describe the difference between transformations and actions in Spark with examples.
Focus on what causes Spark to run computations.
You got /3 concepts.