IBM Interview Question: The question was "How do you ... | Glassdoor

Find your next job here

Interview Question

Software Engineer Interview Lenexa, KS

The question was "How do you swap two values without

  creating a new variable?"
technical, brain teaser, programming, logc

Interview Answer

1 Answer


I didn't answer the question correctly, but I looked it up later and found it:
a = a XOR b
b = a XOR b
a = a XOR b

Interview Candidate on Mar 8, 2013

Add Answers or Comments

To comment on this, Sign In or Sign Up.