Swift & iOS Test

20 questions total, 45 minutes maximum, for mid-level programmers



Online test includes:

Swift 5 & iOS  -  20 Questions

  • Swift: Value and Reference Types
  • Swift Miscellaneous: Protocols, Optionals, Properties, Key Paths
  • UIKit
  • Foundation
  • Closures, Memory Management
  • Grand Central Dispatch (GCD), Concurrency

Sample Swift Test Question

Which statements about the following Swift code are true?

Sample Swift Interview Question

Answers

1. The output will be BAR.

2. It's not legal to reuse the name s on line 1.

3. There should be a question mark after s on line 2, since s is an optional string: s?.uppercased().

4. The value of a is undefined after line 3.

5. Not supplying an initial value is a compile error on line 3.

The correct answer is 1.

Explanation

The key competency is optionals.

The code tests basic optional behaviour – initialization, the guard statement with a conditional binding, scoping rules.


Register Download Sample Report

Made by Professionals

Other iOS Tests

Other Programming Tests