Hacker News new | ask | show | jobs
by columbo 5002 days ago
That question, and the example in the link really threw me for a loop.

At first I understood the question as described, but then looking at the javascript code I suddenly became lost and frightened. It wasn't until I clicked "run" that I realized the code wasn't working "as is" and needed to be made to work. Then it was just a matter of adding cache to the function (at least that's what I did). I had first read the blog as "this an example of caching" not "this is an example of the starting point for the problem".

I still prefer to not have 1 "golden" question but a list of problems the interviewee can choose from. That way they can find something that matches with areas they might be more famalier with (oh crap, I haven't thought of Fibonacci in awhile so I'll take on this robot-battle-engine quiz)

On an unrelated side note I had some fun making quiz #27 pass assertions but fail the meaning of the test:

      for ( var i = 0; i < array.length; i++ ) {
        var d = [];
        d.fn = fn;
        d.fn(i);
      }