Interview Question for Software Engineer / Developers






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

We don't need even negation
a[0] = 0
a[1] = 0
lmao....

- Anonymous May 18, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

lol

- Anonymous June 25, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

good one....hahaha

- job_hunter July 10, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

// in C (not works in Java)

for (i = 0 ; i < 2 ; i==)
array[i] = array[i]? !array[i] : array[i];

// is it "using only negation operator??

- wfchiang May 16, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

you used if statement

- ouyang498 May 17, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

in first case it will be (0&~1),second case (~1&0),third case (~1&~1)

- JD May 17, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

The question isn't clear. Why use '&' and '~' ? You could just use '&' for [0,1], [1,0] and '^' for [1,1]. The question seems incomplete.

- m@}{ May 17, 2011 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

for(int i = 0; i < arr.length; i++)
  arr[i] -= arr[i];

- Anonymous May 17, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

question seems to be incomplete for me .. is the question asking for using only negation operator and dont use any other operator to achieve ( 0,0) ..

cant we used if statement also ?

- Anonymous May 18, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

b[0]= ~a[0] X a[0]
b[1]= ~a[1] X a[1]

- Anonymous May 18, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

You said to use strictly the negation operator, but you used the ternary operator: " ? : "

- Anonymous May 19, 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