Skip to content

Latest commit

 

History

History
102 lines (66 loc) · 2.6 KB

Structures.md

File metadata and controls

102 lines (66 loc) · 2.6 KB

Swift Structs Interview Questions (Beginner to Advanced)

Beginner Level

  1. What is a struct in Swift?
    Answer coming soon...

  2. How do structs differ from classes in Swift?
    Answer coming soon...

  3. What are stored properties in a struct?
    Answer coming soon...

  4. How do you initialize a struct?
    Answer coming soon...

  5. What is the self keyword in Swift structs?
    Answer coming soon...

  6. Can a struct contain methods?
    Answer coming soon...

  7. What is the default initializer for a struct?
    Answer coming soon...

  8. What is immutability in structs?
    Answer coming soon...

  9. How do you modify a property inside a method in a struct?
    Answer coming soon...

  10. What is a mutating method in a struct?
    Answer coming soon...


Intermediate Level

  1. Explain how structs handle value types.
    Answer coming soon...

  2. What is the mutating keyword, and why is it needed in structs?
    Answer coming soon...

  3. Can you extend structs in Swift? Provide an example.
    Answer coming soon...

  4. How do structs handle copying and assignment?
    Answer coming soon...

  5. What is a custom initializer in structs?
    Answer coming soon...

  6. Can structs conform to protocols?
    Answer coming soon...

  7. How do you make a struct conform to Codable?
    Answer coming soon...

  8. How do structs handle memory allocation?
    Answer coming soon...

  9. Explain how structs are passed by value.
    Answer coming soon...

  10. How do you use default values in struct initializers?
    Answer coming soon...


Advanced Level

  1. When should you use a struct over a class in Swift?
    Answer coming soon...

  2. Explain why structs are more efficient in some scenarios.
    Answer coming soon...

  3. How can structs help prevent memory leaks?
    Answer coming soon...

  4. How do you handle deeply nested structs in Swift?
    Answer coming soon...

  5. How does Swift handle method dispatching in structs?
    Answer coming soon...

  6. Can structs have computed properties?
    Answer coming soon...

  7. Explain the difference between reference semantics and value semantics in Swift.
    Answer coming soon...

  8. How do structs improve performance with copy-on-write optimization?
    Answer coming soon...

  9. Can a struct have associated types?
    Answer coming soon...

  10. How do you handle recursive data structures with structs?
    Answer coming soon...