Microsoft Interview Question for Software Engineer / Developers






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

Yes, the answer seems to be (24^2)+(23^2)+....+1 = 4900

- Chintan October 27, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

Only if this is square pyramid base.

Not if it is triangular base.

- peace November 12, 2009 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

let's say N balls in base.
so from 625 balls we need to make pyramid.
hence , n+(n-1)+....+1=625.
this equation will get solve by positive integers id if we add 25 balls from bag to those 625balls alredy given....25 is least no balls need to add to get postivi integer solution.

- ankur.nitw.cse June 25, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

structural analysis? I can construct a pyramid using just three balls. why do I need 625 balls??? What did the interview want exactly???

- noviceprog October 25, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I guess the base level has 625 balls. The second to the base level has 624, and so on so forth. So, the total number is,

(625 +1) * 625/2.

Are there any tricks here?

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

I think, we want to build a pyramid of 625 balls....So, n = 625,
how many more balls will be required ie balls from bag to build the pyramid
So, ans = 624*625/2

- Anonymous October 25, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 2 vote

Assuming its a square pyramid and base level has 25X25 balls
then the n-1 level has 24X24 balls...
so seeing this progression n^2 + (n-1)^2 + ...... 1
n(n+1)(2n+1)/6 = 25*4*51 = 5100 . So required balls are 5100-625 = xxx

- ravi October 26, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

25*26*51/6 - 625 = 4900

- 666 November 10, 2008 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Answer is n^2 ! where n = 25

Base is 25 x 25
Next layer is 24 x 24
Till you get 1 on the top

- CyberPhoenix October 26, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

625 balls are already there on the ground. (Level 0)

624 balls in Level 1, 623 in Level 2.......1 in Level 625.

Hence, the answer is 624*625/2 more balls.

- Anbe October 27, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Chintan is right

- Clayton October 27, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hey, The answer is as follows:
(25^2)+(24^2)+(23^2)+......(1^2)

- Rahul October 29, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

the n^2 series is correct....

- champ November 01, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

hi everyone i think it says we have to make pyramid out of 625 balls
so if base have 16 balls next layer havce 9 balls in square pyramid and next have 4 balls so on while caculating this number 1+4+9+16+25+49+64+81+100+121 it gives sum equal to 506 so remaining is 625-506=119

- raj November 17, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

I agree with Ravikant but I suppose there is some calculation mistake.
You need 1 + 2^2 + 3^2...12^2 balls. The sum comes out to be: 650
Since we already have 625 balls in hand, we just need to take 25 more balls from the bag.

- sandeep6883 November 19, 2008 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

This looks right.
But for level2 we can use 3 balls only instead 4 balls to hold one ball on top.
1+3+?+?+... I don't know how many balls do we need for layer 3 and so on.

- XYZ November 21, 2008 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

Here's the answer
(25^2)+(24^2)+(23^2)+......(1^2)

http://z.hubpages.com/u/109007_f520.jpg

- Cheema April 30, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

In other words (n^2)!

- Cheema April 30, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Hey pyramid is 3 d structure for a pyramind of height 1, 1 ball is required, height 2 1+3 = 4 balls required height 3 1+3+6 balls are required and so on....

A pyramid of height n requires n(n+1)(2n+1)/6 balls, find the closest value greater tha 625, which happens to be 680 for n=15...Therefore 55 more balls are required

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

Since pyramid is 3D, After the 25x25, don't you think the next one should be 23x23...
25^2 + 23^2 + ..... + 1^2
Correct me if my idea is wrong.

- KC November 11, 2009 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

wrong

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

You're all trying to leap into solving the puzzle without so much as a mention of the fact that the "structural analysis issues" part is the most important part of the question.

Without an effective answer to this second question you cannot possibly produce a meaningful answer to the first part.

Meanwhile, Microsoft, this is a lame question to throw into an programmer interview, if that's what it is. Arbitrary IQ problems will not decide who the best programmers are, real-world software development issues are what you want to see solved. There is very little point in analyzing logical thinking beyond the context of actual developmental issues.

- Viscious. June 03, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

You're all trying to leap into solving the puzzle without so much as a mention of the fact that the "structural analysis issues" part is the most important part of the question.

Without an effective answer to this second question you cannot possibly produce a meaningful answer to the first part.

Meanwhile, Microsoft, this is a lame question to throw into an programmer interview, if that's what it is. Arbitrary IQ problems will not decide who the best programmers are, real-world software development issues are what you want to see solved. There is very little point in analyzing logical thinking beyond the context of actual developmental issues.

- Viscious. June 03, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
-1
of 1 vote

We can have answer as 15*10*7*3*1=3150 balls ... so we need extra balls from = 3150-625=2525

- Saurabh October 31, 2008 | 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