DEV Community

Discussion on: Terrible interview question: Swap variables without a temporary

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

How would my example of encoding/decoding a UTF stream not be a better test? It involves more bit-wise operations. Giving the candidate the reference is also okay, since they still have to demonstrate bit operator knowledge.

Knowing this swap trick is not indicative of knowing low-level protocols or bit twiddling. There are some many things at the embedded level that I'd find more interesting to ask.