Cisco Systems Interview Question


Country: India
Interview Type: In-Person




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

It's not possible to get the exact value back. >>> is not a reversible operation. In other words, there are multiple inputs such that applying >>> 2 to them would give you 24. 99, 98, 97, and 96 all yield 24. So if all you know is that you got an answer of 24, you won't be able to determine which of those you started with.

- eugene.yarovoi December 23, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

Very simple :
Java code is as follows :
public static void main(String[] args) {
int x = 99;
int y = 24;

int k = x ^ y;
System.out.println(" XOR ::"+k);
System.out.println(" To get 99 :: "+(k^24));
}

- Subrata Saha April 07, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

It works. Thanks!

- zhishengzhou1984 June 30, 2015 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Very simple :
Java code is as follows :
public static void main(String[] args) {
int x = 99;
int y = 24;

int k = x ^ y;
System.out.println(" XOR ::"+k);
System.out.println(" To get 99 :: "+(k^24));
}

- saha.subrata@gmail.com April 07, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

While shifting right by 2 , you have to store the bits you are going to loose after this operation. You have 24 , do left shift operation by 2 , you will get some value , OR it by the bits you have lost. you will get the answer.

- Anonymous March 27, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Cisco gives hike once in 2-3 years.

New-Joinees only get hike after 2-3 years, so take 100% hike at the time of joining .. . otherwise don't cry after joining. :)

- Simple April 25, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Cisco gives hike once in 2-3 years.

New-Joinees only get hike after 2-3 years, so take 100% hike at the time of joining .. . otherwise don't cry after joining. :)

- Simple April 25, 2014 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

Any Problem with this?

int n= 99999;
int x = n>>>1;
int y = x << 1;
int lsb = n & 1;
int number = y | lsb;

- Sanal Kumar K March 03, 2013 | 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