SwiftPumpkin

Retrieval practice

Practice

One card at a time. Say your answer out loud, reveal, then rate yourself. Shaky cards come back first next time.

Keys: Space reveal · 1 shaky · 2 nailed it · → skip

MVC30-second answer

Explain MVC in 30 seconds.

MVCSwiftAsked directly

What is "Massive View Controller" actually a symptom of?

MVCSystem designAsked indirectly

Two tabs show the same notes. You edit in one and the other shows stale data. What's wrong with the design?

MVCiOS codingAsked indirectly

You inherit a 1,500-line view controller. What do you extract first, and why in that order?

MVCSystem designAsked indirectly

When would you move a team off plain MVC, and how?

MVVM (+ Router)30-second answer

Explain MVVM (+ Router) in 30 seconds.

MVVM (+ Router)iOS codingAsked directly

MVVM vs MVC in UIKit: what exactly moves into the view model, and what does that buy you?

MVVM (+ Router)iOS codingAsked indirectly

The model changes from network updates while the screen is visible. How does your view model keep the view in sync?

MVVM (+ Router)System designAsked indirectly

Your team is debating MVC versus MVVM for a new app. What questions settle it?

MVVM (+ Router)System designAsked indirectly

Your team wants MVVM but refuses to adopt a reactive framework. Is that viable?

MVVM (+ Router)System designAsked indirectly

A year after moving to MVVM, view models are 800 lines. What went wrong?

MVVM (+ Router)System designAsked indirectly

Does AI-assisted development change how you'd architect an iOS app?

MVP (Passive View)30-second answer

Explain MVP (Passive View) in 30 seconds.

MVP (Passive View)iOS codingAsked directly

What is Passive View, and how does it differ from Supervising Controller?

MVP (Passive View)iOS codingAsked indirectly

You need to unit-test form validation and error display without instantiating UIKit. How do you structure the screen?

MVP (Passive View)System designAsked indirectly

Two screens show the same model and must both update when it changes. Observer synchronization or explicit flow synchronization?

VIPER30-second answer

Explain VIPER in 30 seconds.

VIPERSystem designAsked directly

Walk through VIPER's roles. Who owns business logic, who decides to navigate, and who performs the transition?

VIPERSystem designAsked indirectly

The team might replace Core Data next year. How do you keep business logic from depending on the persistence technology?

VIPERSystem designAsked indirectly

Adopting VIPER produced many tiny files per screen and the team is frustrated. How do you adopt it pragmatically?

VIPERSystem designAsked indirectly

You moved a 3,000-line view controller to VIPER, and a few hundred engineers now build on it. What starts to hurt next?

VIPERSystem designAsked directly

In RIBs, the architecture very large apps grew out of VIPER, why would a node have no view at all?

VIPERiOS codingAsked indirectly

In a RIBs-style tree, a child node needs the signed-in player's name. A teammate wants an optional on a shared object. What do you do instead?

VIPERSystem designAsked indirectly

Beyond VIPER (RIBs-style): about 40 teams ship into one app, and one feature's failure must not block the core flow. How do you structure the modules?

Clean Swift (VIP)30-second answer

Explain Clean Swift (VIP) in 30 seconds.

Clean Swift (VIP)System designAsked directly

Trace one user action through the VIP cycle. What types cross each boundary?

Clean Swift (VIP)iOS codingAsked indirectly

A selected order must reach the detail scene without the detail screen reaching back into the list. How?

Clean Swift (VIP)iOS codingAsked indirectly

Your presenter calls back into the view controller. How do you avoid a retain cycle and keep formatting testable?

Coordinator / Routing30-second answer

Explain Coordinator / Routing in 30 seconds.

Coordinator / RoutingiOS codingAsked directly

What problem does the Coordinator pattern solve, and how do child coordinators stay alive and get cleaned up?

Coordinator / RoutingiOS codingAsked indirectly

This detail screen must open from two different flows. How do you avoid it knowing where it came from?

Coordinator / RoutingSystem designAsked indirectly

An edit-profile screen needs to save via an API call. Does the POST belong in the view controller?

Unidirectional (TCA / Redux)30-second answer

Explain Unidirectional (TCA / Redux) in 30 seconds.

Unidirectional (TCA / Redux)System designAsked directly

Explain TCA's State, Action, Reducer, Store and Effects. What do you gain, and what does it cost?

Unidirectional (TCA / Redux)iOS codingAsked indirectly

Async responses mutate the same screen state from three places, and bugs depend on arrival order. How do you make updates predictable?

Unidirectional (TCA / Redux)iOS codingAsked indirectly

