{"action":"created","issue":{"url":"https://api.github.com/repos/LingYanSi/blog/issues/2","labels_url":"https://api.github.com/repos/LingYanSi/blog/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/LingYanSi/blog/issues/2/comments","events_url":"https://api.github.com/repos/LingYanSi/blog/issues/2/events","html_url":"https://github.com/LingYanSi/blog/issues/2","id":92096349,"number":2,"title":"面试相关","user":{"login":"LingYanSi","id":8621814,"avatar_url":"https://avatars.githubusercontent.com/u/8621814?v=3","gravatar_id":"","url":"https://api.github.com/users/LingYanSi","html_url":"https://github.com/LingYanSi","followers_url":"https://api.github.com/users/LingYanSi/followers","following_url":"https://api.github.com/users/LingYanSi/following{/other_user}","gists_url":"https://api.github.com/users/LingYanSi/gists{/gist_id}","starred_url":"https://api.github.com/users/LingYanSi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LingYanSi/subscriptions","organizations_url":"https://api.github.com/users/LingYanSi/orgs","repos_url":"https://api.github.com/users/LingYanSi/repos","events_url":"https://api.github.com/users/LingYanSi/events{/privacy}","received_events_url":"https://api.github.com/users/LingYanSi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-30T13:36:03Z","updated_at":"2015-07-02T15:58:24Z","closed_at":null,"body":"#### 今天去网易面试，好久没面试，有些许激动，有些问题本可以更好的回答，却没有，如下。\r\n1.谈一谈css的定位\r\n>我是从relative，absolute，fixed会不会脱离原有文档流谈的，但其实应该从最基本的相对定位，绝对定位，保持位置不变来说，结果结结巴巴没说明白。这是css最基本的问题了  \r\n\r\n2.谈谈前端模版\r\n>这个问题我说，我接触过koajs的ejs模板引擎，重要是用来在后端渲染，避免了浏览器端的数据请求。他们说，你说的是后端模板，那前端模版呢？当时我就有点蒙逼了，什么是前端模版？？\r\n>然后他们又说，假如又一个dom节点需要反复利用，怎么处理。这时我才想起在学习backbone的时候，学习到过。就是在\\<script type=\"text/template\">标签内部加上dom，type=\"text/template\"内部内容浏览器不会去执行，另外一种方式把dom加载textarea内部，但还是建议使用第一种。\r\n\r\n3.是如何管理js文件的依赖\r\n>其实在电话面试的时候问过，当时我回答的是使用gulp,grunt之类的前端自动化工具。或说回来，这一个月时间需要把公司项目的js、css文件处理一下，主要就是js代码的压缩、混淆，css的后处理，主要是指给有必要的css属性加上浏览器的私有标签。\r\n\r\n4.angular的数据双向绑定是怎么实现的\r\n>我说，主要就是数据的脏检查，先把需要watch的数据缓存起来，然后不断的去对比。之所以这么说，是因为之前看到过有人说，angular的observe实现是每隔50ms就去对比一次数据。面试官说，按你这说，那浏览器可能引用个angular什么事情没做就卡死了。\r\n[AngularJS的数据双向绑定是怎么实现的？——知乎](http://www.zhihu.com/question/23275373)\r\n\r\n5.有没有了解过网易的开源项目\r\n>我说没有，这个怎么说呢？按道理，在面试前其实应该在网上搜一搜的，但只是搜一搜，他们再问一些细节性问题，就又不好办了。唉，两难。\r\n\r\n6.说一说js的继承\r\n>我想很简单啊，原型链继承。面试官说，这是一种，那他和组合继承的区别呢。\r\nWTF??什么是组合继承，从来没有听说过\r\n[JavaScript继承方式详解——segmentfault](http://segmentfault.com/a/1190000002440502)\r\n原型链+借用构造函数的模式，这种模式称为组合继承。\r\n所谓借用构造函数，是指使用Function的call/apply来改变函数的this指针，达到继承的目的\r\n```\r\nfunction Parent(){\r\n\tthis.name = ['father']\r\n\tconsole.log(this.name)\r\n}\r\nParent.prototype.con = function(){\r\n\tconsole.log('打印',this.name)\r\n}\r\nfunction Child(){\r\n\tParent.call(this)\r\n}\r\nChild.prototype = Parent.prototype;\r\nconsole.log(Child.prototype)\r\nvar test = new Child() ;\r\ntest.name.push('child');\r\ntest.con() //--->[father,chid]\r\n```\r\n\r\n7.你们觉得我的水平怎么样\r\n>这个问题是我问他们的，两位面试官哈哈大笑，大意是说缺乏大型项目的锻炼。\r\n的确，第一份、第二份工作一直都是我一个人，没有人带，只能自我学习。\r\n我觉得自己现在的问题是，急于想跳槽，摆脱目前的困境。但其实应该把自己学习到的东西，在已有项目上都实践是检验，才是正道，才能到去才一些坑，再下一次面试的时候，方能更从容一些。\r\n比如说grunt/potcss的运用，明天去公司就开始着手。"},"comment":{"url":"https://api.github.com/repos/LingYanSi/blog/issues/comments/118077095","html_url":"https://github.com/LingYanSi/blog/issues/2#issuecomment-118077095","issue_url":"https://api.github.com/repos/LingYanSi/blog/issues/2","id":118077095,"user":{"login":"LingYanSi","id":8621814,"avatar_url":"https://avatars.githubusercontent.com/u/8621814?v=3","gravatar_id":"","url":"https://api.github.com/users/LingYanSi","html_url":"https://github.com/LingYanSi","followers_url":"https://api.github.com/users/LingYanSi/followers","following_url":"https://api.github.com/users/LingYanSi/following{/other_user}","gists_url":"https://api.github.com/users/LingYanSi/gists{/gist_id}","starred_url":"https://api.github.com/users/LingYanSi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LingYanSi/subscriptions","organizations_url":"https://api.github.com/users/LingYanSi/orgs","repos_url":"https://api.github.com/users/LingYanSi/repos","events_url":"https://api.github.com/users/LingYanSi/events{/privacy}","received_events_url":"https://api.github.com/users/LingYanSi/received_events","type":"User","site_admin":false},"created_at":"2015-07-02T15:58:24Z","updated_at":"2015-07-02T15:58:24Z","body":"#### 2015/7/2晚9点，天猫的电话面试\r\n\r\n明天补充一下"}}