Value Types vs Reference Types in Swift
Asked at Mobile · Mobile Engineering (Android/iOS) · Difficulty: Easy
Explain **value types (`struct`, `enum`) vs reference types (`class`)** in Swift: copy semantics vs shared references, identity (`===`), mutation rules (`mutating`, `let` freezing a whole struct vs only the reference of a class), and memory (stack/inline & no ARC vs heap & ARC-managed).
Loading the problem…
More Mobile interview questions
- Activity Lifecycle Configuration Changes and Process Death
- Design an Image Loading and Caching Library
- SwiftUI State Management Property Wrappers
- ARC Retain Cycles and weak vs unowned
- Jetpack Compose Recomposition State and Stability
- GCD vs Swift async-await Concurrency