Finding Some "Good" iOS Interview Questions for Employers

42
Why is it so damn hard to find a good developer? by Natalie Podrazik May 13, 2015

Transcript of Finding Some "Good" iOS Interview Questions for Employers

Why is it so damn hard to find a good developer?

by Natalie Podrazik May 13, 2015

How can I tell if someone knows enough to work with me

without me losing my mind?by Natalie Podrazik

May 13, 2015

Skill Spectrum

Experts

Senior

Learning

Junior

Typical Hiring Screening Process

1. Resume 2. Code samples/portfolio 3. Phone screen 4. Take home test 5. 1-2 rounds of technical interviews

Pop Quiz

Rules

1. # of years you’ve been writing Cocoa or Mac OS X/iOS Apps

2. Write the level of experience you think you have (1 = Junior, 5 = Senior)

3. For each question, rank the level of experience you think a candidate would need to answer the question

4. Star the question if you think it’s a “good” interview question

Your answers to the questions

Meta Page: Answer Page:

15 Questions, 20 Minutes

How do you use NSNotificationCenter?

#1

What are some ways that you can persist data in an

app?

#2

What are the differences between an array and a linked list? What

do you think an NSArray is?

#3

What’s a delegate? Give an example.

#4

Why shouldn’t you reference self in a

block?

#5

You have a method call. By using the debugger or a print statement you determine that the method is

never called even though it seems plain that it should be. What is a

very likely cause?

#6

What is a hash?

#7

When you create an object (in a running app, not while you’re

writing code), where are the bytes located in memory?

#8

Have you worked with NSOperationQueue? How

does it work?

#9

What is an NSZombie?

#10

Name some of the UIApplicationDelegate protocol methods and how to use them.

#11

How would you add another element (@“delta”) to the

foo array?

NSArray *foo = @[@“alpha”,

@“beta”, @“gamma”];

#12

Describe what happens behind the scenes when you tap an app’s icon, you see the app open, and

you press the home button.

#13

When responding to an NSNotification, what will happen

if the notification handler executes for a long time? What

can you do about it?

#14

How can you add a method to a class that you don’t have the code for?

#15

Pencils down!

How Useful Were Those Questions?

How do you use NSNotificationCenter?

#1 Answer

1. Add an observer that can handle notification

2. Post notification

3. Remove observer

What are some ways that you can persist data in an app?

#2 Answer

• NSUserDefaults • CoreData • SQLite • Archive to Disk

What are the differences between an array and a linked list? What

do you think an NSArray is?

#3 Answer

- Arrays require contiguous memory - Arrays allow index-based access - Array insertion/deletion requires moving other elements around

- Linked Lists’ insertion/deletion has minimal impact to rest of set - Linked Lists can have hetereogenerous encapsulated data - Linked Lists have increased memory management overhead (dangling pointers, incomplete freeing of memory)

NSArray is probably a linked list with helper methods to make it more array-like.

What’s a delegate? Give an example.#4 Answer

"Delegation is a simple and powerful pattern in which one object in a program acts on behalf of, or in coordination with, another object. The delegating object keeps a reference to the other object—the delegate—and at the appropriate time sends a message to it. The message informs the delegate of an event that the delegating object is about to handle or has just handled. The delegate may respond to the message by updating the appearance or state of itself or other objects in the application, and in some cases it can return a value that affects how an impending event is handled. The main value of delegation is that it allows you to easily customize the behavior of several objects in one central object." -- Apple

< insert a zillion examples here>

source: apple.com

Why shouldn’t you reference self in a block?

#5 Answer

source: apple.com

You have a method call. By using the debugger or a print statement you determine that the method is never

called even though it seems plain that it should be. What is a very likely cause?

#6 Answer

The receiver is nil.

What is a hash?#7 Answer

Possible answers include:

• Data structure that enables constant lookup given a unique string (dictionary/hashmap)

• One way encryption • …More

When you create an object (in a running app, not while you’re

writing code), where are the bytes located in memory?

#8 Answer

On the heap.

Have you worked with NSOperationQueue? How does it work?

#9 Answer

source: nshipster.com

What is an NSZombie?#10 Answer

“NSZombies is a runtime process that you can turn on with an environment variable, when it is on released objects are not returned to the heap, instead they are replaced with a “zombie” version of their class that causes a crash. Why is crashing this way useful? The answer is that when it crashes, the object which called it will be in the stack trace — therefore you can quickly see where you are accessing a released object, without NSZombies the crash would happen in the next class which uses the same address, this could be quite distant from the spot where the bug really is.”

source: Scott Yelich

Name some of the UIApplicationDelegate protocol methods and

how to use them.

#11 Answer

source: Dash for Mac

How would you add another element (@“delta”)

to the foo array?

NSArray *foo = @[@“alpha”,

@“beta”, @“gamma”];

#12

(of the many solutions…)

Answer

#13 AnswerDescribe what happens behind

the scenes when you tap an app’s icon, you see the app open, and

you press the home button.

When responding to an NSNotification, what will happen if the notification handler executes

for a long time? What can you do about it?

#14 Answer

The thread blocks. NSNotificationCenter is single threaded. You can use GCD to move it off the main thread.

How can you add a method to a class that you don’t have the code for?

#15 Answer

Job Postings in the Wild

full doc: https://docs.google.com/spreadsheets/d/1JWvJvIlTfcWbSUBH8nk5EwmeG0ikwXxEaxJTFJ0-h2o/edit#gid=0

• 3 years of experience ≈ iOS 6 • Acknowledge career arc of mobile developers • Most places have no idea how to qualify your abilities • Solve “The Apple Problem”

Conclusions about Employers seeking Devs Like Us, After Looking through ~20 Fresh Job Postings:

Personal Reference

• 2-3 years experience is 2-3 iOS Releases • Culture and coachability

Conclusions as a Developer, Interviewing iOS Candidates for her Employer

Live App

Sample Code