NetApp Interview Question for Software Engineer / Developers






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

bitwise left to right bitmask scan, and sum those scan with right to left bitwise scan?

if someone suggest better idea? optimization may be dependent on ISA i think

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

template <typename T>
T rev_bits ( T val )
{
T ret = 0;
T n_bits = sizeof ( val ) * CHAR_BIT;

for ( unsigned i = 0; i < n_bits; ++i ) {
ret = ( ret << 1 ) | ( val & 1 ); // copy the lsb
val >>= 1; //shift right by 1 position
}

return ret;
}

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

template <typename T>
T rev_bits ( T val )
{
T ret = 0;
T n_bits = sizeof ( val ) * CHAR_BIT;

for ( unsigned i = 0; i < n_bits; ++i ) {
ret = ( ret << 1 ) | ( val & 1 ); // copy the lsb
val >>= 1; //shift right by 1 position
}

return ret;
}

- Anonymous April 12, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
-2
of 2 vote

XOR it with all 1's . Since 1 XOR 1 would result 0 and 0 XOR

- Suchin February 23, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
-2
of 2 vote

Sorry I pressed enter quite early

cont...

0 XOR 1 would result in 1

- Suchin February 23, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

i have 1101 bit

1111

lets xor it
1011
1111
-----
0100
-----

do you think this will reverse it??

- Samana Srikanth March 21, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

You wrote your XOR operands wrong! What you wanted was to XOR 1101 (and not 1011) with 1111.

Therefore, 1101 ^
1111
-----------
0010, which is the reverse.

- Karthik August 04, 2010 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 votes

its not reverse its taking one compliment.

- Anonymous August 07, 2010 | Flag


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