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.
- What is the difference between strong, weak, unowned and unowned(unsafe)?
- Write a function that prints a UIView’s subview tree with indentation, like recursiveDescription. Recursive or iterative, and what is the real recursiveDescription?
- Users can push a very large number of view controllers onto a UINavigationController. What does that cost, and how do you optimise it?
- How do phantom-typed identifiers stop an order id being passed where a user id is expected, and what do they cost?
- Design an image browsing app (a grid of photos you can open full screen): thumbnails, paging, caching, memory and offline.
- 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?
- When do you use a sliding window, and how do the fixed-size and variable-size versions differ?
- Recursively walk a folder tree to count files and bytes. Compare your own recursion with FileManager.enumerator, and name the hazards.
- 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?
- 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?