AceMobileInterview

Interview guides / ios

Google-Style iOS Interview Questions

Unofficial Google-style iOS interview prep: coding quality, Swift fundamentals, mobile system design, and performance tradeoffs.

Unofficial prep only. Google loops vary by team and AceMobileInterview is not affiliated with Google.

Expect strong coding, clear complexity talk, and mobile design that respects memory, battery, and flaky networks. Practice explaining tradeoffs out loud.

  1. 1.How would you design an offline-capable notes client for iOS?

    Local store as source of truth, pending vs synced states, outbox for mutations, explicit stale UI, and a simple conflict policy. Keep the timebox honest: ship CRUD + mock sync before a full sync engine.

  2. 2.Walk through diagnosing a retain cycle that only appears after opening a screen twice.

    Suspect escaping closures, delegates, or NotificationCenter observers. Use Memory Graph / Instruments Allocations. Confirm with [weak self], break ownership cycles, and verify deinit logs fire when leaving the screen.

  3. 3.Compare GCD and Swift Concurrency for new iOS code.

    Prefer async/await and actors for structured cancellation and isolation. Reach for GCD when integrating legacy queues, fine QoS tuning, or C APIs. UI stays on MainActor.

  4. 4.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.

  5. 5.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.

  6. 6.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.

  7. 7.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.

  8. 8.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.

  9. 9.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.

  10. 10.When would you use Result<Success, Failure> instead of throws?

    Result is great for async callbacks and stored outcomes. throws fits synchronous APIs and async/await. You can bridge with get() / mapError depending on call site style.

  11. 11.How do optionals work, and when would you use ?, !, if let, guard let, and ??

    Optionals wrap absence of a value. Prefer if let/guard let for safe unwraps; ?? for defaults; avoid force unwrap (!) except when truly impossible to be nil. Optional chaining (?.) short-circuits safely.

  12. 12.Explain value types vs reference types and how copying behaves.

    Value types (struct/enum) copy on assignment; reference types share one instance. Mutations to a copy don’t affect the original. Copy-on-write optimizes large values like Array/Dictionary/String.

  13. 13.When do you choose a struct over a class in Swift?

    Prefer structs for value semantics, thread-safer copies, and simple data. Use classes for identity, inheritance, Objective-C interop, or shared mutable references. Many modern models are structs; UIKit types remain classes.

  14. 14.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.

  15. 15.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.

  16. 16.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.

  17. 17.Given daily prices, find the max profit from one buy and one sell. Swift solution and complexity?

    Track min price so far and max profit = price - min. One pass O(n). Clarify you can't sell before buy; handle empty/decreasing arrays.

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.

iOS trackAndroid trackMore guides