Everything in Mobile Dev, page 12
Why store auth tokens in Keychain, not UserDefaults?
UserDefaults is an unencrypted plist readable from backups and on jailbroken devices; use Keychain Services, which stores encrypted items with access control; save with SecItemAdd and read with…
Compare MVVM with unidirectional flow (TCA, Redux)
MVVM is lightweight with bidirectional binding and per-screen view models; unidirectional flow centralizes a single state mutated only by reducers via actions, gaining predictability and testability at…
Diagnose and fix slow iOS app launch time
Pre-main covers dylib loading, rebasing, and static initializers; main covers didFinishLaunching and first frame; profile with Instruments, then defer work, reduce dynamic libraries, and trim…
Explain UIKit MVC and the Massive View Controller problem
Model holds data, View displays it, Controller mediates between them; the view controller accretes networking, parsing, and logic into a Massive View Controller.
Describe the iOS app lifecycle and SceneDelegate methods
Not running, inactive, active, background, suspended; SceneDelegate handles sceneDidBecomeActive, sceneWillResignActive, sceneDidEnterBackground, sceneWillEnterForeground.
How do you build a custom SwiftUI Layout?
Conform to Layout, implement sizeThatFits to report the container size for a proposal, and placeSubviews to position each subview using its measured size.
How does Auto Layout resolve constraints?
Auto Layout solves a system of prioritized linear equations; intrinsicContentSize is a view's natural size; hugging resists growing, compression resistance resists shrinking.
What is @autoclosure and when is it useful?
@autoclosure wraps an argument expression in a closure so it evaluates lazily only if used, enabling clean APIs like assert and the ?? operator.
Why can't you subscript a Swift String with an Int?
Characters are extended grapheme clusters of variable byte width, so integer offsets are not O(1) or meaningful; String.Index is an opaque position you advance via the collection.
How does Swift's switch differ from C's switch?
Switches must be exhaustive, there is no implicit fallthrough between cases, and cases can match ranges, tuples, and bind values.
Test Plans (XCTestPlan)
A Test Plan is an Xcode configuration file decoupling which tests run from how they run, letting one scheme execute many configurations: localizations, sanitizers, randomized order, and repetition, all without editing the scheme.
Dart reduce versus fold on collections
Reduce combines same-type elements and throws on empty; fold takes an initial value and accumulator of any type, safe on empty.
Auth-protected routes via GoRouter redirect
A top-level redirect reads auth state, sends unauthenticated users to login, sends logged-in users away from login, and uses refreshListenable to re-evaluate on auth change.
Isolating and reducing excessive widget rebuilds
Push state down, use const subtrees, rebuild only listeners with ValueListenableBuilder, isolate repaints with RepaintBoundary.
iOS code signing for a TestFlight release
A signing certificate proves who built the app; a provisioning profile ties cert, app ID and devices together; configure in Xcode, archive and upload.
Testing a tap that triggers a SnackBar
PumpWidget the app, find the button, tester.tap it, call pump or pumpAndSettle to advance frames, then expect a SnackBar finder.
MethodChannel data flow and type marshalling
Dart invokeMethod sends a StandardMessageCodec-serialized payload to native, which returns a primitive or map; complex objects must be reduced to supported types.
Building a custom implicitly animated widget
Extend ImplicitlyAnimatedWidget, use AnimatedWidgetBaseState, define tweens in forEachTween, read values in build.
Diagnosing and fixing CustomPainter jank
Avoid work in paint, gate repaints with shouldRepaint, isolate with RepaintBoundary, cache static layers.
Immutable bloc state versus mutable ChangeNotifier
Immutable gives predictable diffs, easy debugging and replayability at the cost of boilerplate; mutable is terse but error-prone.
We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.
See open roles