Recent submissions

Comment · 12 years ago
I've been doing this sporadically and in my free time, just for fun, so there are a lot of fundamental things that haven't been covered there. :)
Comment · 12 years ago
Comment · 12 years ago
Comment · 12 years ago
Comment · 12 years ago
This is the Euclidean algorithm for GCD, it's naive and simple. But if you see it more carefully, the commit that says "Optimized performance ..." contains just the lines:

  34      var tmp = a;
  35	  a = Math.max(a, b);
  36	  b = Math.min(tmp, b);
  37	  if (a % b === 0) return b;
to avoid the unnecessary repetitions if b is already the GCD
Comment · 13 years ago
This is a complicated issue, but in my opinion the google/facebook style of interview is the one that gives you less false positives, even though it gives tons of false negatives. In other words, very few people who can do it are bad coders (false positives), but many good coders can't do it (false negatives).

So, as companies like Google and Facebook have so many applications, they're much more concerned about false positives than false negatives.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton