Deutsche Bank Interview Question
148 Interview Reviews |
Back to all Deutsche Bank Interview Questions & Reviews
Interview questions and reviews posted anonymously by interview candidates
Interview Question for Team Lead Engineering at Deutsche Bank:
Is it possible to swap two registers without using a third one?
| Tags: | logic, analytical, algorithm, math See more , See less 8 |
See more for this Deutsche Bank Team Lead Engineering Interview
Helpful Question?
Yes |
No
Inappropriate?
Answers & Comments (2)
Say a = 5 ; b = 10
a = a XOR b; // 5 XOR 10 is 15 so "a = 15"
b = a XOR b // 15 XOR 10 is 5 so "b = 5"
a = a XOR b // 15 XOR 5 is 10 so "a = 10"
So in the end a = 10 and b = 5
Helpful Answer?
Yes |
No
Inappropriate?
Members can
answer or comment on this question
–
Join Now (It's Free) or
Sign In
1 of 1 people found this helpful
by Interview Candidate:
int a=5,b=10;a=a+b; b=a-b; a=a-b;