字节跳动飞书前端一面面经
1、为什么学前端
2、怎么学的
3、说说BFC
4、实现水平垂直居中的方法
5、面试官问我是ES6和ES5哪个用的多一点,于是他给了我下面这个题,but我全答错了...
var a = 1
var oA = () => {
console.log(this.a)
}
obj = {
a: 10,
b: function () {
console.log(this.a);
}
}
var c = obj.b
oA() //undefined
obj.b() //10
c() //undefined
6、说说事件循环EventLoop,看代码说输出
async function async1() {
console.log('async1 start');
await async2()
console.log('async end');
}
async function async2() {
return new Promise((resolve, reject) => {
console.log('async2 start');
resolve()
}).then(res => {
console.log('async2 end');
})
}
async1()
new Promise(resolve => {
console.log('Promise');
resolve()
}).then(res => {
console.log('Promise end');
})
console.log('script end');
7、说下原型链,我从原型开始说,再说的原型链,然后面试官问我,实例有prototype属性吗?我回答有,but我从他的疑惑中看出我错了
8、手写冒泡排序,写完让说一下选择排序和快速排序
9、简单算法题(类似斐波拉契那个)
10、说说浏览器缓存,Etag优先级为什么高于LastModified,LastModified对应有个请求头是什么
11、TCP是如何保证可靠传输的,我当时忘了,就回答了个三次握手、四次挥手
12、然后面试官问我平时怎么学计网和数据结构与算法的
查看11道真题和解析