Answering classes and struct questions
Under the umbrella of data structures, classes, and struct questions are probably the most basic forms we use in our projects. The reason is that not only do classes and structs contain data, but they also provide the main logic of the app and the objects they represent.
When Apple announced Swift, they constantly pushed using structs over classes in many cases. The trend became even more extreme when SwiftUI was announced, which was based solely on structs over classes. So, it goes without saying why classes and struct questions play a significant role in iOS interviews.
Let’s move to the first and the most popular question – classes versus structs.
“What’s the difference between a class and a struct?”
Why is this question important?
A class and a struct have many features in common – they are both used to define complex data types, methods, and properties.
“Functions”...