Hacker News new | ask | show | jobs
by reagent_finder 2153 days ago
Bitwise hacks in production code? Seriously?

This is a nice gimmick to show off in an interview because the interviewer is definitely not going to get it, however it might backfire because the interviewer might realize a) you'll be out to get his job b) you might actually want to put stuff like this into production.

The idea is solid, don't get me wrong, and clever code is always clever code. Also like u/kevingadd mentions, the principle behind the thought is an important one, knowing when and how to handle data in bulk since you are looking for a needle in the haystack. For instance SQL and streams in Java are places where you need this kind of thinking.

But please, for the love of Gord, never put this bit of code in production.

3 comments

> Bitwise hacks

There's nothing hacky about this — it's a very simple procedure.

> the interviewer is definitely not going to get it,

I sure hope any interviewer for a software engineering position would get it. But this has nothing to do with interviews.

This isn't really about interview questions.

In the real world, this kind of approach is critical to making effective use of compute resources. This is the kind of stuff you want in production.

Daniel Lemire’s code is most definitely in production, returning fast results so your client code can burn CPU on JavaScript frameworks.
As if we chose to burn cpu on specifically javascript frameworks.