2024-8-15 滴滴一面
顺序和实际估计相差挺大
问题
- 自我介绍
 - 项目主要负责什么,遇到的问题,如何解决
 - vue 数据响应式原理 vue3 Proxyvue2 defineProperty
 - 为什么对数组原型链处理,怎么做的处理
 - 组件通信
 - 生命周期
 - script defer async
 - 跨域
 - 性能优化手段
 - 原生小程序和其他的优缺点,性能,原理
 - 讲输出
 
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')
})
async1()
new Promise(function (resolve) {
  console.log('promise1')
  resolve()
}).then(function () {
  console.log('promise2')
})
console.log('script end')
// 结果顺序
// hong
// 微任务
// log
// script start
//  async1 start
// async2
// async1 end
// promise1
// script end
// promise2
// setTimeout
- 实现 promise.all
 
Promise.prototype.myAll = function (promises) {
  return new Promise((resolve, reject) => {
    let allRes = []
    let num = 0
    for (let p of promises) {
      p.then(res => {
        allRes.push(res)
        num++
        if (num === promises.length) {
          resolve(allRes)
        }
      }).catch(err => {
        reject(err)
      })
    }
  })
}
反问
- 工作强度 10 ~ 8/9
 - 负责的内容 app,可能有 rn 之类的内嵌进去
 
总结
实习真没时间准备面试,感觉很多还是需要像八股一样突击的 😌
#秋招##滴滴##提前批#

查看7道真题和解析