News for hackers. Stuff that matters.
Re:What not to do when giving technical interviews (2014) by pjc50 on Wednesday June 12, 2019 @08:43AM (#20163936)
std::swap<>? CMPXCHG? LDREX/STREX?

The XOR trick is cute but you shouldn't use it on anything larger or more modern than a Cortex-M0. Just put it through a temporary variable and let register renaming deal with it.

(Perhaps a more interesting question would be a multi-threaded examination of swapping two numbers...)

Re:What not to do when giving technical interviews (2014) by verall on Wednesday June 12, 2019 @09:03AM (#20164098)
It's interesting because this is a real answer that will get you hired. It demonstrates knowledge of: the "correct" way to do it, basic asm awareness, programmer culture, and computer architecture. This probably checks off like 6 boxes for most technical interviewers in one answer.

Finally it implies it could have asked a better interview question ;)

Re:What not to do when giving technical interviews (2014) by pjc50 on Wednesday June 12, 2019 @10:02AM (#20164716)
Thankyou. I try to strike a balance with these things - showing off is mandatory in interviews, but needs to be done politely. You don't want to go full "Hexing the Technical Interview": https://aphyr.com/posts/341-hexing-the-technical-interview
Re:What not to do when giving technical interviews (2014) by taneq on Wednesday June 12, 2019 @09:05AM (#20164111)
This is basically the perfect answer to that question.