iOS interview questions reported at Google

10 questions candidates reported being asked at Google. Anonymous and unverified, so treat it as a hint of what to expect.

They cover Memory, ARC & runtime, UIKit, Architecture & API design, System design & staff+, Coding rounds. Every question below links to a full answer with the common traps and the follow-ups an interviewer is likely to ask, so you can practise the way the interview goes: answer first, then defend it.

  1. What is the difference between strong, weak, unowned and unowned(unsafe)? 3.2.1
  2. Write a function that prints a UIView’s subview tree with indentation, like recursiveDescription. Recursive or iterative, and what is the real recursiveDescription? 7.13.2
  3. Users can push a very large number of view controllers onto a UINavigationController. What does that cost, and how do you optimise it? 7.13.3
  4. How do phantom-typed identifiers stop an order id being passed where a user id is expected, and what do they cost? 15.10.1
  5. Design an image browsing app (a grid of photos you can open full screen): thumbnails, paging, caching, memory and offline. 26.8.5
  6. Can a string be built by concatenating words from a list (words may repeat)? How do you answer yes or no, and how do you also return which words? 29.1.6
  7. When do you use a sliding window, and how do the fixed-size and variable-size versions differ? 29.1.8
  8. Recursively walk a folder tree to count files and bytes. Compare your own recursion with FileManager.enumerator, and name the hazards. 29.2.6
  9. Given two people’s busy intervals and working hours, find the time when both are free. How is it the merge-intervals problem in disguise? 29.2.8
  10. Find the longest run in a float array where adjacent chosen values differ by at most 1. Why must you ask “contiguous or may I skip elements?” first? 29.2.9