Original Post:Interviewing the front-end engineer
Nicholas C. Zakas,2010年1月5日
翻译完成:2010年1月7日,最后更新:2010年1月10日

面试前端工程师对我来说是一件非常有意思的事,因为面试过程很大程度上也是自我提升的过程。无论大公司还是小公司,之所以在如何招聘到真正有能力的前端工程师方面会遇到同样的问题,就是因为负责招聘的那些人不知道自己公司需要什么样的人,结果问问题时也问不到点子上。经过这几年在行业里的摸索,我总结出了自己的一套很有效的面试前端工程的方法。

有的应聘者说我不好对付,但留给他们这样的印象也并非我所愿。我觉得之所以他们说我不好对付,主要是因为我问他们问题时问得太细了。以前我曾专门写过一些东西,告诉应聘者怎么才能通过我的面试以及怎样才能成为优秀的前端工程师应该具备什么样的素质,而我的面试可以说完全是按照那两篇文章的标准进行的。我不会问一些特别偏门的问题,也不认为出几道逻辑题就能考出人的真实水平。我唯一的想法就是确定你能否胜任我们要招的这个职位。为此,我需要简单地考察如下几个方面。

基本知识

我们生活在互联网时代,你想知道的任何事情几乎都能在15分钟内找到相关信息。可是,能找到信息并不等于你会使用它。我认为所有前端工程师至少都应该掌握某些基本的知识,才能有效地完成自己的工作。如果一遇到问题,就停下工作上网四处搜索解决方案,怎么可能保证按期完成工作呢?听听,还有谁在说“我不知道,但我可以上网搜到。”请这些同学把手举起来,让大家认识一下(immediately raises a flag for me.)。下面我列出一些基本的知识点,这些都是我认为一名前端工程师(无论工作年头长短)在没有任何外来帮助的情况下就应该知道的。

  • DOM结构——两个节点之间可能存在哪些关系以及如何在节点之间任意移动。
  • DOM操作——怎样添加、移除、移动、复制、创建和查找节点。
  • 事件——怎样使用事件以及IE和DOM事件模型之间存在哪些主要差别。
  • XMLHttpRequest——这是什么、怎样完整地执行一次GET请求、怎样检测错误。
  • 严格模式与混杂模式——如何触发这两种模式,区分它们有何意义。
  • 盒模型——外边距、内边距和边框之间的关系,IE < 8中的盒模型有什么不同。
  • 块级元素与行内元素——怎么用CSS控制它们、它们怎样影响周围的元素以及你觉得应该如何定义它们的样式。
  • 浮动元素——怎么使用它们、它们有什么问题以及怎么解决这些问题。
  • HTML与XHTML——二者有什么区别,你觉得应该使用哪一个并说出理由。
  • JSON——它是什么、为什么应该使用它、到底该怎么使用它,说出实现细节来。

重申一下,上述这些知识点都应该是你“想都不用想”就知道的东西。我一开始问的所有问题都是想摸清你对所有这些领域知识的掌握程度。虽然上面列出的这些知识点并没有面面俱到,但我觉得你至少应该掌握这些,才有可能跟我坐到一间办公室里来。

少量提问

我非常赞同面试者问的问题越少越好。反复问应聘者各种问题既不公平,也很无聊。我在任何一次面试中,通常只问三个大问题,但每个问题又会涉及我所能想到的多个方面。回答每个大问题一般要经过几个步骤,这样我就可以在每个步骤中穿插着问一些小问题。比如说:

现在有一个正显示着Yahoo!股票价格的页面。页面上有一个按钮,你可以单击它来刷新价格,但不会重新加载页面。请你描述一下实现这个功能的过程,假设服务器会负责准备好正确的股票价格数据。

这个问题牵扯到一组我想要考察的基本知识点:DOM结构、DOM操作、事件处理、XHR和JSON。如果我要求你换一种处理股票价格的方式,或者让你在页面中显示其他信息,就可以把更多的知识点包括进来。对于经验比较丰富的应聘者,我也可以自如地扩展要考察的知识范围,最简单像JOSN与XML的区别、安全问题、容量问题,等等。

