头条前端实习一面凉经

前端小白准备的最充分的一次
自我介绍,项目介绍,项目困难如何解决。。。
1. 输入URL发生了什么(域名解析过程,tcp三次握手,为什么需要三次握手)
2. http缓存
3. 事件***,事件冒泡
4.html语义化,HTML5新增
5. 盒子模型,boxsizing没有设置的时候的默认大小
(以下题目我尴尬地一知半解)
6. Css 写一个正方形,大小是父级的一半
7.写函数任意标签转成json文件
<div>  <span>     <a></a >  </span>  <span>  <a></a >    <a></a > </span></div>

{  tag: 'DIV',children: [    {      tag: 'SPAN',    children: [       { tag: 'A', children: [] }      ] },    {     tag: 'SPAN',      children: [        { tag: 'A', children: [] },       { tag: 'A', children: [] }    ]   }  ]}

function DOM2JSON(root) {}
8.写函数:
function repeat(func, times, wait) { // TODO}const repeatFunc = repeat(alert, 4, 3000);repeatFunc("hellworld");
repeatFunc("hellworld");//会alert4次 helloworld,每次间隔3秒

9.抛硬币
抛硬币问题 先抛的人赢的概率

昨天14.30面,15.10结束,今天上午12.00收到没过的邮件
#面经##春招##前端工程师#
全部评论
第七题我也遇到了。。
点赞
送花
回复
分享
发布于 2019-03-26 14:57
第7题: function Dom2JSON(str) { function helper(str) { let reg = /<(.+)>(.*?)<\/\1>/g; let result = null; let nodes = []; while ((result = reg.exec(str)) != null) { let currentNode = createJSON(result[1]); nodes.push(currentNode); let children = helper(result[2]); if (children.length != 0) currentNode.children = children; } return nodes; } let result = helper(str); result = result.length !== 0 ? result[0] : result; return JSON.stringify(result); }
点赞
送花
回复
分享
发布于 2019-04-08 13:55
滴滴
校招火热招聘中
官网直投

相关推荐

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