You hard-code it using XOR. Note you can't even do a for-loop, as that's using an extra variable. Of course hand-unrolling a loop takes extra memory because it's so many extra lines so there's no point.
a ^= b
b ^= a
a ^= b
This is very unlikely to be something that occurs to programmers who haven't had to XOR recently; if you aren't writing your own hash or crypto or codec functions then you probably haven't used it in a while. Now that you've seen this, you'll remember it and so if anyone asks, you won't be figuring it out again, just recalling.IMO it's a pretty useless way to weed people out, kind of like testing people on chess by random arrangements of pieces. Chess experts remember actual legal positions that occur in games much better than non-players, but they are no better at remembering positions that never occur -- a bunch of kings on a chessboard, some in adjacent squares, for example.
Likewise, this kind of pattern NEVER occurs in what most people program; it's just implausible.