**Section 1 — The Context (The 'Why')** Spark Streaming fault tolerance requires checkpointing state and offsets. Checkpoint corruption loses replay; too-frequent checkpoints add overhead. **Section 2 — The Diagram** ``` [Source] --> [Stream] --> [Sink] Checkpoint:S3...
**Pro-Move**: 'Checkpoint to versioned S3.' **Red Flag**: Ephemeral checkpoint.
This hard-level Spark/Big Data question appears frequently in data engineering interviews at companies like Meesho, TCS. While less common, it tests deeper understanding that distinguishes strong candidates. Mastering the underlying concepts (join, optimization, partition) 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. The expert answer includes a code example that demonstrates the implementation pattern.
Section 1 — The Context (The 'Why')
Spark Streaming fault tolerance requires checkpointing state and offsets. Checkpoint corruption loses replay; too-frequent checkpoints add overhead.
Section 2 — The Diagram
[Source] --> [Stream] --> [Sink]
Checkpoint:S3 State:RocksDB
Section 3 — Component Logic
Checkpoint stores offsets and metadata to S3/HDFS. On restart, driver replays from last offset. State store (RocksDB) backs aggregation state. Exactly-once requires: replayable source, idempotent sink, deterministic processing. Backpressure: maxOffsetsPerTrigger. Idempotency at sink: merge on (partition, offset). TTL on state. Never checkpoint to local disk. Why: enables recovery. Why idempotent sink: replay can produce duplicates.
Section 4 — The Trade-offs (The 'Senior' part)
This answer is partially locked
Unlock the full expert answer with code examples and trade-offs
Practice real interviews with AI feedback, track progress, and get interview-ready faster.
Pro starts at $19/mo - cancel anytime
Trusted by 10,000+ aspiring data engineers
Practice the 59 most asked data engineering questions at Meesho. Covers Behavioral, SQL, Spark/Big Data and more.
11 min read →Practice the 44 most asked data engineering questions at TCS. Covers Spark/Big Data, Behavioral, Cloud/Tools and more.
8 min read →According to DataEngPrep.tech, this is one of the most frequently asked Spark/Big Data interview questions, reported at 2 companies. DataEngPrep.tech maintains a curated database of 1,863+ real data engineering interview questions across 7 categories, verified by industry professionals.