Top Essential iOS Interview Questions and Answers Part- 1

Shantaram Kokate
4 min readOct 31, 2019

--

  1. What is Swift?
  • It's a programming language that can be used on iOS, macOS, and Linux announced by Apple in 2014
  • The latest version is 5.3(official release: May 20, 2020)
  • Both the front end and back end can be used.
  • Statically typed language

2. What are the Swift features?

The four main features of Swift are listed below.

  1. Modern
  2. Safety
  3. High speed
  4. Interactive

Modern:

Modern in terms of code is easy to read and write and also Swift has new features like generics, tuples, type-safe, type inference and clouser.

Safety:

It causes fewer bugs at the language specification level.

  • Static type check
  • nil safety
  • No implicit type conversion
  • Automatic memory management by ARC
  • Array and numeric overflow check

As mentioned by Apple, Swift was originally designed to operate faster.

High speed:

The language was developed with the aim of speeding up, and according to Apple’s announcement, the general search algorithm is 2.6 times faster than Objective-C and 8.4 times faster than Python.

Interactive:

Although it is a compiler language, it also has a dialog execution environment (REPL), which can be easily debugged in Xcode Playgrounds and terminals.

3. Why Apple introduced the swift?

As mentioned by Apple, Swift was originally designed to operate faster.

4. What is type inference?

Type inference enables a compiler to decide the type of a particular expression automatically when it compiles your code, simply by examining the values you provide.

5. What is the difference between the component() and split()

components returns [String] and split returns [Substring].

6. What is a conditional protocol or conditional Extension?

Conditional Conformances, which enables a type to conform to a protocol only under a certain set of constraints.

Array conform to ScoreConvertible only if it contains ScoreConvertible elements, like this:

7. What’s a singleton?

Singleton used to create a single instance of a class that will never update through the app.

8. Difference between Any and AnyObjecy?

9. Does apple codable protocol support XML decoding?

No

10. What is a reflection?

Reflection in Swift is easy using the struct Mirror, with it, we can inspect the names and types of properties in an instance of a struct or an instance of a class.

11. Does enum have stored property?

No

12. Why do enums have computed properties but not stored properties in Swift?

Because we can’t create real an object of enum

13. Difference between weak and unowned?

14. Why Swift introduces protocol-oriented programming?

Swift checks for protocol conformity issues at compile-time, allowing developers to discover some fatal bugs in the code before running the program. The protocol allows the developer to write flexible and extensible code

15. What’s is associated value.

Enum case with associated value provides metadata about a case.

16. What’s the difference between category and subclass?

Subclass allows adding the new functionality, override the existing functionality and computed or stored property.where as in the category we only able to add new functionality and computed property.

17. What’s the difference between category and extension?

The extension is used to add the functionality to type, but not allowed to override the existing functionality. extension support computed property but not stored properly. The extension is best for private methods.

A category is useful when you want to group your method into a different section.

18. What are the different access controls in swift?

There are 4 access control in swift 5

19. What is the default access level in swift?

It is Internal . If we don’t mention an access level before any variable, constant or function, it is Internal by default. It’s explained in the above section.

20. What is the different advance keyword in swift?

  1. defer: If you want to run some clean-up code just before the function returns. It is also possible to have more than one *defer* block in the current scope. They are executed than in reverse order.
  2. fallthrough: It used to continue processing after matching case statements. If the fallthrough is used, the next case statement is executed even if the conditions are not met.
  3. typealias: It used to create an alias for data type seems to be the same. we can use it in datatype, class, protocol, block, and function, tuples
  4. subscript: You use subscript to set and retrieve values by index without needing separate methods for setting and retrieval.
  5. inout: It used to modify the parameter passed as an argument.
  6. rethrow: The rethrows a keyword is used when you write a function (let’s call it A) that accepts a throwing function as a parameter (let’s call it B). If function B throws errors, then function A becomes a throwing function too, but if function B doesn’t throw errors then neither does function A.
  7. mutating: When you want to change a property inside a method, you need to mark it using the mutating keyword

21. What is adaptive layout iOS?

When designing your app, you can now create a single layout, which works on all current iOS devices.

22. What the difference between closure and delegate?

23. Closure declaration Syntex

Var clousrName: ((string, Bool) -> Void)?

24. Difference between computed and stored property?

25. Difference between and use of escaping and non-escaping.

26. What is Major Feature Difference Between UIWebView and WKWebView?

iOS Interview tips and question:

https://www.linkedin.com/pulse/ios-developer-interview-tips-questions-part-1-muralidharan-k/

If you like this post, please share and give claps so others can find it 👏👏

You can follow me on Medium for updated articles. Also, connect with me on LinkedIn, Twitter.

If you have any comments, questions, or recommendations, feel free to post them in the comment section below!👇

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Shantaram Kokate
Shantaram Kokate

No responses yet

Write a response