

Interviewing a JavaScript engineer - adamnemecek
http://agentcooper.ghost.io/javascript-interviews/

======
eggsby
Nice read, I had to think about a few of these.

In particular (a == 0) && (a == 1) && (a == 2).

Here's a fun value for a:

    
    
        var a = {
          called: -1,
          valueOf: function() {
            this.called += 1;
            return this.called;
          }
        };

~~~
zachrose
Don't you mean:

    
    
       var A = function(){
         this.called = -1;
       }
       A.prototype.valueOf = function(){
         this.called += 1;
         Return this.called;
       }
       var a = new A()

------
SideburnsOfDoom
A lot of this would fall into the category of "interview puzzles", i.e. they
make the interviewer look clever and are utterly useless in helping hire the
right person.

[http://37signals.com/svn/posts/3543-google-uses-big-data-
to-...](http://37signals.com/svn/posts/3543-google-uses-big-data-to-prove-
hiring-puzzles-useless-and-gpas-meaningless)

> And another one, completely useless in production code, but a nice puzzle to
> solve

Quite. I would prefer a job where I make production code not crossword
puzzles.

~~~
CmonDev
Maybe they are hiring people to implement features that are completely useless
in production code but are nice to implement?

PS: why do you even need to ask JS developers puzzles - all the most difficult
problems are on server-side anyway (unless it is Node.js of course).

