字节跳动前端二面视频1小时10分钟
字节跳动今日头条前端二面视频1小时10分钟
2020-05-21 14:00
(嗯...回答得要好不好的,脑壳疼,犯了很多低级错误,另外的话,对于一些手写不是很熟,后面要好好注重一下手写了。再者,字节的面试好像都偏向手写,普通知识点问得不是很难,一般情况下不会追问很深,当然个人项目他们还是非常感兴趣的,会多问一点。)
1.自我介绍
2.你个人博客的接口怎么设计的?都返回了什么?
3.斐波那契数列。最开始我写的第一种,然后面试官要求降低空间复杂度(算是我第一次遇到要求考虑空间复杂度的面试题)就改写了第二种。另外我当时写的是没有考虑Index的合法性,被面试官批评了。
function F(index){
if(index <= 0) return 0
let fa = [];
[fa[0], fa[1]] = [1, 1]
//第一种
for(let i = 2; i < index; i++){
fa[i] = fa[i-1] + fa[i-2]
}
return fa[index-1]
//第二种
//for(let i = 2; i < index; i++){
// [fa[0],fa[1]] = [fa[1],(fa[1] + fa[0])]
//}
//return fa[1]
}
5.事件队列。按正确顺序写出输出。(唉,天天说不考不考,这下async/await栽了吧。'async1 end'这一条我位置弄错了,其他都对了,不知道面试官会不会网开一面)
async function async1() {
console.log('async1 start');
await async2();
console.log('async1 end');
}
async function async2() {
console.log('async2');
}
console.log('script start');
setTimeout(function() {
console.log('setTimeout1');
}, 200);
setTimeout(function() {
console.log('setTimeout2');
new Promise(function(resolve) {
resolve();
}).then(function() {
console.log('then1')
})
new Promise(function(resolve) {
console.log('Promise1');
resolve();
}).then(function() {
console.log('then2')
})
},0)
async1();
new Promise(function(resolve) {
console.log('promise2');
resolve();
}).then(function() {
console.log('then3');
});
console.log('script end');
6.以下代码输出什么,如何更改让它正常输出;
for(var i=0;i<10;i++) { setTimeout(() => console.log(i)); }
7.HTTP缓存;
8.虚拟DOM的原理,优势以及劣势;
9.智力题,有两根不均匀分布的香,香烧完的时间是一个小时,你能用什么方法来确定一段15分钟的时间。
10.反问环节。内容就不说啦,不过面试官推荐我去看剑指offer,然后对于web存储可以去看下一localforage是一个新的东东。顺便看一下websql,indexDB
(手动艾特某一位仍然0offer的可爱的小朋友,嘿嘿,咱们秋招碰一碰,谁先走谁小狗)
#字节跳动##前端工程师##实习##面经#

