微店面试

1,083 阅读2分钟

一面

  1. Promise 和 setTimeout 哪个先执行?为什么?
  2. 哪几种方式可以造成内存泄漏
    • 闭包
    • 循环引用
    • 定时器
  3. 隐藏元素有哪几种方法?
    • display: none
    • visibility: hidden
    • transform:translate
    • scale:0
    • z-index:-999
    • height:0
    • opacity:0
  4. margin-top:20% 和 padding-top:20% 是相对于谁?
    •  都是基于父盒子的宽度
  5. background 都有哪些子属性,参数
    1. 参数:bg-color || bg-image || bg-position [ / bg-size]? || bg-repeat || bg-attachment || bg-origin || bg-clip
    2. 子属性 
    • background-color
    • background-image
    • background-position
    • background-repeat 铺排方式
    • background-size
    • background-origin  设置原点
    • background-attachment  背景图滚动或固定
    • background-clip 背景图片向外裁剪的区域
  6. 如何实现适配?
    • 媒体查询 rem
    • flex
    • flutter
  7. 数组方法
    • Array.form、Array.isArray
    • pop、push、shift、unshift
    • sort、reverse
    • every、some
    • slice、splice  哪个不改变原数组? splice
    • map、filter、forEach、concat、reduce
  8. object
    • Object.keys()
    • Object.assgin()
    • Object.defineProperty(obj, prop, descriptor)
    • Object.defineProperties(obj, props)
    • Object.create(proto[, propertiesObject])
    • for...in
  9. 深拷贝&如何判断类型
    • 递归,基本类型直接赋值,引用类型
    • typeof 、instanceOf 、isArray 、toString、constructor
  10. 0.1 + 0.2 === 0.3 ? 解决方法
  11. css元素层级关系

  12. React 介绍?理解?
  13. React setState 为什么是异步的
  14. React Fiber
  15. React Hook
  16. React Vue 区别
    • 单向数据流/双向绑定
    • setter、getter/ 引用数据
    • jsx/模板化
    • vue开发更敏捷
    • 生态
    • 公司
  17. React 优化
    • return null 代替 display:none
    • should component update
    • 避免跨级操作
    • immutable
    • key
    • 少用setTimeout、不可控的ref、dom操作
  18. 项目优化
    • webpack
      • common 提取公共代码
      • 提取库
  19. loader执行顺序?
  20. 用正则匹配script标签之内的内容?
  21. web安全
    • Xss
    • CSRF
  22. 继承
  23. mapbox 原理?
  24. cookie 如何清空,如何设置属性?


二面

  1. babel 编译 箭头函数?
  2. bind 有什么副作用?
  3. 改变this 都有哪些方法?(bind,call,apply除外)
  4. 介绍一下自己的优势(学习能力、沟通能力、技术。。。)
  5. 前端规范都有哪些?
  6. pc端和移动端有什么区别?
  7. 比你优秀的人都有哪些特点?达到这样的水平需要多久?
  8. 算法导论和数据结构
  9. 成长最快是什么时候?