当前位置: 首页 > 面试经验 >

东方财富前端1面

优质
小牛编辑
165浏览
2023-03-28

东方财富前端1面

数错了,今天这家才是第6个一面挂,已经打破实习面试一面连挂记录了,fine,攒齐7个一面挂可以召唤神龙吗?
0906 50min
1.自我介绍
2.介绍项目。echart图表刷新,动画效果?用的什么框架,分工,遇到的困难?做了多久?
3.url到页面渲染会发生什么?
DNS域名解析,TCP连接,强缓存协商缓存(说了状态码),DOM树、CSS树、Render树、布局绘制(重绘与回流)、连接结束。
4.http状态码
5.怎么决定开始前端?
6.热身题
返回字符串第一个出现次数为1的字符。Object.entries在非Chrome浏览器并不是按照顺序变成数组的。
7.js多叉树遍历(没做出来)
const exampleTree = {
val: 'a',
children: [
{
val: 'b',
children: [
{ val: 'd', children: [] },
{ val: 'e', children: [] }
]
},
{
val: 'c',
children: [
{ val: 'f', children: [], },
{ val: 'g', children: [], }
]
}
]
}
console.log(Object.values(exampleTree))

// 实现函数 getPathToNode
// 题目保证输入的tree每个node的值在整个tree中唯一
// 若目标val不在tree中,返回空数组[]。
// 预期: getPathToNode(tree, 'f') -> ['a', 'c', 'f']
const getPathToNode = (tree, target) => {
  var res = []; 
  try{
    dfs(tree,target)
  }catch{
    return res;
  }
  function dfs(node,target){
    if(!node) return [];
    res.push(node.val)
    if(node.val == target){
      throw('find it')
    }
    if(node.children && node.children.length>0){
      for(let item of node.children){
          dfs(item,target);
      }
      res.pop();//当前节点的子节点遍历完依旧没找到,则删除路径中的该节点
    }else{
      res.pop();//找到叶子结点还没找到,删除叶子结点
    }
  }
  return [];
}
// 拓展,数组的多叉树遍历
const getPathToNode = (tree, target,path) => {
  if(typeof path == 'undefined'){
    path = [];
  }
  for(var i = 0;i<tree.length;i++){
    var tmpPath = [...path];
    tmpPath.push(tree[i].val);
    if(tree[i].val == target) return tmpPath;
    if(tree[i].children){
      var result = getPathToNode(tree[i].children,target,tmpPath);
      if(result) return result;
    }
  }

}


8.反问应该如何介绍项目?
从用户视角介绍,谁在用,如何满足客户的需求,把需求梳理清楚,业务上有什么价值?
 类似资料: