Skip to content

Instantly share code, notes, and snippets.

@ben-doyle
Created February 18, 2022 04:16
Show Gist options
  • Save ben-doyle/abf7a96c1fd03c279167e08c4f65f775 to your computer and use it in GitHub Desktop.
Save ben-doyle/abf7a96c1fd03c279167e08c4f65f775 to your computer and use it in GitHub Desktop.
iOS Developer Interview

iOS Developer interview.

Order:

  1. Introduction (5 Mins)
    1. Introduce yourself.
    2. Ask the candidate to talk about themselves.
  2. Questions from resume/recent work.
  3. Questions about how you work, and find information.
  4. Technical Questions.
  5. Candidate questions.

Code Questions

Pass by reference, pass by value

var arr1 = [1, 2, 3]
var arr2 = arr1
arr2.append(4)

var len = arr1.count
print(len)

Questions:

  1. What is the output of this code snippet?
  2. What is this concept called and can you explain it?

Guard!

func myFun() {
    guard false else {
         print("This block is run")
         return
    }
    print("This is never run")
}

myFun()

Questions:

  1. What is the output of this code snippet?
  2. Why would I use a guard block instead of an if block?

As As? As!

protocol TextFile {
var name: String { get }
}

protocol Book: TextFile {
var author: String { get set }
}

struct BookImpl: Book {
var name: String
var author: String

    init(name: String, author: String) {
        self.name = name
        self.author = author
    }
}

class Reader {
private let textfile: TextFile

    init(textfile: TextFile) {
        self.textfile = textfile
    }

    func printName() -> String {
        return self.textfile.name
    }

    func printAuthor() -> {
        let book = textfile as Book
        return book.author
    }
}

let book = BookImpl(name: "The fellowship of the ring.", author: "J.R.R Tolkien")
let reader = Reader(textfile: book)
print(reader.printName())
print(reader.printAuthor())

Questions:

  1. I have sent this to you in a pull request, I am a junior developer. What kind of comments or questions do you have?
  2. Do you think this code compiles? Yes, no, what would we have to do to make this compile.
  3. Can you explain to me the differences the the use cases for the keywords, is, as, as! and as?

General Questions

  1. What is the difference between a class and a struct?
  2. What are the trade-offs for companies implementing swift-UI?
  3. What are your thoughts on documenting code, none, a little bit, or too much is never enough?
  4. Have you used graphQL? If so, can you tell me some positives and negatives vs REST?

Architecture Questions

  1. You have to design a back end API that returns responses to iOS, android and web.
    1. What kind of considerations should you keep in mind?
    2. What kind of differences if any would there need to be for android clients?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment