Lessons from a Swift Interview
oskargroth.com·2d·
Discuss: Hacker News
🔗Functional Compilers
Preview
Report Post

A while back, Apple reached out to me about a position on the SwiftUI Mac frameworks team. Having worked with SwiftUI since its release, I was really excited about this opportunity. But after years as an indie developer, this was my first real technical interview in a while.

Spoiler alert: I didn’t get the job. But I did learn something about Swift algorithm design and how to approach technical interviews.

The Assignment

For the interview assignment, I was asked to implement a function called coalescingAdjacentDuplicates() as if it were being added to the Swift Standard Library, with emphasis on generality, performance, and safety.

The solution had to support being used like this:

let x = [1, 2, 2, 3, 3, 3, 1]
for element in x.coalescingAdjacentDuplicates() {
prin...

Similar Posts

Loading similar posts...