Top iOS Interview Questions & Sample Code 📱

Learn the 10 most common iOS developer interview questions with sample code and mock interview tips.

Top iOS Interview Questions & Sample Code 📱
freeCodeCamp.org
21.3K views • Apr 30, 2025
Top iOS Interview Questions & Sample Code 📱

About this video

Top 10 most asked interview questions for an iOS Developer role, in a form of a mock interview.

The code from the video: https://github.com/richardtop/ios_interview

Follow Richard on social media:
https://www.youtube.com/@richardtopchii
https://github.com/richardtop/
https://x.com/richardtop_ios

Follow Daniel on social media:
https://x.com/iDanb0
https://github.com/idanbo

⭐️ Links from the video ⭐️

View Controller Life Cycle
https://developer.apple.com/documentation/uikit/uiviewcontroller

What’s the difference between a struct and a class
https://docs.swift.org/swift-book/LanguageGuide/ClassesAndStructures.html
https://github.com/apple/swift/blob/main/stdlib/public/core/Array.swift#L303
https://developer.apple.com/swift/blog/?id=10

What’s the difference between .frame and .bounds property of a UIView
https://developer.apple.com/documentation/uikit/uiview/1622621-frame

What is a Protocol Oriented Programming
https://developer.apple.com/videos/play/wwdc2015/408/

"defer" statement coding question
https://docs.swift.org/swift-book/ReferenceManual/Statements.html

MVC architecture (Model, View, Controller)
https://developer.apple.com/library/archive/documentation/General/Conceptual/DevPedia-CocoaCore/MVC.html
https://developer.apple.com/library/archive/documentation/General/Conceptual/CocoaEncyclopedia/Model-View-Controller/Model- View-Controller.html#//apple_ref/doc/uid/TP40010810-CH14
https://developer.apple.com/library/archive/featuredarticles/ViewControllerPGforiPhoneOS/ImplementingaContainerViewController.html

"weak" and "unowned" keywords
https://kelvas09.github.io/blog/posts/ios_weak_unowned/
https://developer.apple.com/documentation/foundation/urlsession

"lazy" keyword
https://stackoverflow.com/questions/38141298/lazy-initialisation-and-retain-cycle

"@escaping" closure attribue and non-escaping closures
https://kelvas09.github.io/blog/posts/ios-escaping/

❤️ Support for this channel comes from our friends at Scrimba – the coding platform that's reinvented interactive learning: https://scrimba.com/freecodecamp

⭐️ Contents ⭐️
⌨️ (0:00:00) Overview
⌨️ (0:00:34) Daniel, the interviewer
⌨️ (0:02:03) Why these questions?
⌨️ (0:02:43) View Controller Life Cycle
⌨️ (0:12:08) What’s the difference between a struct and a class
⌨️ (0:18:33) What’s the difference between .frame and .bounds property of a UIView
⌨️ (0:25:58) What is a Protocol Oriented Programming
⌨️ (0:32:16) "defer" statement coding question
⌨️ (0:37:13) GCD / DispatchQueue coding question
⌨️ (0:46:49) MVC architecture (Model, View, Controller)
⌨️ (0:52:32) "weak" and "unowned" keywords
⌨️ (0:57:07) "lazy" keyword
⌨️ (1:02:05) "@escaping" closure attribue and non-escaping closures
⌨️ (1:05:16) Summary and feedback

Corrections:
52:19 The video states that unowned references cannot be optional. However, in practice, unowned references may be either optional or non-optional. For official documentation on this topic, refer to: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/automaticreferencecounting/#Unowned-Optional-References

1:01:52 The explanation in the video may lead viewers to incorrectly infer that non-escaping behavior became the default for closures starting with Swift 5.0. The phrase "as of Swift 5.0, the non-escaping behavior is the default" was used solely to clarify the behavior at the time of the interview recording, rather than to specify the exact point at which this change was introduced.

The video emphasizes the ability to store a closure in a variable as the defining characteristic of an escaping closure. However, the more precise and official definition is: "A closure is said to escape a function when the closure is passed as an argument to the function but is called after the function returns." This definition correctly highlights the API behavior rather than the implementation details. For further reference, see: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/closures/

Video Information

Views

21.3K

Likes

487

Duration

01:07:00

Published

Apr 30, 2025

User Reviews

4.6
(4)
Rate:

Related Trending Topics

LIVE TRENDS

Related trending topics. Click any trend to explore more videos.

Trending Now