字节跳动前端提前批一面

字节提前批前端一面


1
实现斐波那契数列的计算 (我先用递归实现,然后面试官让我改进一下因为递归效率很低,我就用了dp

// function F(index) return 数列在相应位置的值

// F(1) 1

// F(2) 1

// F(3) 2

// F(5) 5


2
写出以下代码的log


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');



3

for(var i=0;i<10;i++) { console.log(i); }


for(var i=0;i<10;i++) { setTimeout(() => console.log(i)); }

改成输出 0-9


4

GET/POST请求的区别


5

进程和线程的区别


6

React key 的作用

虚拟dom原理


7

有两根不均匀分布的香,香烧完的时间是一个小时,你能用什么方法来确定一段15分钟的时间

#字节跳动秋招提前批##字节跳动##前端工程师##校招##面经#
全部评论
感觉挺常规的呀
1 回复
分享
发布于 2020-07-12 11:31
智力题也是经典原题
点赞 回复
分享
发布于 2020-07-12 11:32
英特尔
校招火热招聘中
官网直投
感觉这是目前看到关于字节的最简单的一次提问
点赞 回复
分享
发布于 2020-07-12 14:10
请问是哪个部门的啊
点赞 回复
分享
发布于 2020-07-12 20:56

相关推荐

3 26 评论
分享
牛客网
牛客企业服务