Microsoft Interview Question for Software Engineer / Developers






Comment hidden because of low score. Click to expand.
1
of 1 vote

previous comment was bitwise xor
for logical xor would be
srry i didnt read the question correctly
#define XOR(a,b) (((a)&&(!(b)))||(((!a))&&(b)))

- geeks July 24, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Or simply, a != b

- Anonymous February 28, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

a||b?(a&&b?false:true):false

- Anonymous October 06, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

(a&^b) | (^a&b)

- Anonymous October 06, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

(!!a) ^ (!!b)

- ajay October 09, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

It's equivalent to a ^ b isn't it? That doesn't really answer the question...

- Anonymous October 14, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

(a&&~b)||(~a&&b)

- Just October 09, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

(a&&!b)||(!a&&b)

- Anonymous October 10, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Can anybody highlight why we cannot use simple a^b ??

- Ankur October 11, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

lol..

- Erik October 11, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

Logical xor, not bitwise...

- Anonymous February 28, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

The Question was we must not use any if else logic and obvious ur not supposed to use ^ operator

- Anonymous October 15, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

a XOR b = ( a | b ) & ( !a | !b )

- erm October 23, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

a XOR b = (a & !b) | (!a & b)

- b November 16, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

# define ex_or(a,b) (a^b)

- Anonymous November 22, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Hilarious.. :)

- lego.mk December 01, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

#define XOR(a,b) (((a)&(!(b)))|((!(a))&b))

- geeks July 24, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

previous comment is not correct
#define XOR(a,b) (((a)&(~(b)))|((~(a))&b))

- geeks July 24, 2011 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More