字节互娱前端实习-二面面经

- 自我介绍(应该往项目上引的!!
- 计网学过啥?
- 计网五层模型
- 拥塞控制
- 数据结构?
- union-find
- stack & queue & priority queue & Deque & LRU
- tree
- BST
- RBT
- B+
- Trie
- k-d tree
- hash
- hash table
- hash map
- 算法?
- sort
- 冒泡
- 插入
- 选择
- 归并
- 快排
- 桶排
- 堆排
- search
- BFS
- DFS
- UCS
- A*
- Backtracking
- tree
- Minimal spanning tree
- compression
- 哈夫曼
- Min-cut & Max-flow
- css
- rem知道吗?
- 尽可能多的布局使元素居中
1. `margin: 0 auto`
2. `float`
3. `position: absolute`
4. `flex`
5. `grid`
- 动画
- js基础
- 类的继承
- 如何判断一个object的类型

`Object.prototype.toString`用来判断类型再合适不过,借用它我们几乎可以判断所有类型的数据:

```jsx
function isType(data, type) {
const typeObj = {
'[object String]': 'string',
'[object Number]': 'number',
'[object Boolean]': 'boolean',
'[object Null]': 'null',
'[object Undefined]': 'undefined',
'[object Object]': 'object',
'[object Array]': 'array',
'[object Function]': 'function',
'[object Date]': 'date', // Object.prototype.toString.call(new Date())
'[object RegExp]': 'regExp',
'[object Map]': 'map',
'[object Set]': 'set',
'[object HTMLDivElement]': 'dom', // document.querySelector('#app')
'[object WeakMap]': 'weakMap',
'[object Window]': 'window',  // Object.prototype.toString.call(window)
'[object Error]': 'error', // new Error('1')
'[object Arguments]': 'arguments',
}
let name = Object.prototype.toString.call(data) // 借用Object.prototype.toString()获取数据类型
let typeName = typeObj[name] || '未知类型' // 匹配数据类型
return typeName === type // 判断该数据类型是否为传入的类型
}
```

- `bind`,`apply`,`call`是啥?区别?手写`bind`
- 你所了解的`ES6`
- 代码题
1. 实现一个`bind`方法,用`call`或`apply`来做。
2. `["1", "2", "3"].map(parseInt)` 代码输出

[['1','2','3'].map(parseInt)的返回值是什么?](https://juejin.cn/post/6844903815171276808)

3. 给个N长度的数字字符串,每次只允许相临左右替换一次,请问怎么样最少替换字数,让整个字符串变成有序的。
#面经##字节跳动##实习##前端工程师#
全部评论
考了这么多数据结构啊
点赞 回复
分享
发布于 2021-03-14 20:36
阿里巴巴大进口技术部招22届实习~ 团队技术强~ 氛围好~ 欢迎来撩
点赞 回复
分享
发布于 2021-03-24 15:46
淘天集团
校招火热招聘中
官网直投
同学,有没有兴趣投一下阿里巴巴大进口产品技术部,hc多多哈
点赞 回复
分享
发布于 2021-04-01 16:27

相关推荐

点赞 18 评论
分享
牛客网
牛客企业服务