Re:Avoid character-by-character processing when performance ...
by rainbow-road on Saturday July 25, 2020 @03:56AM
(#23947524)
> 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.
Re:Avoid character-by-character processing when performance ...
by cbsmith on Saturday July 25, 2020 @03:43AM
(#23947486)
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.
Re:Avoid character-by-character processing when performance ...
by jonstewart on Saturday July 25, 2020 @09:54AM
(#23949186)
Daniel Lemire’s code is most definitely in production, returning fast results so your client code can burn CPU on JavaScript frameworks.
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.