Recently, I was involved in a couple of recruitment processes. During each of them there was of course a technical part, involving a technical interview and/or an online task to complete (eg. DevSkiller).
Below you can find most of the questions I was asked, grouped by topic.
Language / Foundation
- Q: What is ARC and how it works (compared to manual memory management)?
A: Transitioning to ARC (Obj-C) and Swift ARC- Q: (ObjC) Is release/autorelease still used in ARC?
A: Not explicitly, it is used under the hood. - Q: What is Auto Release Pool? Is it still used in Swift?
A: Rock Bruno’s blog post
- Q: (ObjC) Is release/autorelease still used in ARC?
- Q: Describe
strongvsweak(vsunowned) reference. What are reference cycles?
A: TL;DR: Strong references increment reference counter (by 1), and weak (also unowned) references not. More in already linked Swift ARC. - Q: Obj-C Category vs Swift
extension– are they related? how? what are the differences?
A: Brief comparison of categories and extensions - Q: What is the difference between
staticandclassmethods?
A: Subclasses can overrideclassmethods (andstaticnot). - Q: Describe
enumtype – its capabilities and example use cases
A: Enumerations on Swift.org- Q: Associated values / raw values ?
- Q: What is a recursive enum? (
indirectkeyword?)
- Q: What are reference and value types? describe, which types are what, memory?
A: Classes and structures or Reference vs value types. Also functions, closures and actors are reference types (Closures). - Q: What is a race condition? And data race?
A: Race condition vs data race - Q: Generics,
protocolwith generics (where can be used?)
A: Generics- Q: Associated type in protocol
Foundation
- Q: Collections – basic types, differences
A: Collection TypesHashableprotocol – for what it is used?- Subscript access performance (O(1))
- Q: What is GCD? What are the other ways to achieve concurrency?
A: Dispatch, Modern Concurrency (async/await + Tasks), OperationQueue, Threads- Dispatch Queue types (serial vs concurrent)
- What is a
barrier? - Difference between
asyncandsynccalls?
- Q: Higher order functions – what it is? What standard HOFs you know?
A: Higher order functions in Swift- Q: How
reduce()works? - Q:
flatMap()vscompactMap()
A: Differences explained
- Q: What is a
lazyarray (Swift)?
A: Lazy Collections
- Q: How
UI Kit
- Q: Describe
UIView.framevsbounds
A: Difference between frame and bounds- Example of view changing bounds.origin? UIScrollView
- Q: What are view transformations?
A:CGAffineTransform - Q: How can you animate a UIView property?
- A:
UIViewPropertyAnimator,UIView.animate() - Q: Should
@IBOutletbe declared weak or strong? And why is it var and implicitly unwrapped optional?
A: Weak vs strong IBOutlet and Optionals vs implicitly unwrapped optionals
Core Bluetooth
I was asked if I am familiar with below topics:
- GATT
- MTU
- CTKD, encryption
- pairing and bonding
- L2CAP
Design/Architecture
Describe and compare: MVC vs MVVM vs MVP.