SwiftPumpkin

For iOS engineers getting ready for interviews

Swift design patterns, built into one tiny app you can run.

One small feature, write a thank-you note and pick a pumpkin, built 22 ways. Each lesson shows the wiring, the code, what it costs and when I'd use it. Then you practice saying it out loud.

Start with MVCPractice 111 cards

The SwiftPumpkin app: today's interview cards and a path of pumpkins, one per pattern

The one question behind every pattern

Which way does the arrow point?

Why a refresher, even after years of shipping

Patterns are vocabulary and building blocks. Even if no interviewer asks about Decorator or Composite by name, refreshing them widens the set of solutions you can reach for in a system design round.

Your progress

Start with MVC
0of 22 patterns complete
0of 111 cards nailed
0shaky cards to revisit

Each pumpkin is built a row of bricks at a time as you nail its cards. Progress is saved in this browser, with no account needed.

Learn

Every lesson has the same shape, so you always know where you are: wiring, code, trade-offs, when to use it, then check yourself.

1 · UI patterns

  1. MVCMVC (Model–View–Controller) is an architectural pattern that separates an application's data, presentation, and coordination logic.
  2. MVVM (+ Router)Move logic into a view model that never imports UIKit, then bind the view to it.
  3. MVP (Passive View)The view is passive: it forwards events and obeys commands.
  4. VIPERSplit one screen into View, Interactor, Presenter, Entity and Router, each talking through protocols.
  5. Clean Swift (VIP)View → Interactor → Presenter → View: data goes one way round a loop, as plain Request/Response/ViewModel structs.
  6. Coordinator / RoutingPull navigation out of view controllers.
  7. Unidirectional (TCA / Redux)State changes in exactly one place: a reducer that takes the current state and an action.

2 · System architecture

  1. Dependency InjectionPass dependencies in, preferably through init, instead of reaching for .shared.
  2. Protocol-Oriented ProgrammingDefine behavior as protocols with default implementations, then compose instead of subclassing.
  3. Facade & ModulesHide a messy subsystem behind one small API, inside a module whose internals the compiler protects.
  4. RepositoryOne collection-like API for your models that hides whether data came from cache, disk or network.
  5. Factory & BuilderA factory picks and wires the concrete type.
  6. Services vs SingletonsA singleton answers 'how many exist?'.
  7. Decoupled LayersUI → Domain ← Data.
  8. Feature ModulesSplit each feature into a tiny interface module and an implementation module, wired at one composition root.

3 · Callbacks and concurrency

  1. DelegateOne-to-one callback through a protocol, held weakly so parent and child don't retain each other.
  2. Pub/SubPublish an event once and any number of subscribers react, without the publisher knowing them.
  3. Completion Handlers"Call me back when you're done." The rule is exactly once on every path, and nothing enforces it.
  4. Promises → async/awaitFutures made the callback contract an object, and async/await made it the language.
  5. Swift 6 ConcurrencyIsolation instead of locks: actors and the main actor own state, Sendable values cross between them, and tasks form a cancellable tree.

4 · SwiftUI architecture

  1. Declarative UI (React lineage)UI = f(state).
  2. State ManagementEvery piece of state has one owner: @State, @Binding, @Environment or an @Observable model.
DecideMVC, MVVM, VIPER or RIBs? The questions that settle it, and my defaults. PracticeInterview cards, shakiest first. Say it, reveal, rate yourself. Interview prepArchitecture questions by priority, with staff-level answers. System designFeed, chat, images and sync, walked through the way you'd do it in the room. Run the appClone it, press ⌘R. No signing, no network, no dependencies.