Interview guides / mobile
Mobile Developer Interview Questions (iOS & Android)
Cross-platform mobile developer interview questions covering fundamentals, algorithms, projects, debugging, and system design.
Mobile interviews usually follow a loop: fundamentals, coding, practical build or debugging, system design, then behavioral.
Whether you are iOS- or Android-leaning, the themes rhyme: lifecycle, concurrency, offline, performance, and clear tradeoffs.
AceMobileInterview gives matching iOS and Android tracks so you can prep both sides.
1.Walk through the UIViewController lifecycle and where you would load data, configure UI, and clean up observers.
loadView → viewDidLoad (one-time setup) → viewWillAppear → viewIsAppearing → viewDidAppear → viewWillDisappear → viewDidDisappear → deinit. Load remote data after first appear or via a dedicated loader; remove NotificationCenter/KVO observers in deinit or viewDidDisappear depending on scope; cancel in-flight tasks when the screen disappears if results are no longer needed.
2.When do you pick delegate patterns vs completion closures?
Delegates suit multi-method ongoing relationships (tableView). Closures suit one-shot results. Avoid retain cycles: weak delegates, weak self captures.
3.What does iOS sandboxing restrict?
Apps can’t freely read other apps’ data; limited filesystem, entitlements for capabilities (iCloud, push, associated domains). Privacy manifests/permissions gate sensitive APIs.
4.What are common NotificationCenter bugs and how do you avoid them?
Forgetting to remove observers (pre-block API), posting on wrong threads, overusing global events. Prefer Combine publishers, delegates, or scoped observers; always consider lifecycle.
5.What is KVO and what replaced it in many Swift codebases?
KVO observes Obj-C property changes. Prefer Combine, Observation/@Observable, delegates, or closures for Swift-first code. KVO still appears with AVFoundation and legacy APIs.
6.How does cell reuse work and what bugs does it cause?
Cells dequeue from a reuse pool; configure every visible field in cellForRow or configure methods. Stale images/text appear if you don’t reset state; cancel image loads on prepareForReuse.
7.What causes ANRs, and how do you diagnose them?
ANRs happen when the main thread is blocked (~5s for input). Avoid disk/network on Main; use coroutines. Diagnose with ANR traces, StrictMode, and Systrace/Perfetto. Mention BroadcastReceiver and Service timeouts too.
8.Security difference between implicit and explicit intents?
Explicit targets a component. Implicit resolve by filters—risk of interception. Use explicit for internal navigation; validate incoming intent extras.
9.Why specify FLAG_IMMUTABLE/MUTABLE on PendingIntents?
Required on modern APIs for security. Prefer IMMUTABLE unless you must update extras; prevents intent redirection attacks.
10.What are Entity, DAO, and Database in Room?
Entity=table, DAO=queries, Database=holder. Use suspend/Flow queries; type converters carefully; migrations mandatory for schema changes.
11.What belongs in a ViewModel vs UI layer?
UI state and business orchestration surviving rotation. No Android framework Views, no Context leaks (use Application context carefully). Expose immutable UI state flows.
12.How do you expose Retrofit APIs with suspend functions?
suspend endpoints return body/Response; map errors via HttpException. Prefer repository layer; use Call adapters carefully.
13.Given an array of integers and a target, return indices of two numbers that add up to the target. Explain time/space complexity.
Use a dictionary from value → index while iterating once. For each num, look up target - num. O(n) time, O(n) space. Mention edge cases: duplicates, empty array, and that you must not reuse the same index.
14.Check if a string of brackets is valid using a stack in Swift.
Push opening brackets; on closing, pop and match. O(n) time/space. Cover empty string and odd lengths.
15.Implement binary search on a sorted array. Discuss off-by-one pitfalls.
Lo/hi mid; careful mid overflow (lo+(hi-lo)/2). Return index or insertion point. O(log n). Foundation for many Medium problems.
16.Determine if a string of brackets is valid. Implement in Kotlin and discuss complexity.
Stack of opening brackets; on closing, check match. O(n) time, O(n) space. Cover odd length and early exit. Relates to parsing nested UI/token streams.
17.Implement binary search; return index or -1.
Lo/hi mid carefully. Kotlin's Arrays.binarySearch exists—still implement manually in interviews.
18.Max profit with one buy and one sell over a price array.
Track min so far and best profit. O(n). Clarify single transaction constraint.
Keep going with AceMobileInterview
Reading helps. Timed practice locks it in. Jump into the interactive track for algorithms with LeetCode links, studio projects, debugging zips, and mobile system design.