🧩 What does it print? Interview puzzles: iOS interview questions
- What prints to the console? Senior PRO
- What's guaranteed in the output order? (serial vs concurrent) Middle PRO
- Will deinit be called? Middle PRO
- What does this array-of-classes code print? Copy-on-Write Middle PRO
- Dispatch: what does the protocol extension print? Senior PRO
- What does this GCD code print? (main.sync and the run loop) Senior PRO
- What does dropFirst()[0] print? Middle PRO
- Which recursive types compile? Middle PRO
- Nested closures: will deinit run? Senior PRO
- weak var person = Person(): what gets printed? Middle PRO
- GCD puzzle: output order and where is the deadlock? Senior PRO
- Capture list: how does { x } differ from { [x] in }? Middle PRO
- global().async + main.async: what order does it print? Middle PRO
- defer and return: what does the function return? Junior PRO
- class func vs static func: does the override compile? Junior PRO
- willSet / didSet in init and defer: what gets printed? Middle PRO
- lazy.filter.map.prefix: how many times is map called? Middle PRO
- sync and async on another queue: what does isMainThread show? Junior PRO
- An escaping closure inside a mutating struct method Senior PRO
- Which of these types can be declared weak? Junior PRO
- asyncAfter with self in a ViewController: when is the screen freed? Middle PRO
- Copy-on-write: what is a1.count after append? Middle PRO
- lazy var with a closure: is [weak self] needed here? Middle PRO
- Dispatch: a method in the type body vs in an extension Middle PRO
Practice this before your interview
DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.
Get DevPrep on the App Store