Swift
Top 20 Swift Interview Questions and Answers 2024
24 questions found
Updated 21 Oct 2024
Q1. What is Swift 103
Swift 103 is a message type used in the financial industry for international payments.
Swift 103 is a type of message used in the SWIFT network for international payments.
It is used for bank-to-bank transfers and includes information such as payment instructions and beneficiary details.
Swift 103 messages are standardized and help ensure secure and efficient cross-border transactions.
Q2. What is the full form of SWIFT and its meaning?
SWIFT stands for Society for Worldwide Interbank Financial Telecommunication. It is a messaging network used by banks to securely communicate financial transactions.
SWIFT is a global financial messaging network used by banks to send and receive information about financial transactions.
It was founded in 1973 and is headquartered in Belgium.
SWIFT assigns a unique code to each bank that uses its network, called a Bank Identifier Code (BIC).
The network is used to securely transmi...read more
Q3. What is the difference between swift & objective c?
Swift is a modern programming language while Objective-C is an older language used for iOS development.
Swift is easier to read and write than Objective-C.
Swift is faster than Objective-C.
Objective-C is still used in legacy codebases.
Swift has a simpler syntax and is more concise.
Swift has better memory management than Objective-C.
Q4. Difference between iso and Swift
ISO is a set of international standards for various industries, while Swift is a messaging network used by financial institutions.
ISO stands for International Organization for Standardization, which sets standards for various industries such as quality management (ISO 9001) and information security (ISO 27001).
Swift (Society for Worldwide Interbank Financial Telecommunication) is a messaging network used by financial institutions to securely and quickly send information and i...read more
Q5. Why did you use Swift over React Native?
Swift was chosen for its performance, native iOS support, and better integration with Apple's ecosystem.
Swift offers better performance compared to React Native due to its native code execution.
Swift provides seamless integration with Apple's ecosystem, allowing for better utilization of iOS features.
Swift is the preferred choice for developing iOS apps as it is the native language for iOS development.
React Native may have limitations in accessing certain iOS features or APIs...read more
Q6. what higher order function in swift ?
Higher order functions in Swift are functions that can take other functions as parameters or return functions as results.
Examples of higher order functions in Swift include map, filter, and reduce.
Higher order functions help in writing cleaner and more concise code by abstracting away common patterns.
They promote functional programming principles by treating functions as first-class citizens.
Q7. What are access modifiers in swift
Access modifiers in Swift are keywords that control the visibility and accessibility of classes, methods, properties, and other entities.
Access modifiers include public, internal, fileprivate, and private.
Public allows entities to be accessed from any source file in the module or from another module that imports the defining module.
Internal restricts access to the current module.
Fileprivate restricts access to the defining source file.
Private restricts access to the enclosing...read more
Q8. benefits of swift programming
Swift programming offers fast performance, safety, and interoperability with Objective-C.
Fast performance due to being compiled language
Safety features like optionals and type interference
Interoperability with Objective-C for using existing code and libraries
Swift Jobs
Q9. Steps in adding collection view in Swift.
Steps to add collection view in Swift.
Create a UICollectionView instance
Set the delegate and data source of the collection view
Implement the required methods of UICollectionViewDataSource and UICollectionViewDelegate protocols
Register the cell class or nib file for the collection view
Return the number of items and configure the cell in the data source methods
Implement any additional delegate methods as needed
Q10. Table view in swift
Table view in Swift is used to display data in a scrollable list format.
Table views are commonly used in iOS development to display lists of data.
They can be customized with different cell types and layouts.
Table views use data sources and delegates to populate and interact with the cells.
Example: UITableView, UITableViewCell, UITableViewDataSource, UITableViewDelegate
Q11. Swift advantages and disadvantages
Swift is a powerful and modern programming language for iOS development, but it has its own set of advantages and disadvantages.
Advantages: faster performance, safer code with optionals, easier to read and write code, interoperability with Objective-C
Disadvantages: steep learning curve for beginners, limited community support compared to other languages like Java or Python
Q12. lazy var when use
lazy var is used to delay the initialization of a property until it is accessed for the first time.
Used to improve performance by delaying initialization until necessary
Helps reduce memory usage by only initializing when needed
Commonly used for properties that are computationally expensive to initialize
Q13. Difference between swift and objective c
Swift is a modern, fast, and safe programming language developed by Apple, while Objective-C is an older, more verbose language.
Swift is more concise and easier to read than Objective-C.
Swift supports optionals and type inference, making code safer and less prone to errors.
Objective-C requires manual memory management with retain and release, while Swift uses automatic reference counting (ARC).
Swift is interoperable with Objective-C, allowing developers to use both languages ...read more
Q14. Difference between MT103 & MT202
MT103 is a payment message used for international funds transfer, while MT202 is a financial institution transfer message.
MT103 is used for customer payments, while MT202 is used for financial institution transfers.
MT103 contains details of the sender, receiver, and amount to be transferred, while MT202 is used to instruct the movement of funds between financial institutions.
MT103 is sent directly to the beneficiary bank, while MT202 is used for intermediary banks to facilita...read more
Q15. Different between objective c and swift?
Objective-C is a superset of C with object-oriented features, while Swift is a modern, safer, and more concise programming language developed by Apple.
Objective-C is a superset of C with object-oriented features
Swift is a modern, safer, and more concise programming language
Objective-C uses square brackets for method calls, while Swift uses dot notation
Swift has optionals to handle nil values safely, while Objective-C uses nil pointers
Swift has type inference, making code clea...read more
Q16. How to decode optional
To decode optional in Swift, use optional binding or optional chaining.
Use optional binding with if let or guard let to safely unwrap an optional and assign it to a new variable.
Use optional chaining with a question mark (?) to access properties, methods, and subscripts of an optional that might currently be nil.
Q17. What are the settlement SWIFTS ?
Settlement SWIFTS are messages used in the financial industry to facilitate international money transfers.
SWIFT stands for Society for Worldwide Interbank Financial Telecommunication
Settlement SWIFTS are used to communicate payment instructions between financial institutions
They contain information such as sender, receiver, amount, currency, and payment instructions
Q18. Difference between objective c and swift
Objective-C is a programming language used for iOS and macOS development, while Swift is a newer and more modern language developed by Apple.
Objective-C is a superset of the C programming language, while Swift is a completely new language.
Objective-C uses dynamic typing, while Swift uses static typing.
Objective-C requires manual memory management using retain and release, while Swift uses automatic reference counting (ARC).
Objective-C has a more verbose syntax compared to Swi...read more
Q19. Explain Initialisers in swift
Initialisers in Swift are special methods used to create and initialise instances of a class, struct, or enum.
Initialisers are used to set up the initial state of an instance.
They are defined using the 'init' keyword.
There are designated initialisers and convenience initialisers.
Designated initialisers are the primary initialisers for a class.
Convenience initialisers are secondary initialisers that call a designated initialiser.
Example: init(name: String) { self.name = name }
Q20. What are mandatory fields in Swift MT 103
Mandatory fields in Swift MT 103 message
Sender's Reference (20)
Sender's Account Number (50K)
Receiver's Account Number (59)
Amount (32A)
Currency (33B)
Value Date (32A)
Sender's Correspondent (53A)
Receiver's Correspondent (54A)
Q21. Working of completion handler
Completion handler is a closure that gets executed after a task is completed.
Completion handlers are used to handle asynchronous tasks in iOS development.
They are commonly used in network requests, animations, and other time-consuming tasks.
Completion handlers take in parameters and return values, allowing for customization and flexibility.
Example: URLSession.shared.dataTask(with: url) { data, response, error in // handle completion }
Q22. when do you use static variables in swift?
Static variables in Swift are used when you want to maintain a single instance of a variable across all instances of a class or struct.
Used to store values that are common to all instances of a class or struct
Can be accessed without creating an instance of the class or struct
Helpful for maintaining state across multiple instances
Q23. Objective C & swift ? Which is majorly used ?
Swift is majorly used over Objective C.
Swift is faster, easier to read and write, and has better memory management than Objective C.
Swift is the preferred language for iOS app development.
Objective C is still used in legacy codebases and some libraries.
Swift has a growing community and support from Apple.
Swift is more modern and has features like optionals and closures.
Objective C has a steeper learning curve and is more verbose.
Q24. Objective C vs swift
Objective-C is the older language used for iOS development, while Swift is the newer, more modern language.
Objective-C is a superset of C with Smalltalk-style messaging syntax.
Swift is more concise and easier to read than Objective-C.
Swift is safer due to its optionals and type interference features.
Objective-C has been around longer and has a larger codebase, but Swift is becoming more popular.
Many developers prefer Swift for its modern features and performance improvements.
Top Interview Questions for Related Skills
Interview Questions of Swift Related Designations
Interview experiences of popular companies
Reviews
Interviews
Salaries
Users/Month