Reviewed by Aditya Kumar · Last reviewed 2026-03-24
Checkpointing breaks RDD lineage by materializing to storage, trading storage I/O for DAG truncation. **Why it exists**: Long lineage (e.g., 1000+ stages in iterative algorithms like PageRank or ML) causes stack overflow in the driver and makes fault recovery expensive—Spark...
This hard-level Spark/Big Data question appears frequently in data engineering interviews at companies like Citi, Globant. While less common, it tests deeper understanding that distinguishes strong candidates. Mastering the underlying concepts (spark) will help you answer variations of this question confidently.
This is a senior-level question that tests architectural thinking. Lead with the high-level design, then drill into specifics. Discuss trade-offs explicitly - there is rarely one correct answer. Show awareness of scale, fault tolerance, and operational complexity.
Checkpointing breaks RDD lineage by materializing to storage, trading storage I/O for DAG truncation. Why it exists: Long lineage (e.g., 1000+ stages in iterative algorithms like PageRank or ML) causes stack overflow in the driver and makes fault recovery expensive—Spark would replay the entire DAG. Scalability trade-off: Checkpoint is a full write; at scale, this is costly (network, disk). For batch, prefer persist/cache when lineage is < ~50 stages. Cost implication: Checkpointing to S3 adds egress and request costs; HDFS checkpoint is cheaper but requires cluster storage. Streaming: Checkpoint is mandatory for exactly-once semantics—it stores offsets and state; without it, restart loses position. Architectural logic: Use checkpoint when lineage length or recovery time is the bottleneck; otherwise prefer lazy evaluation. Best practice: checkpointDirectory on durable storage (S3/HDFS); for streaming, always use checkpoint; for batch iterative jobs, checkpoint every N iterations.
Red Flag: Confusing checkpoint with cache or persist. Pro-Move: 'We checkpoint our streaming Kafka job every 5 minutes to S3; when we had a 4-hour outage, we recovered in under 2 minutes by replaying from the last checkpoint.'
Some links below are affiliate links. If you buy through them we may earn a small commission at no extra cost to you — it helps keep DataEngPrep free.
According to DataEngPrep.tech, this is one of the most frequently asked Spark/Big Data interview questions, reported at 2 companies. DataEngPrep.tech maintains an editor-reviewed database of 1,863 data engineering interview questions across 7 categories.