How do you test a feature where a tap fires a network request that later updates state?

Unidirectional (TCA / Redux)System designAsked indirectly

Do you need a Redux-style framework to get one-way data flow in UIKit?

Dependency Injection30-second answer

Explain Dependency Injection in 30 seconds.

Dependency InjectionSwiftAsked directly

Initializer, property and parameter injection in Swift: when do you choose each?

Dependency InjectionSystem designAsked indirectly

A teammate proposes a global service locator so any class can fetch its dependencies. What's your concern?

Dependency InjectioniOS codingAsked indirectly

A view controller loaded from a storyboard needs an API client, but you don't control its initializer. How do you inject it?

Protocol-Oriented Programming30-second answer

Explain Protocol-Oriented Programming in 30 seconds.

Protocol-Oriented ProgrammingSwiftAsked directly

some versus any: what's the real difference, and which should be your default?

Protocol-Oriented ProgrammingSwiftAsked indirectly

A function returns a long nested generic type that leaks implementation details. How do you hide it without losing performance?

Protocol-Oriented ProgrammingSwiftAsked indirectly

A type implements a method that also lives in a protocol extension, yet the extension's version runs. Why?

Facade & Modules30-second answer

Explain Facade & Modules in 30 seconds.

Facade & ModulesSystem designAsked directly

Facade versus Gateway: what's the difference, and who writes each?

Facade & ModulesSystem designAsked indirectly

A third-party analytics SDK is imported in forty files and now must be replaced. How do you prevent that next time?

Facade & ModulesSystem designAsked indirectly

Sibling modules in your Swift package need shared helper APIs, but app clients shouldn't use them. How do you expose them?

Repository30-second answer

Explain Repository in 30 seconds.

RepositorySystem designAsked directly

What is the Repository pattern, and what does it centralize?

RepositoryiOS codingAsked indirectly

You must ship a feature before the storage choice is decided. How do you avoid rewriting the view model later?

RepositorySystem designAsked indirectly

Similar query logic for the same entities is duplicated across many view models. Where should it live, and why?

RepositorySystem designAsked indirectly

Five view models each call the network singleton directly. How do you restructure access to remote and disk data?

Factory & Builder30-second answer

Explain Factory & Builder in 30 seconds.

Factory & BuilderSwiftAsked directly

When is the Builder pattern still worth it in Swift, given structs and value types?

Factory & BuilderiOS codingAsked indirectly

Fast browsing builds a queue of stale requests on one shared movie loader. How do you fix the design?

Factory & BuilderSwiftAsked indirectly

A mutable attributed string is handed to the database while still being modified, causing crashes. What design prevents this?

Factory & BuilderSystem designAsked indirectly

You're shipping a persistence framework. How do callers write rich queries without seeing your internal operation types?

Factory & BuilderiOS codingAsked indirectly

The codebase has TitleLabel, SubtitleLabel and SpinnerViewController subclasses that only set properties. What do you change?

Factory & BuilderiOS codingAsked indirectly

Every test builds a User with ten arguments, and a new field breaks 200 tests. What's the fix?

Services vs Singletons30-second answer

Explain Services vs Singletons in 30 seconds.

Services vs SingletonsSystem designAsked directly

Singletons versus injected services: what goes wrong with UserManager.shared, and how do you migrate?

Services vs SingletonsiOS codingAsked indirectly

Tests pass individually but fail together because one test logs a user in. What's the root cause, and the fix?

Services vs SingletonsSystem designAsked indirectly

Some resources should be shared, like an image cache. How do you share them without a singleton's downsides?

Services vs SingletonsiOS codingAsked indirectly

On logout you clear the image-cache singleton, but user A's thumbnails still show up for user B. What happened?

Services vs SingletonsSystem designAsked indirectly

Product now wants two accounts signed in at once, and SessionManager.shared is used everywhere. How do you plan the migration?

Services vs SingletonsSystem designAsked directly

The AppDelegate holds the API client, the cache and the current user. What test decides what may stay global?

Decoupled Layers30-second answer

Explain Decoupled Layers in 30 seconds.

Decoupled LayersSystem designAsked directly

State the dependency rule. How does a use case call out to a presenter without breaking it?

Decoupled LayersSystem designAsked indirectly

The domain layer passes Core Data managed objects straight up to views. What's the risk, and the fix?

Decoupled LayersSystem designAsked indirectly

The same business rules must power iPhone, iPad and Mac apps. How do you layer the code?

Decoupled LayersSystem designAsked indirectly

Rules like whether a user can comment are copied across view controllers and a global helper. Where should they live?

Feature Modules30-second answer

