順便打個廣告,敝司 iOS 研發工程師崗位還有一個位置,要求和 隔壁 topic 差不多,只是薪資雙倍而且可遠程。
感覺選的已經都是基礎得不能再基礎的題了,只有幾個為了考察面試者的搜索和學習能力稍有些偏。因為項目剛剛改用 Swift 用不上這些題了所以順便發出來給 V2EX 社區的各位參考下意見。題目主要考察以下幾點:
- 格式的規範性
- 實現方式是否優雅
- 經驗和經驗之外的學習能力
- 解決問題的邏輯
下面是面試題:
Language
1. Declare an NS_OPTIONS type BCLayoutAxis with following values:
- none
- horizontal
- vertical
- all
2. Create string representations for the values above
For debugging, we need string representations ("none", "horizontal", "vertical", "all") instead of original integer values. Use a graceful approach to represent them.
3. Declare a constant value (public/private)
Declare a constant named kBCMyConstant of NSString type with value of myConstantValue, public and private.
4. Create variadic method
5. Create a singleton
6. Concatenate string literals
7. Percentage encoding and decoding
8. Reverse an array
9. Filter objects in an array by value of a property
@interface MyObject : NSObject
@property (nonatomic, assign, readonly) BOOL favorited;
@end
Given an NSArray instance containing several MyObject objects, put the objects of which favorited property are YES into a new NSArray instance.
10. Remove duplicated objects from an array
NSArray *myArray = @[@"a", @"b", @"c", @"a", @"d"];
Create a new NSArray instance from myArray containing @"a", @"b", @"c", @"d" only.
11. Determine if an NSDate instance is in this month
Runtime
1. Swizzle a method
- (void)myMethod;
- (void)bc_myMethod;
2. Determine the type of a property
@property (nonatomic, copy) NSString *myProperty;
3. Determine the caller of a method
Stack, framework, address, class, function, line.




