Gemalto interview question

How to swap 2 variables without using a third variable. And the team leader asked to write a code snippet for assigning 5 colors to the countries on the world map so that no adjacent country has same color.

Interview Answers

Anonymous

28 Jan 2016

Use XOR

Anonymous

11 Aug 2014

x = x + y; y = x - y; x = x - y;

7