Skip to content

Latest commit

 

History

History
101 lines (66 loc) · 2.79 KB

File metadata and controls

101 lines (66 loc) · 2.79 KB

Swift Functions, Methods & Closures Interview Questions (Beginner to Advanced)

Beginner Level

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

  2. How do you define a function that takes parameters and returns a value?
    Answer coming soon...

  3. What are default parameter values in Swift functions?
    Answer coming soon...

  4. How do you define and call methods in a class or struct?
    Answer coming soon...

  5. What is the difference between a function and a method?
    Answer coming soon...

  6. What is a closure in Swift?
    Answer coming soon...

  7. How do you declare and use a simple closure?
    Answer coming soon...

  8. What is a trailing closure in Swift?
    Answer coming soon...

  9. How do you pass a closure as a function argument?
    Answer coming soon...

  10. What is the syntax for a function that returns a closure?
    Answer coming soon...


Intermediate Level

  1. What is an escaping closure, and how does it work?
    Answer coming soon...

  2. How do you capture values in a closure?
    Answer coming soon...

  3. What is a higher-order function in Swift (e.g., map, filter, reduce)?
    Answer coming soon...

  4. Explain how to create a function that takes multiple closures as parameters.
    Answer coming soon...

  5. How do closures and memory management relate in Swift?
    Answer coming soon...

  6. What are autoclosures in Swift, and when are they useful?
    Answer coming soon...

  7. What are function types in Swift, and how are they used?
    Answer coming soon...

  8. How does Swift handle functions with variadic parameters?
    Answer coming soon...

  9. What is a generic function in Swift?
    Answer coming soon...

  10. How do inout parameters work in functions?
    Answer coming soon...


Advanced Level

  1. How does Swift handle function overloading?
    Answer coming soon...

  2. Explain capturing lists in closures.
    Answer coming soon...

  3. What are partial function applications in Swift?
    Answer coming soon...

  4. How do you define a function that throws an error?
    Answer coming soon...

  5. How do you use key path functions in Swift?
    Answer coming soon...

  6. What is a curried function in Swift, and how do you use it?
    Answer coming soon...

  7. Explain function composition in Swift.
    Answer coming soon...

  8. How do escaping closures lead to retain cycles, and how can you prevent them?
    Answer coming soon...

  9. How does Swift use closures for callbacks in async operations?
    Answer coming soon...

  10. How do you use @escaping and @autoclosure annotations in Swift functions?
    Answer coming soon...