JOBSEEKER?

iOS & Swift Interview Questions

Practice for iOS & Swift interviews by solving TestDome questions. Our interview questions are used by more than 7,000 companies and 450,000 individual test takers.

Jobseekers: Certify Your Knowledge

Take a Certification Test

Companies: Use Our Tests for Screening

Buy a Pack Of Candidates

Need to practice your iOS and Swift skills for an upcoming job interview? Try solving these iOS interview questions that test knowledge of iOS APIs, the Swift programming language, and mobile development concepts. We’ll provide feedback on your answers, and you can use a hint if you get stuck.

These iOS interview questions are examples of real tasks used by employers to screen job candidates for mobile development jobs that require knowledge of the iOS environment in order to create and maintain iOS applications.

1. UITableView

iOS UI Public
   
Easy  

Select the components that are minimally required for constructing and configuring a UITableViewController, which can be used to view (but not manipulate) a list of items.

(Select all acceptable answers.)


2. View Controller

iOS Event handling UI Public
   
Easy  

Which of the following statements are true for UIViewController?

(Select all acceptable answers.)


3. Car

Swift Language Public
   
Easy  

Consider the following Swift definition of the structure Car:

struct Car {
    var color:UIColor?
    let model:String
    
    init(model:String) {
        self.model = model
        self.color = nil
    }

    mutating func changeColor(color:UIColor) {
        self.color = color
    }
}

Select the statements that are correct.

(Select all acceptable answers.)


4. Events

iOS Event handling Public
   
Easy  

Which of the following statements are true for user interface events in iOS?

(Select all acceptable answers.)


5. User Subscription

Swift Memory management New Public
   
Easy  

An application uses the User and Subscription classes for tracking all subscriptions that a user has purchased. Currently, the memory occupied by instances of those classes is never reclaimed.

Without changing the public API, fix the memory leak.


6. Two Sum

Swift Algorithmic thinking Dictionary New Public
   
Easy  

Write a function that when passed an array and a target sum, returns, efficiently with respect to time used, two distinct zero-based indices of any two of the numbers whose sum is equal to the target sum. If there are no two numbers, the function should return nil.

For example, findTwoSum([ 3, 1, 5, 7, 5, 9 ], 10) should return a single dimensional array with two elements and contain any of the following pairs of indices:

  • 0 and 3 (or 3 and 0) as 3 + 7 = 10
  • 1 and 5 (or 5 and 1) as 1 + 9 = 10
  • 2 and 4 (or 4 and 2) as 5 + 5 = 10

7. Readable Object

Swift OOP Protocols New Public
   
Hard  

Change the Readable protocol and the ReadableObject and EmptyReadableObject classes so that:

  • ReadableObject and EmptyReadableObject implement the Readable protocol.
  • When the read method is called on the ReadableObject class, it returns the value that it received in the constructor.
  • The isReadable method returns true in the ReadableObject classand returns false in the EmptyReadableObject class.

If you feel ready, take one of our timed public iOS & Swift Interview Questions tests:
iOS and Swift

iOS and Swift Online Test (Easy)

Not exactly what you are looking for? Go to our For Jobseekers section.
Dashboard Start Trial Sign In Home Tour Tests Questions Pricing For Jobseekers