Interview question for Web Developer
One of the roles we are looking for right now is for a web developer. We are looking for someone who can do great things on the browser and write good, maintainable code. I’m not a web developer, haven’t been in a while, but it has been really interesting to see the interview process. In particular, I have great fondness for the following line of questions.
What does this code do?
I love this because it is simple, short and can reveal a lot about the mental model that the candidate has about how JavaScript works. If they hesitate too much in answering this, we typically just run this snippet in the browser and ask them to explain the results. This is important because it shows that they understand the execution model, how code is interleaves, etc.
The next stage is to ask them what the following snippet will do:
I actually have zero expectation that they will be able to answer this correctly. We let them think about this for a few seconds and then run it in the browser. Asking them to explain why it gave the output it gave is a lot more interesting.
The final piece of this line of questions is to have them implement the following:
And here we get to also investigate how they are thinking about code. This isn’t a trivial thing to implement, because you need to understand lambdas, how to coordinate several actions into a cohesive whole, etc.
We usually ask people to describe us how they would handle something like this, not actually write the code. And hearing the thought process that the candidates go through as they solve this can be illuminating.
Comments
Do you have a link to the job description? :)
Rob, This is local only, we are looking for someone to work with the RavenDB Studio, ravendb.net and the internal applications we use.
Let me give it a shot, just for fun ;-)
function setTimeout2(callback, interval){ setTimeout(callback, 10+interval); }
function setTimeout2(callback, interval) { setTimeout(callback, Math.abs(interval));}
I misread the question, sorry.. but there's no delete button to my previous comment :(
Comment preview