我还希望应聘者给出的任何解决方案中都不要使用库。我想看到最原生态的代码,你就当页面中没有包含任何库。你说你对哪个库了解多少多少,但我不能把关于库的知识作为评判能力的因素,因为库是会随时间变化的。我需要的是真正理解库背后的机制,特别是能够徒手写出一个自己的库的人。

解决问题

做为一名前端工程师,最值得高兴的事莫过于解决同一个问题会有很多种不同的方法,而你要做的就是找出最合适的方法来。我在提问的时候,经常会在应聘者解释完一种方法后问他们还有没有第二种方法。此时我会跟他们说,假设你的这个方法由于种种原因被否决了,那么你还能不能给出另一种方法。这样做可以达到两个目的。

首先,可以测试出他们是否在毫无意义地复述书本中的东西。不能不承认,某些人确实有过目不忘的天赋,听他们在那里滔滔不绝地讲,你会觉得他们什么都明白。可是,只要一跟这些人谈到怎么查找方案无效的原因,以及能否拿出一个新方案来,他们往往就傻眼了。这时候,如果我听到“我不明白这个方案为什么不够好”之类的反问,心里立刻就明白我的问题已经超出了他们的能力范围,而他们只是想拿自己死记硬背的结论来蒙混过关。

其次,可以测试出他们已经掌握的(还是那句话,“想都不用想”就知道的)浏览器技术知识。如果他们对浏览器平台的核心知识有较好的理解,想出解决同一问题的不同方案根本没有那么难。

对一名前端工程师来说,这绝对是最重要的能力。前端工程师在工作中遇到本该如此却并未如此的难题(说你啦,IE6),应该说是一件很平常的事。一个方案无效就无计可施的人,做不了前端工程师。

考核应聘者解决问题能力的另一层原因,与我的个人喜好有关。在搞清楚应聘者知道什么不知道什么之后,我就会想着问一个他们知识领域之外的问题。这样做的目的,就是想看看他们怎样运用已有的知识解决新问题。在解决问题的每一步,我也准备了一些提示,以防有人会卡壳打艮(在我面前15分钟一言不发,对我评价这个人毫无帮助)。我真正感兴趣的,是他们能够从上一步前进到下一步。我希望看到一个人就在我眼前学到新知识。

注意:所有问题都与浏览器技术相关。我不相信出几道抽象的逻辑题,就能够考出某人解决Web技术问题的能力。在我看来,这无异于让素描大师画肖像(或者让刘翔跟博尔特同场竞技),没有意义,也得不到任何有价值的信息。

有激情

要成为一名优秀的前端工程师,最重要的莫过于对自己做的事要有激情。我们的技能都不是从学校中或者研讨会上学来的,因此前端工程师必须具备自学能力。浏览器技术的变化可谓日新月异,所以也只有不断提升自己的技能才做得到与时俱进。我虽然不能强迫谁必须多看博客、不断学习,但想应聘前端工程师的人恐怕还是必须得这么做。

你怎么知道谁对这种工作有没有激情?实际上非常简单。我只问一个简单的问题:“目前你对什么Web技术最感兴趣?”这个问题永远不会过期,而且也几乎不可能出错……除非你答不上来。就眼下来说,我希望你对这个问题给出的技术中包括WebSocket、HTML、WebGL、客户端数据库,等等。只有对Web开发充满激情的人,才会坚持不懈地学习新知识、掌握新技能;这些人才是我真正想要的。当然,我会让他们详细解释自己提到的技术,以保证他们不是随口念叨了几个时髦的新词汇。

最后一点

