Morgan Stanley interview question

Was asked by a software engineer how to reverse a string using as little memory as possible.

Interview Answer

Anonymous

10 Apr 2013

Use the xor technique: a = a^b b = a^b a = a^b

1