Apache Spark performance and correctness often depend on understanding when work is planned vs when it is executed. Lazy evaluation is the mechanism that lets Spark build an execution plan before running it.
Explain the concept of lazy evaluation in Apache Spark (RDD/DataFrame/Dataset APIs).
In your answer, cover:
Assume the interviewer expects a clear mental model (DAG + trigger) and practical implications (debugging, performance, caching/checkpointing), not deep internals of Catalyst or Tungsten.