Skip to main content
InterviewHubPRO
Section Overview
Q19

Question 19 of 50

Part 2: Concurrency, Actors & Advanced Architecture (11 - 24)

38%
Swift & Concurrency (50 Qs)•Part 2: Concurrency, Actors & Advanced Architecture (11 - 24)

How does Structured Concurrency differ from Unstructured Concurrency (Task.detached) in Swift?

senior LevelSystem Design

In Simple Words:

  • Structured (async let, withTaskGroup): Child tasks inherit task priorities, cancellation state, and task-local values from the parent scope. Guarantees that child tasks complete before the parent scope exits.
  • Unstructured (Task.detached): Spawns an independent background task that does not inherit caller priority or cancellation, requiring manual lifecycle management.