美团 食杂零售 前端一面

暑期考察基础比较多。

(1)数组和链表的区别

读取 和 删除 的时间复杂度

(2)什么是TCP和UDP

它们之间有什么区别?

(3)什么是进程与线程?

(4)HTTP和HTTPS 区别是啥?

(5)Array上有什么方法

比如 map, push

(6)

<div id="B">

<div id="A"></div>

</div>

document.getElementById('A').addEventListener('click', () => { console.log('A') })

document.getElementById('B').addEventListener('click', () => { console.log('B') })

鼠标点击A元素内,此时输出?(事件冒泡)

(7)跨域的原因及方案、如何解决跨域

cookie、localStorage、sessionStorage有什么区别

(8)

[a][b][c]

a,b,c {

display: inline-block,

width: 100px,

height: 100px,

}

b {

position: absolute,

top: 50px,

}

说下元素的排列情况

(9)setState是同步还是异步?具体做了什么?

代码:

树形结构取值

{
  id: 1,
	children: [
    {
    	id:2,
      children: [
        {id:4, children: []}
      ],
    },
    {
    	id:3,
      children: null
    }
  ]
}
输入4,输出[1,2,4]

输入3,输出[1,3]

输入5,输出[]

代码输出题

async function async1() {
  console.log('async1 start')
  await async2()
  console.log('async1 end')
}
async function async2() {
  console.log('async2')
}
console.log('start')
async1()
setTimeout(() => {
console.log('timer1')
Promise.resolve().then(function () {
  console.log('promise1')
})
}, 0)

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

new Promise(resolve => {
  console.log('Promise3')
  resolve()
}).then(() => {
  console.log('Promise3 then')
})
console.log('end')

//start、async1 start、async2、Promise3、end、async1 end、promise2、Promise3 then timer1 promise1

#面经#
全部评论
啥时面的哇
点赞 回复 分享
发布于 昨天 18:22 陕西
佬什么bg
点赞 回复 分享
发布于 昨天 23:20 陕西
佬什么bg啊二面已经G了
点赞 回复 分享
发布于 昨天 23:22 江苏

相关推荐

有人知道这个可以去面吗,后端被捞到前端&amp;移动端了
no_work_no_life:应该是捞去客户端了,假如你技术栈是java的话。后端转前端不太容易,但转客户端的话不少大厂还是能接受的,会java就行
点赞 评论 收藏
分享
评论
1
7
分享

创作者周榜

更多
牛客网
牛客企业服务