Microsoft Interview Question for Software Engineer / Developers






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

2+find(3224);
4+find(322);
2+find(32);
2+find(3);
3+find(0);
3+0=3;
2+3=5;
2+5=7;
4+7=11;
2+11=13;

- varun April 27, 2011 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

This will just print the digits of the given number in reverse order. so output should be: 2 4 2 2 3

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

The digits will not be printed in reverse order because it is j = j%10 + find(j/10);
There is a plus sign there. The correct answer is: 3 5 7 11 13
That is (3+2) (3+2+2) (3+2+2+4) (3+2+2+4+2)

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

It will print 2 6 8 10 13.
As the control will reach to the print statement only in the last iteration when j will be calculated 2 + 0 and each time it would have increased before print.

- ysjaitawat September 20, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

How come MS asked such a simple question??
Anyways for guys with doubts, I ran the program and confirmed it.
It prints 3 5 7 11 13.
i.e.from the left it prints
the sum of 1 digit, 3
the sum of 2 digits, 3+2=5
the sum of 3 digits, 5+2=7
the sum of 4 digits, 7+4=11
the sum of 5 digits, 11+2=13

- CodeBoyS September 25, 2010 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Don't you guys think that program has to fail if main doesn't return 0.
In this program main return 13. So, I think the program fails.

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

I think this will print the same number given

- Anonymous March 15, 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