← Google Interview Insights

Google·Software Engineer·Technical Phone Screen·Senior

Senior
Apr 2026

Summary

Google data engineering interview, technical phone screen focused on Spark internals. One question but it had some depth to it.

Questions Asked (1)

Q1

What are the differences between wide and narrow dependencies in Apache Spark?

System DesignTechnical Trade-offs
Author's notes

I knew this conceptually but fumbled the explanation a bit.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining wide and narrow dependencies in terms of data shuffling and partition lineage. Then explain how they affect performance, fault tolerance, and optimization, using concrete examples like map vs. groupByKey. Finally, connect to Spark's execution model and trade-offs in system design.

Pro tip: Emphasize that narrow dependencies enable pipelining and efficient recovery, while wide dependencies trigger shuffles and stage boundaries—this shows you understand Spark's internals beyond surface-level definitions.

1. Define the concepts

Clearly state that narrow dependencies mean each parent partition maps to at most one child partition, while wide dependencies mean multiple child partitions depend on a single parent partition.

2. Explain data flow and shuffling

Describe how narrow dependencies avoid shuffling (e.g., map, filter) and wide dependencies require shuffling data across the network (e.g., groupByKey, reduceByKey).

3. Discuss performance implications

Highlight that narrow dependencies allow pipelining and efficient fault recovery, while wide dependencies introduce stage boundaries, network overhead, and potential bottlenecks.

4. Connect to fault tolerance and optimization

Explain that narrow dependencies enable recomputation of only lost partitions, whereas wide dependencies may require recomputing multiple parent partitions, affecting recovery time.

5. Relate to system design trade-offs

Discuss how choosing transformations with narrow dependencies can improve performance, but wide dependencies are sometimes necessary for operations like joins or aggregations.

Key Points to Mention

  • Narrow dependencies: one-to-one or one-to-many partition mapping without shuffling.
  • Wide dependencies: many-to-one or many-to-many partition mapping requiring shuffling.
  • Examples: map, filter, union (narrow); groupByKey, reduceByKey, join (wide).
  • Impact on stage boundaries: wide dependencies create new stages in the DAG.
  • Fault tolerance: narrow dependencies allow efficient lineage-based recomputation.
  • Performance: wide dependencies cause network I/O and disk I/O, often the bottleneck.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.