Total Questions : 30
Expected Time : 30 Minutes

1. What is the correct way to create a range of numbers from 1 to 5 in Swift?

2. What is a 'computed property' in Swift?

3. Which Swift keyword is used to indicate the absence of a value?

4. In Swift, what does the 'lazy' keyword indicate when used before a property?

5. In Swift, what is a 'closure'?

6. What is the correct syntax for declaring a function in Swift?

7. In Swift, how do you use a closure to sort an array of integers in ascending order?

8. How do you declare a property as 'weak' in Swift?

9. What is the purpose of Swift's 'Any' and 'AnyObject' types?

10. In Swift, how do you declare a custom error type conforming to 'Error' protocol?

11. How can you handle errors in Swift?

12. What is the purpose of Swift's 'extension'?

13. What is the purpose of the 'enum' keyword in Swift?

14. What is the purpose of the 'if' statement in Swift?

15. What is the purpose of the 'guard' statement in Swift?

16. What are closures in Swift?

17. What does the 'print' function do in Swift?

18. How does Swift handle memory management for reference types?

19. Explain the concept of Swift's 'Set' type.

20. In Swift, what is the purpose of the 'defer' statement?

21. What is the correct way to check if two strings are not equal in Swift?

22. Which Swift data type is used to store decimal numbers?

23. Which keyword is used to declare a constant in Swift?

24. What is the purpose of the 'map' function in Swift?

25. What is the purpose of the Swift 'enum' type?

26. In Swift, how do you handle errors using the 'try', 'catch', and 'throw' keywords?

27. What is the purpose of an optional in Swift?

28. In Swift, how do you create an empty array of integers?

29. In Swift, what is the purpose of the 'subscript' keyword?

30. Explain the use of Swift's 'lazy' keyword.