Swift

Skill
Programming Language

Top 20 Swift Interview Questions and Answers 2024

24 questions found

Updated 21 Oct 2024

Q1. What is Swift 103

Ans.

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.

Add your answer
Frequently asked in

Q2. What is the full form of SWIFT and its meaning?

Ans.

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

Add your answer
Frequently asked in

Q3. What is the difference between swift & objective c?

Ans.

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.

Add your answer
Frequently asked in

Q4. Difference between iso and Swift

Ans.

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

Add your answer
Frequently asked in
Are these interview questions helpful?

Q5. Why did you use Swift over React Native?

Ans.

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

Add your answer

Q6. what higher order function in swift ?

Ans.

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.

Add your answer
Share interview questions and help millions of jobseekers 🌟

Q7. What are access modifiers in swift

Ans.

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

Add your answer
Frequently asked in

Q8. benefits of swift programming

Ans.

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

Add your answer
Frequently asked in

Swift Jobs

Mobile Developer (IOS, Swift, Swift UI) 5-9 years
Infosys Limited
3.7
Bangalore / Bengaluru
IOS developer with Objective C, Swift and Swift UI 1-5 years
Harman Connected Services Corporation India Pvt.
3.8
Bangalore / Bengaluru
Principal Support Engineer - Infra & Testing (SWIFT) 6-10 years
Oracle India Pvt. Ltd.
3.7
India

Q9. Steps in adding collection view in Swift.

Ans.

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

Add your answer

Q10. Table view in swift

Ans.

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

Add your answer

Q11. Swift advantages and disadvantages

Ans.

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

Add your answer
Frequently asked in

Q12. lazy var when use

Ans.

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

Add your answer

Q13. Difference between swift and objective c

Ans.

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

Add your answer
Frequently asked in

Q14. Difference between MT103 & MT202

Ans.

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

Add your answer

Q15. Different between objective c and swift?

Ans.

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

Add your answer

Q16. How to decode optional

Ans.

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.

Add your answer

Q17. What are the settlement SWIFTS ?

Ans.

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

Add your answer

Q18. Difference between objective c and swift

Ans.

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

Add your answer

Q19. Explain Initialisers in swift

Ans.

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 }

Add your answer

Q20. What are mandatory fields in Swift MT 103

Ans.

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)

Add your answer
Frequently asked in

Q21. Working of completion handler

Ans.

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 }

Add your answer

Q22. when do you use static variables in swift?

Ans.

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

Add your answer

Q23. Objective C & swift ? Which is majorly used ?

Ans.

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.

Add your answer
Frequently asked in

Q24. Objective C vs swift

Ans.

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.

Add your answer
Frequently asked in
Interview Tips & Stories
Ace your next interview with expert advice and inspiring stories

Interview Questions of Swift Related Designations

Interview experiences of popular companies

3.9
 • 7.8k Interviews
3.7
 • 7.3k Interviews
3.7
 • 5.2k Interviews
View all
Swift Interview Questions
Share an Interview
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
70 Lakh+

Reviews

5 Lakh+

Interviews

4 Crore+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter