Interview Question

Data Server Software Developer Coop Interview

-Ottawa, ON


Come up a most efficient way to determine if a integer is odd or even.

AnswerAdd Tags

Interview Answers

2 Answers


int number = ...; if(number % 2) { odd } else { even }

Anonymous on


Compilers are smart enough to understand the result of n%2. Don't over-complicate it.

Anonymous on

Add Answers or Comments

To comment on this, Sign In or Sign Up.