计算机科学或者Web设计方面的知识当然也有用,但那都是基本知识之外的东西。只要基本知识在那儿了,一切就都有了基础,想扩充知识面也不难。可是,如果等到正式上班以后,还得从头学习基本技能,那种难度是不可同日而语的。另外,高级前端工程师与一般工程师相比,肯定需要掌握更多的技能。而面试几乎没有经验的大学毕业生,我也会有一套完全不同的程序。我在这篇文章里列出来的都是一些最基本的东西。

对于那些还没有多少面试经验的人,我总是喜欢告诉他们,面试完了只要问自己一个问题就行:你想以后跟这个人在一起共事吗?如果不管为什么,回答是不,那就是不。

免责声明:本文的任何观点与意见都只跟Nicholas C. Zakas有关,与Yahoo!公司、Wrox出版公司、O’Reilly出版公司乃至其他任何人无关。我在这里说的话,仅代表我自己,不代表上述公司。

你可以在这里留言,也可以在你自己的站点上发送一个引用通告。

延伸阅读

Nicholas C. Zakas的书

Professional JavaScript for Web Developers, 2nd Edition Professional Ajax, 2nd Edition Even Faster Web Sites



朋友们的留言

  1. Jordan Shoes | 11月 6th, 2012 at 17:48

    http://www.buyairsjordans2012.com/

    Reply to this comment
  2. replica watches | 11月 19th, 2012 at 09:06

    Good article.I agree with you very imaginative imagery.Say your blog in the focus of every reader.Focus explained orderly.

    Reply to this comment
  3. Replica Watches | 11月 21st, 2012 at 16:10

    It is really a good post. I will share it with my friends. Hope there will be more good posts here!

    Reply to this comment
  4. replica watches | 11月 24th, 2012 at 16:18

    Very helpful article. I used to be looking for these particulars very very long time but you’ll find limited assets. Thank you for site here.excellent.

    Reply to this comment
  5. Wholesale Snapback Hats | 12月 4th, 2012 at 09:01

    所有前端工程师至少都应该掌握某些基本的知识,才能有效地完成自己的工作。

    Reply to this comment
  6. thai women for marriage | 12月 5th, 2012 at 11:42

    面试完了只要问自己一个问题就行:你想以后跟这个人在一起共事吗?如果不管为什么,回答是不,那就是不。

    Reply to this comment
  7. Perruques Femme | 12月 13th, 2012 at 15:19

    You make it entertaining and you still manage to keep it smart.

    Reply to this comment
  8. perruques | 12月 13th, 2012 at 15:20

    I like it! Your post is really good providing good information..Valet parking I liked it and enjoyed reading it. Keep sharing such important posts.I am very much pleased with the contents you have mentioned.I wanted to thank you

    Reply to this comment
  9. Perruques Femme | 12月 13th, 2012 at 15:21

    onjour,je suis interessé par le moteur que vous citez (moteur à pile 9V )Ma demande concerne la plage de vitesse que vous donnez:1 tour en 5 ou 25 mn, c’est donné par le fournisseur ou l’avez-vous déterminée expérimentalement?
    Cordialement

    Reply to this comment
  10. Burberry Scarf Sale | 12月 17th, 2012 at 09:57

    This is in actuality a terrific webpage.It’s actually a great and helpful piece of info. I truly appreciate this blog article.Thanks Again. Awesome.I bookmarked your site!

    Reply to this comment
  11. Christian Louboutin Outlet | 12月 17th, 2012 at 10:00

    This is in actuality a terrific webpage.Left on my site a link to this post.Left on my site a link to this post.Left on my site a link to this post.I bookmarked your site!Thanks for your sharing.

    Reply to this comment
  12. Discount Beats By Dre | 12月 17th, 2012 at 10:02

    I just keep on following the blogs on this site.I truly appreciate this blog article.Thanks Again. Awesome.I bookmarked your site!Thanks for your sharing.

    Reply to this comment
  13. good essay writing | 01月 26th, 2013 at 20:40

    ou know, a lot of individuals are hunting around for this information, you could aid them greatly

    Reply to this comment
  14. Homepage | 02月 1st, 2013 at 21:13

    asdsfd hguyt erwwe rawer asw very is informative, interesting and very well written. keep up the nice high quality writing

    Reply to this comment
  15. www.legalherbalonline.com/store/ | 02月 13th, 2013 at 19:45

    zsdg hdrtnm Thank you so much dear! I’m happy to hear that you’re inspired and on your way- I wish you nothing but the best!!

    Reply to this comment
  16. Protravelnetwork | 02月 22nd, 2013 at 12:48

    it is such a new boots, because of a lot of Europe and theUnited States star street snap have foot

    Reply to this comment
  17. Pro Travel Network | 02月 24th, 2013 at 11:49

    w3n465 it is such a new boots, because of a lot of Europe and theUnited States star street snap have foot

    Reply to this comment
  18. Sell your car | 03月 5th, 2013 at 00:02

    day’s post was really amazing. Now I have become a regular user of this website. Thanks for giving us so much knowledge

    Reply to this comment
  19. DS 708 | 03月 7th, 2013 at 14:51

    This is a very good article. Look at the nature of such information blog, the content is written well. You may provide more detailed information than http://www.obd4u.co.uk/ access the best job

    Reply to this comment
  20. Buy K2 herbal Incense | 03月 9th, 2013 at 22:56

    ok at the nature of such information blog, the content is written well

    Reply to this comment
  21. Oakley Sunglasses Outlet Online | 03月 21st, 2013 at 08:56

    Article ideas very clear . Your writing style is very unique. I very much appreciate the articles you write . Hope you continue to create the beautiful works .

    Reply to this comment
  22. Michael Kors Outlet Online | 03月 21st, 2013 at 08:59

    Your article has brought us a lot of useful information . The article very vivid expression . The article also has a fresh point of view .

    Reply to this comment
  23. Cheap Beats By Dre Headphones | 03月 21st, 2013 at 09:03

    Content of the article is a very philosophical . The article gave us a very wonderful feeling . We have benefited greatly .

    Reply to this comment
  24. Attrezzature per Edilizia | 04月 16th, 2013 at 13:52

    terrific webpage.Left on my site a link to this post.Left on my site a link to this post.Left on my site a link to this post.I bookmarked your site

    Reply to this comment
  25. K2 Incense | 05月 17th, 2013 at 09:36

    has brought us a lot of useful information . The article very vivid expression

    .Left on my site a link to this post.I bookmarked your site.

    Reply to this comment
  26. Colorado Springs Auto Repair | 05月 18th, 2013 at 00:46

    webpage.Left on my site a link to this post.Left on my site a link to this post.Left on my site a link to this post.

    Reply to this comment
  27. Colorado Springs Brake Repair | 05月 19th, 2013 at 18:53

    过目不忘的天赋,听他们在那里滔滔不绝地讲,你会觉得他们什么都明白。可是,只要一跟这些人谈到怎么查找方案无效的原因,以及能否拿出一个新方案来,他们往往就傻眼了。这时候,如果我听到“我不明白这个方案为什么不够好”之类的反问

    Reply to this comment
  28. Dymo labels | 05月 19th, 2013 at 23:38

    正式上班以后,还得从头学习基本技能,那种难度是不可同日而语的。另外,高级前端工程师与一般工程师相比,肯定需要掌握更多的技能。而面试几乎没有经验

    Reply to this comment
  29. Buy Spice incense | 05月 21st, 2013 at 00:23

    Hi,
    I appreciate to your work. This is really useful share.
    Thank you.

    Reply to this comment
  30. Online herbal | 05月 22nd, 2013 at 18:11

    Hi,
    I am glad to read your article.
    Thanks for the post.

    Reply to this comment
  31. Legal incense | 05月 23rd, 2013 at 21:01

    Nice blog.
    I am glad to read your article.

    Reply to this comment

我来说两句儿

可以在留言中使用以下标签 :<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Spam Protection by WP-SpamFree