前端面试题-字节跳动一面

  1. HTTPS和HTTP区别
  2. HTTPS 连接建立的过程
  3. CDN 有哪些优化静态资源加载速度的机制?
  4. 有哪些方式实现 HTTP 请求浏览器缓存?ETag是如何生成的?
  5. 谈下Promise.race和Promise.all
  6. 写出一下代码console输出顺序
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('setTimeout');
}, 0);  

async1();

new Promise(function(resolve) {
  console.log('promise1');
  resolve();
}).then(function() {
  console.log('promise2');
});

console.log('script end');

7.请补充完成逻辑

   function sum(num) {
       // 请你实现
   }
   
   const a = sum() // a === 0
   const b = sum(6)() // b === 6
   const c = sum(4)(5)() // c === 9
   const d = sum(1)(1)(1)() // d === 3
   ...
   const k = sum(n1)...(nk)() // n1 + ... + nk

8.请输出二叉树的每个左节点

       1
      / \
     3   5
        / \
       4   6
       
    输出 [1, 3, 4]
    function TreeNode(val) {
        this.val = val;
        this.left = null;
        this.right = null;
    }
    
    function leftView(root) {
      // 请你实现
    }
  1. React Fiber 架构?
  2. React UNSAFE_ ?
  3. react生命周期函数
  4. react 自定义 hooks如何使用,需要注意什么?
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值