网易

网易

一面:

1.UIButton 的父类依次是什么?各自的作用?除了 NSObject 还有别的基类吗?Swift 里有基类吗?Swift 里的枚举和 OC 的枚举有什么区别?

2.下面代码的打印结果是:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
@interface Animal : NSObject
@end
@implementation Animal
@end

@interface Cat : Animal
@end

@implementation Cat

- (instancetype)init {
self = [super init];
if (self) {
NSLog(@"%@", NSStringFromClass([self class]));
NSLog(@"%@", NSStringFromClass([super class]));
}
return self;
}

@end

int main() {
Cat *c = [[Cat alloc] init];
return 0;
}

为什么打印结果是 Cat

3.下面代码的输出结果是:

1
2
3
int a[5] = {1, 2, 3, 4, 5};
int *ptr = (int *)(&a + 1);
printf("%d, %d", *(a+1), *(ptr - 1));

4.下面代码运行的结果是

1
2
3
4
5
6
7
8
- (void)viewDidLoad {
[super viewDidLoad];
NSLog(@"1")
dispatch_sync(dispatch_get_main_queue(), ^{
NSLog(@"2");
});
NSLog(@"3");
}

如果把sync换成async,打印结果有什么不同,如果执行非常多的次数,会出现1,2,3吗?

5.下面代码的执行结果是?

1
2
3
4
5
6
7
8
9
NSMutableString *a = [NSMutableString string];

NSMutableString *b = [a copy];

[b stringByAppendingString:@"test"];

NSLog(@"%p", &a);

NSLog(@"%p", &b);

a和b的地址一样吗?

b会崩溃吗?

6.哪一个会崩溃

A.

B.字典插入nil

C.对nil发消息

D.对非nil发消息,没有该方法

7.响应者链,查找视图和响应者链同时进行吗?

8.口述算法:判断链表是否有环

有一个 500G 的大文件,内存只能使用 20M,要找到 Top10,怎么处理?

9.Runtime 和 Runloop 的应用,消息机制,如果一个类方法找不到,找到最后有个同名的实例方法,会调用吗?

10.KVC 的原理,KVO 的原理

11.页面流畅度优化

项目:

构建提效做了哪些

了解 Socket 吗?

算法:

1.爬楼梯

2.两数之和二 一个非降序数组,和target,不使用额外空间,只遍历一次

介绍项目里有挑战的

二面:

1.iOS方向了解的比较深入的东西

2.这段代码执行后,打印顺序是什么?为什么?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
let group = DispatchGroup()

group.notify(queue: .global()) {
print("1")
}

group.enter()

group.notify(queue: .global()) {
print("2")
}

group.leave()

group.enter()

group.notify(queue: .global()) {
print("3")
}

gcd. group notify 如果让你实现一个类似 gcd group enter leave 如何实现

3.tableView cell 复用,你怎么实现一个类似的复用池 有identifer和Cell类型

4.今年 WWDC 有哪些新东西?

5.做过 iPad 和 Mac 的适配吗?自动布局,图片按16:9怎么写约束,左侧 label 超出屏幕宽度一半时,把右侧 label 放在下一行。为什么要把视图添加到 cell.contentView 上,而不是直接添加到 cell 上?

6.写过 python 吗?

7.做过 IAP 和国际化吗?

8.做过 CI 吗?流水线静态分析错误是你做的吗?

9.大学学了哪些课程,学过设计模式吗?学过 Java 吗?

10.用 AI 做过哪些工具

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×