字节前端实习一面+二面
一面 1h
css:
1. 盒模型
1. 盒模型
2. 让一行文字的时候居中,超过一行的时候 轴对齐
3. 行内元素 块级元素 区别
可以设置宽高吗
img是行内为什么可以设置宽高
4. 立即执行函数 作用域 this
5. 闭包
var a=[]
for (var i = 0;i<10;i++){
a[i] = function(){
console.log(i)
}
}
a[6]()输出几 //10
为什么?
怎么改?
6. 事件循环
看题说输出 并解释
async function async1() {
console.log('async1')
await async2()
console.log('async1 end')
}
async function async2() {
console.log('async2')
}
console.log('script start')
setTimeout(() => {
console.log('setTimeOut')
}, 0)
async1()
new Promise((resolve) => {
console.log('promise')
resolve('promise2')
}).then((data) => {
console.log(data)
return ('promise3')
}).then((data) => {
console.log(data);
}).then((data) => {
console.log(data);
})
console.log('script end')
6. js数据类型:基本类型和引用类型的区别,堆栈的区别
7. 深拷贝怎么实现
8. get 和post什么区别
9. http知道的都讲一下
说了几个头字段
缓存
https
代码题:
找众数
我用的map
问时间、空间复杂度,怎么优化
反问
二面 45mins
http1.0和http2.0 的区别
强缓存和协商缓存
unicode 和 ansi的区别 (没说出来)(编码方式不同)
ANSI中的字符采用8bit,而UNICODE中的字符采用16bit。
代码题:
说输出顺序并解释:
(function(){
console.log(1)
setTimeout(()=>{
console.log(2)
Promise.resolve().then(()=>{
console.log(3)
})
})
console.log(4)
setTimeout(()=>{
console.log(5)
})
console.log(6)
})()
微任务有哪些
宏任务有哪些
柯里化
funtion add(x,y){
return x+y
}
add(1,2) //3
add(1,2,3) //3
function wrap(fn){
//实现这个函数
}
let add1 = wrap(add)
add1(1,2,3) //6
add1(1,2,3,4) //10
容器固宽
一行元素的时候居中
多行的时候左对齐
爬楼梯
求两个数组交集
http1.0和http2.0 的区别
强缓存和协商缓存
unicode 和 ansi的区别 (没说出来)(编码方式不同)
ANSI中的字符采用8bit,而UNICODE中的字符采用16bit。
代码题:
说输出顺序并解释:
(function(){
console.log(1)
setTimeout(()=>{
console.log(2)
Promise.resolve().then(()=>{
console.log(3)
})
})
console.log(4)
setTimeout(()=>{
console.log(5)
})
console.log(6)
})()
微任务有哪些
宏任务有哪些
柯里化
funtion add(x,y){
return x+y
}
add(1,2) //3
add(1,2,3) //3
function wrap(fn){
//实现这个函数
}
let add1 = wrap(add)
add1(1,2,3) //6
add1(1,2,3,4) //10
容器固宽
一行元素的时候居中
多行的时候左对齐
爬楼梯
求两个数组交集
第一次面经献给字节~ 许愿二面过


