DevPrep

All topics

🧩 What does it print? Interview puzzles: iOS interview questions

  1. What prints to the console? Senior PRO
  2. What's guaranteed in the output order? (serial vs concurrent) Middle PRO
  3. Will deinit be called? Middle PRO
  4. What does this array-of-classes code print? Copy-on-Write Middle PRO
  5. Dispatch: what does the protocol extension print? Senior PRO
  6. What does this GCD code print? (main.sync and the run loop) Senior PRO
  7. What does dropFirst()[0] print? Middle PRO
  8. Which recursive types compile? Middle PRO
  9. Nested closures: will deinit run? Senior PRO
  10. weak var person = Person(): what gets printed? Middle PRO
  11. GCD puzzle: output order and where is the deadlock? Senior PRO
  12. Capture list: how does { x } differ from { [x] in }? Middle PRO
  13. global().async + main.async: what order does it print? Middle PRO
  14. defer and return: what does the function return? Junior PRO
  15. class func vs static func: does the override compile? Junior PRO
  16. willSet / didSet in init and defer: what gets printed? Middle PRO
  17. lazy.filter.map.prefix: how many times is map called? Middle PRO
  18. sync and async on another queue: what does isMainThread show? Junior PRO
  19. An escaping closure inside a mutating struct method Senior PRO
  20. Which of these types can be declared weak? Junior PRO
  21. asyncAfter with self in a ViewController: when is the screen freed? Middle PRO
  22. Copy-on-write: what is a1.count after append? Middle PRO
  23. lazy var with a closure: is [weak self] needed here? Middle PRO
  24. 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