Swap two integers without a temporary variable
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: easy
Interview Round: Other
Overview: Swap the values of two integers without storing either one in a temporary variable, then return them as a tuple in swapped order. It tests whether you can recover each value from a combined one, and whether you know the overflow and aliasing pitfalls of such tricks in fixed-width languages.