Explain Feature Modules in 30 seconds.

Feature ModulesSystem designAsked directly

Why split an app into dozens of SPM feature modules? What do you actually gain?

Feature ModulesSystem designAsked indirectly

Onboarding only appears on first launch, so QA keeps reinstalling the app to test it. How would you restructure the code?

Feature ModulesSystem designAsked indirectly

Feature A must navigate to Feature B, but feature modules shouldn't import each other. How do you wire it?

Feature ModulesSystem designAsked indirectly

Leadership wants a strict modular, plugin-based architecture for a 10-person team. What does it actually cost?

Delegate30-second answer

Explain Delegate in 30 seconds.

DelegateSwiftAsked directly

Delegate protocol or closures: how do you choose for a component's callbacks in Swift?

DelegateiOS codingAsked indirectly

After adding a delegate to your custom component, neither the component nor its owning screen ever deallocates. What happened?

DelegateiOS codingAsked indirectly

A tap inside a deeply nested child view controller must trigger navigation owned several levels up. How do you route it?

DelegateiOS codingAsked indirectly

Two reusable components on one screen both need to be the scroll view's delegate. UIKit allows only one. What do you do?

Pub/Sub30-second answer

Explain Pub/Sub in 30 seconds.

Pub/SubSwiftAsked directly

Compare delegation, NotificationCenter and KVO by coupling and fan-out. When does each fit?

Pub/SubiOS codingAsked indirectly

A notification handler updates a label and sometimes misbehaves or crashes. What do you check?

Pub/SubSystem designAsked indirectly

NotificationCenter is used everywhere and nobody knows who reacts to what. How do you make observation safer and clearer?

Pub/SubiOS codingAsked indirectly

Your custom observer list keeps observers alive long after their screens close. How do you fix the storage?

Pub/SubiOS codingAsked indirectly

A shared player takes observation closures, and old screens keep reacting after they're gone. What's the design flaw?

Completion Handlers30-second answer

Explain Completion Handlers in 30 seconds.

Completion HandlersSwiftAsked directly

What's wrong with a completion handler taking Data? and Error?, and how does Result fix it?

Completion HandlersSwiftAsked indirectly

Code review finds a function with several early returns that sometimes never calls its completion. How do you prevent this bug class?

Completion HandlersiOS codingAsked indirectly

A view model stores a completion closure that references the view controller, and the screen never deallocates. Fix it.

Completion HandlersSwiftAsked directly

Swift has throws. Why would you still pass a Result value?

Promises → async/await30-second answer

Explain Promises → async/await in 30 seconds.

Promises → async/awaitSwiftAsked directly

How do you wrap a completion-handler API with async/await, and which rule must never be broken?

Promises → async/awaitSwiftAsked indirectly

Profiling shows checked continuations in a hot path. Can you switch to unsafe ones, and what do you give up?

Promises → async/awaitiOS codingAsked indirectly

A UIKit button handler must call an async method and show errors. How do you bridge sync and async?

Swift 6 Concurrency30-second answer

Explain Swift 6 Concurrency in 30 seconds.

Swift 6 ConcurrencySwiftAsked directly

Swift 6 makes data races compile errors. What concurrency bugs can you still ship?

Swift 6 ConcurrencyiOS codingAsked indirectly

Search results flicker and sometimes show results for an older query. Walk through the fix.

Swift 6 ConcurrencySystem designAsked indirectly

You're migrating a large UIKit app to Swift 6 strict concurrency. How do you plan it?

Declarative UI (React lineage)30-second answer

Explain Declarative UI (React lineage) in 30 seconds.

Declarative UI (React lineage)SwiftAsked directly

Imperative UIKit vs declarative SwiftUI: what fundamentally changes in how you update the screen?

Declarative UI (React lineage)iOS codingAsked indirectly

A form uses isTyping, isSubmitting and isEmpty flags, and sometimes shows a spinner and an error together. How do you fix it?

Declarative UI (React lineage)iOS codingAsked indirectly

A search field and a results list are siblings. Where does the query live, and how does the field change it?

State Management30-second answer

Explain State Management in 30 seconds.

State ManagementSwiftAsked directly

With an @Observable model, how do you choose between @State, @Environment, @Bindable, or a plain property?

State ManagementiOS codingAsked indirectly

A child Play button must toggle the parent's isPlaying, but passing a copy loses sync. What's the correct wiring?

State ManagementSwiftAsked indirectly

After migrating to @Observable, a screen's model resets whenever its parent redraws. What's wrong?

State ManagementSystem designAsked indirectly

Two architecture proposals both handle model data fine. How do you compare them fairly?