Architecture interview questions
48 questions from real iOS interviews. Topics: MVVM, MVI, TCA, Clean Architecture, DI, modularization, Coordinator.
- ArchitectureShort answer
Cocoa MVC
How does Cocoa MVC in UIKit differ from the textbook MVC?
#mvc #cocoa-mvc #massive-view-controller #uikit
- ArchitectureMultiple choice
Placing MVC roles
In an MVC iOS app, where's the best place for the code that turns a date string from the server into a display format for the user's locale?
#mvc #responsibility #layering
- ArchitectureShort answer
Singleton pattern
When do you use a singleton in an iOS app, and what's the problem with it?
#singleton #global-state #testing #thread-safety
- ArchitectureShort answer
Delegate pattern
Can you explain the Delegate pattern that shows up all over UIKit?
#delegate #notification #kvo #closure
- ArchitectureMultiple choice
Choosing a communication style
In which of these situations is NotificationCenter the best fit?
#delegate #notification #closure #design
- ArchitectureShort answerExpedia
Scope of a singleton
In a travel app, a global SessionManager.shared holds auth, cache, analytics, and experiment values all at once, and that makes testing hard. How would you dec…
#singleton #dependency-injection #testability #global-state
- ArchitectureShort answer
MVC vs MVVM
Someone proposes moving an app that works fine on MVC over to MVVM. What's the fundamental difference between MVVM and MVC?
#mvc #mvvm #viewmodel #testability
- ArchitectureMultiple choice
ViewModel boundaries
In MVVM, which of these should a ViewModel not have? Select all that apply.
#mvvm #viewmodel #responsibility #uikit
- ArchitectureShort answer
MVP, VIPER, MVI, RIBs
Besides MVVM, walk me through the architectures you know (MVP, VIPER, MVI, RIBs, and so on), one at a time, and tell me how they differ.
#mvp #viper #mvi #ribs
- ArchitectureShort answer
Dependency injection
Why do we do dependency injection in an iOS app?
#dependency-injection #protocol #testing #composition-root
- ArchitectureMultiple choice
Choosing DI style
Which of these statements about dependency injection styles are correct? Select all that apply.
#dependency-injection #initializer #property #environment
- ArchitectureShort answer
How KVO works
How does KVO in the Objective-C runtime detect property changes under the hood?
#kvo #kvc #objective-c-runtime #isa-swizzling
- ArchitectureMultiple choice
NotificationCenter behavior
Which of these statements about Foundation's NotificationCenter are correct? Select all that apply.
#notification #notificationcenter #thread #observer
- ArchitectureShort answer
SOLID principles
Can you explain the five SOLID principles with iOS code examples, not shapes and animals?
#solid #srp #ocp #lsp
- ArchitectureMultiple choice
Identifying design patterns
Which of these correctly pair a situation with a design pattern? Select all that apply.
#design-pattern #observer #adapter #decorator
- ArchitectureShort answer
Reactive programming
What problems does reactive programming, as in RxSwift or Combine, solve for you on iOS?
#rxswift #combine #reactive #async-sequence
- ArchitectureShort answerWalmart
DI vs DIP
Dependency Injection and the Dependency Inversion Principle have similar names. What's the difference?
#dependency-injection #dependency-inversion #solid #protocol
- ArchitectureMultiple choiceWalmart
Unit testing with singletons
In a codebase where a singleton like AnalyticsManager.shared is referenced directly all over, you want to unit test a view model that uses it. Which approaches…
#singleton #unit-test #testability #mock
- ArchitectureShort answerGojek
Judging third-party libraries
This is a take-home review. You didn't use a single third-party library in the app you submitted, and the interviewer asks why not, and if you had to, which pa…
#third-party #dependency #spm #adapter
- ArchitectureMultiple choicePaytm
Singleton deinit
For a singleton of the form static let shared = SessionManager(), someone asks "can you make deinit get called, and is there a real case where you'd need to?" …
#singleton #deinit #lifetime #scope
- ArchitectureShort answerCRED
Where business logic lives
Pick the last screen you built and walk me through it end to end. Where did you put the business logic on that screen, and why?
#mvvm #business-logic #viewmodel #domain
- ArchitectureShort answerDropboxinterview report
Modularizing a file list feature
You're designing an iOS file and folder list feature with search and pull-to-refresh. To keep it maintainable independent of the UI framework, what module boun…
#feature-module #repository #search #refresh
- ArchitectureShort answer
Coordinator pattern
What problem is the Coordinator in MVVM-C meant to solve?
#coordinator #navigation #mvvm-c #routing
- ArchitectureMultiple choice
Coordinator memory
In this Coordinator implementation, LoginCoordinator stays in memory after the login flow finishes. Which is the most likely cause? …
#coordinator #memory #retain-cycle #weak
- ArchitectureShort answerPayPalinterview report
Minimal NotificationCenter
This is a live coding exercise. Without Foundation's NotificationCenter, design and implement a small EventBus in Swift that subscribes and publishes by name. …
#pub-sub #observer #notification #coding
- ArchitectureShort answer
Legacy MVC to MVVM
You've been asked to move a 5-year-old MVC app (150 view controllers, almost no tests) to MVVM, and the service has to keep shipping. What's your strategy?
#migration #legacy #mvvm #refactoring
- ArchitectureShort answer
API client abstraction
You have three network clients for the auth server, product server, and payment server that are similar but slightly different (different headers, encoding, er…
#protocol #generic #network-layer #endpoint
- ArchitectureShort answerAirbnbinterview report
Modularization strategy
You want to split an app that grew into a single target into modules. What criteria do you use to draw module boundaries?
#modularization #spm #framework #build-time
- ArchitectureMultiple choice
Module dependency direction
The SearchFeature module needs to open CheckoutFeature's payment screen from a search result. What's the correct way to do this without creating a circular dep…
#modularization #dependency #interface #circular
- ArchitectureShort answer
Deciding on TCA
Your team is evaluating TCA (The Composable Architecture). What problems does TCA solve?
#tca #composable-architecture #unidirectional #reducer
- ArchitectureMultiple choice
TCA components
In TCA, you're implementing "tap a button, fetch a list over the network, show it on screen." Which description of a component's role is wrong?
#tca #reducer #effect #state
- ArchitectureShort answerHeadspace
Analytics event dispatch
This is a take-home assignment. Design a layer in plain Swift that sends analytics events to several services (Google Analytics, Snowplow, and so on). Requirem…
#analytics #protocol #dispatcher #open-closed
- ArchitectureShort answerMicrosoft
Data layer for a tabbed app
This is a whiteboard design. You're building a stripped-down Outlook app with only a Messages tab and a Contacts tab. Data read from the API has to show up in …
#repository #single-source-of-truth #caching #startup
- ArchitectureShort answerCRED
Limits of MVVM
You said you chose MVVM for this feature. When does MVVM actually hurt?
#mvvm #trade-off #refactoring #strangler
- ArchitectureMultiple choiceFlipkart
Deep links at scale
In a large app split into dozens of modules, which of these are correct designs for handling deep links (URL schemes, Universal Links, push payloads)? Select a…
#deep-link #universal-link #router #modularization
- ArchitectureShort answerDiDi
Request state machine
A screen with a network request has loading, success, failure, retry, refresh, and cancel states all tangled together. How do you design those state transition…
#state-machine #enum #loading-state #cancellation
- ArchitectureShort answerKuaishou
Extensible search API
Here's a file search function. Now it has to find only "UTF-8 txt or H.264 mp4" and "files modified within the last week," and the conditions will keep growing…
#api-design #closure #predicate #open-closed
- ArchitectureShort answer네이버웹툰
Clean Architecture circles vs user flow
Your tech lead says "the Clean Architecture circles (the concentric diagram) don't seem to match the user's perspective in iOS development." The flow the user …
#clean-architecture #dependency-rule #use-case #user-flow
- ArchitectureShort answer당근interview report
Server Driven UI
You want to change the feed screen's section makeup, order, and card types without shipping an app update. How do you design the Server Driven UI schema and th…
#server-driven-ui #sdui #component-registry #versioning
- ArchitectureShort answer당근
Designing for long-term maintenance
You've been asked "how would you design this feature so it's still maintainable years from now?" Using a feature you built recently as the example, explain wha…
#maintainability #design-decision #testability #adr
- ArchitectureShort answerInstacartinterview report
Reusable UI component boundaries
On a UIKit cart screen, the product card is used in the list, in search, and in recommendations, but the tap behavior and badges differ per screen. When you de…
#uikit #reusable-component #collection-view #configuration
- ArchitectureShort answerJD.com
Moving from MVC to MVVM
In an existing UIKit shopping app, the UIViewController handles the API calls, the cache, and the loading UI. When you move from MVC to MVVM, which layer would…
#mvvm #repository #migration #caching
- ArchitectureShort answer카카오모빌리티interview report
Protocol-oriented composition
In an iOS ride service feature with route guidance, fare calculation, and live location updates, the inheritance hierarchy has gotten complicated. With protoco…
#protocol-oriented #dependency-injection #composition #ios
- ArchitectureShort answer우아한형제들interview report
Incremental legacy refactoring
You need to improve the structure of a massive ViewController in a live UIKit order feature without rewriting it all at once. If you split the work into small …
#refactoring #legacy #feature-flag #migration
- ArchitectureShort answer
Architecture by team size
As an iOS team grows from 5 to 10 to 100 people, how should the way you manage code conflicts, quality, and architecture change at each stage?
#scaling #team #modularization #code-ownership
- ArchitectureShort answer
Large SwiftUI app structure
If you were designing a SwiftUI app from scratch with dozens of screens and several teams working on it, how would you set up state management, navigation, dep…
#swiftui #large-scale #modularization #navigation
- ArchitectureMultiple choice
Method swizzling
Which of these statements about method swizzling are correct? Select all that apply.
#method-swizzling #objective-c-runtime #aop #risk
- ArchitectureShort answer
Clean Architecture layers
When you apply Clean Architecture on iOS, can you walk me through the layers and the dependency rule?
#clean-architecture #use-case #domain #boundary