简明现代魔法 -> 互联网时代 -> 如何面试前端工程师

如何面试前端工程师

2010-02-04

Interviewing a front-end engineer is an interesting task primarily because most are self-taught. Startups and large companies alike have equal trouble finding quality front-end engineers simply because they don’t know what to look for and which questions to ask. Having been around the industry for a while, I’ve developed my own methods for interviewing front-end engineers that I find to be very effective.

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

I’ve heard from candidates that I’m a tough interviewer, though I don’t try to do so on purpose. I believe the candidates think I’m tough because of the level of detail to which I ask them to answer questions. I’ve posted before about how to survive an interview with me and what I believe makes a good front-end engineer, and so my interviews are tailored towards the information in both of those posts. I don’t ask trick questions and I don’t believe in logic problems. All I want to do is figure out if you can do the job. And I do that in some simple ways.

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

Basic knowledge 基本知识

We live a world where almost anything you want to know is accessible in 15 seconds through the Internet. However, having access to information isn’t the same as knowing how to apply it. There’s a certain base of knowledge that I expect all front-end engineers to have to do the job effectively. You can’t possibly meet deadlines if you need to stop and look everything up online, and so someone who says, “I don’t know, but I can find it online,” immediately raises a flag for me. Here are the things I expect a front-end engineer (junior through senior) to know without any outside help:

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

Once again, all of this should be “top of your head” knowledge. All of my early questions are geared towards gaining your level of knowledge in all of these areas. This is not an exhaustive list by any stretch of the imagination but I believe that these are the building blocks you need to have a shot at success working with me.

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

Limited questions 少量提问

I’m a big believer that the interviewer should ask as few questions as possible. Constantly asking a candidate to change direction is both unfair and insane. In any given interview, I typically ask around three major questions, but each covers as many topics as I can possibly squeeze in. The questions involve multiple steps and allow for follow-on questions should I so choose. For example:

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

I have a page that displays the current stock price for Yahoo!. This page has a button that 
you can click to refresh that price inline, without unloading the page. Please describe how 
you would implement this, assuming that the server always has the correct stock price data.  
现在有一个正显示着Yahoo!股票价格的页面。页面上有一个按钮,你可以单击它来刷新价格,但不会重新加载页面。请你
描述一下实现这个功能的过程,假设服务器会负责准备好正确的股票价格数据。  

This question hits a good group of the basic knowledge that I want: DOM structure, DOM manipulation, event handling, DOM manipulation, XHR, and JSON. I could cover more of the points by asking for an alternative treatment of the stock price or some other message to be displayed on the page. For more senior candidates, I can easily continue on with other topics just as differences between JSON and XML, security issues, and capacity issues.

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

I also expect all answers to not involve using libraries. I want raw code written as if there is no library on the page. Library knowledge isn’t useful to me because libraries change over time. I need people who understand what goes on inside the library and can reproduce it by hand.

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

Problem solving 解决问题

The thing that makes front-end engineering so interesting is that there are multiple ways to solve the same problem, and it’s the context that determines the correct approach. When I ask questions, I tend to ask for a second way to do it after the candidate has explained one way. I ask them to imagine that for some reason their solution won’t work and ask for another. This accomplishes a couple of things.

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

First, it sniffs out mindless regurgitation of something they read about. Some people are amazingly talented at being able to repeat things they’ve read and sound intelligent. These people usually have trouble figuring out why that solution wouldn’t work and then coming up with a new solution. If I hear, “I don’t understand why this way isn’t good enough,” then I know they’re out of their league and were trying to get by with a copied answer.

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

Second, it shows me their working (once again, “top of the head”) knowledge of the browser technology. If they have a good understanding of the core parts of the browser platform, it’s not that difficult to imagine a different solution to the same problem.

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

This is an absolutely critical skill to have as a front-end engineer. We’re constantly met with roadblocks with things we believe should work and yet don’t (I’m looking at you, IE6). You can’t be one of those people who gets deterred when the first solution doesn’t work.

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

Another side of the problem solving equation is my favorite. Once I get a good sense for what a candidate does and doesn’t know, I’ll ask a question that’s just outside of their realm of knowledge. I do this because I want to see how they’ll solve a brand new problem using what they already know. At each step, I have a hint ready in case they get stuck (it doesn’t help me to evaluate someone when he or she gets stuck for 15 minutes); it’s the progression from one step to the next that I’m interested in. I want to see this person learn something new right in front of my eyes.

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

Note: All of the questions are rooted in browser technology. I don’t believe in abstract logic problems as a way to evaluate someone’s web tech problem solving skills. That’s like asking a sketch artist to paint a portrait - it doesn’t make sense and you’re not getting any valuable data.

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

Enthusiasm 有激情

Perhaps the most important part of being a good front-end engineer is enthusiasm for what you do. We haven’t been taught our skills in college or in seminars, so front-end engineers need to be self-taught. And since browser technology changes so rapidly, we also need to constantly be upgrading our skills to keep up. I can’t force someone to follow blogs and keep trying to learn more, that has to be something the candidate brings to the table.

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

How can you tell if someone is enthusiastic about this type of work? It’s actually quite simple. I ask a single question: “what excites you about web technology right now?” This is a timeless question that is nearly impossible to get wrong…unless you have no answer. If I were asking this right now, I’d expect the answer to be things like WebSocket, HTML5, WebGL, client-side databases, etc. People who are enthusiastic about web development are always reading, always trying to pick up new skills; these are the people I want to work with. Of course, I ask them to explain whatever they mention in more detail to ensure they’re not just throwing out buzzwords.

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

最后一点 In the end

There are other skills that are useful, such as computer science or web design knowledge, but those are bonuses over the basic knowledge. If the basic knowledge is there, it’s easy to build on top of whereas it’s horrifically difficult to teach the basics from scratch while on the job. There’s also more skills to look for in senior front-end engineers than for junior ones, and an entirely different process for interviewing college graduates with little or no experience. What I’ve presented in this post is just the basics.

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

And as I always tell people who are new to interviewing, there’s really only one question to ask yourself when you leave the room: do I want to work with this person? If the answer is no for any reason, then it’s a no.

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

Disclaimer: Any viewpoints and opinions expressed in this article are those of Nicholas C. Zakas and do not, in any way, reflect those of Yahoo!, Wrox Publishing, O'Reilly Publishing, or anyone else. I speak only for myself, not for them.

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

You can leave a response, or trackback from your own site.

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

随机文章推荐
网站分类


注:如需转载本文,请注明出处(原文链接),谢谢。更多精彩内容,请进入简明现代魔法首页。

进入新博客
喜欢本文,就分享它吧
给我留言
您的名字:
您的邮件:
您的网站:


 

copyright © 2009 简明现代魔法    学习、分享、进步

power by Gonn 感谢所有关心和支持本站的朋友们