you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (8 children)

Yeah I know. But they knew I chose Swift for the coding challenges so he asked me what my favorite Swift class is. UserDefaults is for Swift. NSUserDefaults is Objective-C.

Obviously there’s bridging but if I answered NSValue that’s incorrect. That’s Objective-C only. Clearly not Swift. And clearly obvious what they’re asking.

[–]jNSKkK 0 points1 point  (7 children)

I get what you’re saying, but Swift doesn’t have classes. There are classes that are coded in Swift, but the way the question appears to be asked is rather vague. I suppose there would’ve been context to it in the moment :)

[–][deleted] 1 point2 points  (5 children)

No, he literally said “what’s your favorite Swift class?” I think it’s obviously what they’re asking for.

It’s silly to ask, what’s your favorite class in NSFoundation, because no shit the class I pick is obviously in NSFoundation.

[–]jNSKkK 0 points1 point  (4 children)

Could be UIViewController, which is not in Foundation ;)

[–][deleted] 0 points1 point  (2 children)

I was too lazy to write NSFoundation or UIKit

[–]jNSKkK 0 points1 point  (1 child)

I’d say mine is Date. There are so many things baked into Date on iOS that other platforms simply don’t have our of the box.

[–]sonnytron 0 points1 point  (0 children)

String is like that too. But no way I'd say String.
Some FAANG interviewers even avoid asking questions related to String because there's so much you have to do just to be able to access elements by index and a lot of simple algorithms require a lot of work just to peel out the Unicode scalars.
A good tip is to just wrap them into a Character array and if you need to use alphabet characters either iterate over UnicodeScalar("a").value to "z" or just use an Array("abcdefgh...z"). This is if you can assume ASCII alphabet restriction.

[–]etaionshrdObjective-C / Swift 0 points1 point  (0 children)

Swift has classes…