Concurrency Bugs Every iOS Dev Should Know

There's a particular kind of silence in an interview room when the interviewer pulls up a code snippet and asks, "What's wrong with this?"
It's usually a concurrency bug. And if you've never seen one before, you're about to have a bad time.
What This Series Covers
I've been putting together practice projects for senior iOS interview prep. Real, runnable code with intentional bugs—the kind you see in code reviews and production incidents.
This series walks through the exercises, explaining what's wrong and how to fix it. We'll cover:
Concurrency
- GCD: Race conditions, main thread violations, deadlocks
- Swift Concurrency: Task cancellation, actor reentrancy, task leaks
- Combine: Retain cycles, subscription management
Testing
- Dependency injection patterns
- Testing code with side effects (UserDefaults, file system)
- ViewModel testing and protocol-based mocking
- Async/await testing
SwiftUI
- Lists, grids, and navigation patterns
- State management approaches
- Form validation
The Practice Projects
All code is on GitHub: github.com/christopherkmoore/iOS-Practice
New here? Read the setup guide to get started.
Three Xcode projects:
- ConcurrencyBugHunt — Exercises with intentional concurrency bugs
- SwiftUIBuilder — UI patterns with mock APIs
- TestabilityWorkshop — Before/after refactoring for testability
Clone, run, find the bug, fix it.
Coming Up
Next post: Race Conditions. A shopping cart that loses items, and why unsynchronized shared state causes so many production bugs.