Swift Interview Questions
  1. What’s the difference between == and ===?
  2. What is the difference between fileprivate, private and public private(set) access level ?
  3. What is the difference between Delegates and Callbacks ?
  4. What is copy or write?
  5. Rewrite this code in a Swift way
  6. What is trailing closure syntax?
  7. What is Dictionary in Swift?
  8. How can you make a property optional in Swift?
  9. Explain Functions in Swift Programming?
  10. How can you define a base class in swift?
  11. What are the control transfer statements in swift?
  12. What do you mean by the term “defer”?
  13. Can you explain any three-shift pattern matching techniques?
  14. Explain the difference between let and var in Swift Programming?
  15. What is difference between single and double ? in Swift?
  16. List some control transfer statements used in Swift?
  17. Explain Deinitializer in Swift programming Language?
  18. What is the difference between nil and None in Swift?
  19. What are generics? How to make a method or variable generics in Swift?
  20. How to call Objective-C code from Swift
  21. How to create a constant in Swift Programming?
  22. In Swift What is use of backticks ` while declaring a variable?
  23. How to declare an empty dictionary in Swift?
  24. In Swift, what type of object are basic data types?
  25. What are initializer in Swift?
  26. What is forced unwrapping? Why is it potentially unsafe?
  27. What is an in-out parameter in Swift?
  28. What is an attribute in Swift?
  29. Explain What is half-open range operator?
  30. What is tuple? How to create a tuple in Swift ?
  31. What are the values of tutorial1.difficulty and tutorial2.difficulty? Would this be any different if Tutorial was a class? Why or why not?
  32. You’ve declared view1 with var, and you’ve declared view2 with let. What’s the difference, and will the last line compile?
  33. This complicated code sorts an array of names alphabetically. Simplify the closure as much as you can.
  34. What is an optional and which problem do optionals solve?
  35. Summarize the main differences between a structure and a class.
  36. What are generics and which problem do they solve?
  37. In some cases, you can't avoid using implicitly unwrapped optionals. When? Why?
  38. What are the various ways to unwrap an optional? How do they rate in terms of safety?
  39. What's the difference between nil and .none?
  40. What’s the value of the len variable, and why?
  41. In Swift enumerations, what’s the difference between raw values and associated values?
  42. What is capture list?
  43. What is the difference between garbage collector and ARC?
  44. What is a good use case for an inout parameter?
  45. What is difference between as?, as! and as in Swift?
  46. What is a GUARD statement? What is the benefit of using the GUARD statement in swift?
  47. What's the difference between Self vs self?
  48. When to use strong, weak and unowned references?
  49. What is Optional chaining?
  50. What is Optional binding?
  51. When to use class and when to use struct?
  52. Here's a model of a thermometer as a class and a struct. The compiler will complain about the last line. Why does it fail to compile?
  53. How to pass a variable as a reference?
  54. What are the different Access Levels in swift?
  55. What is Associated Values?
  56. Explain generics in Swift ?
  57. What is implicit unwrapping?
  58. What are escaping/ nonescaping closures?
  59. What is de-initializer and how it is written in Swift?
  60. What is the difference between Upcast and Downcast in Swift?
  61. What is dispatch queue?
  62. What will this code print and why?
  63. Can you add a stored property to a type by using an extension? How or why not?
  64. What is a protocol in Swift?
  65. The following code has a compile time error. Can you spot it and explain why it happens? What are some ways you could fix it?
  66. Are closures value or reference types?
  67. Can you describe a circular reference in Swift? How can you solve it?