How was your Goldman Sachs exam?

All the new coders here there is a very good link of tutorial posted by karan on quora:


I also got abort in 3 cases and have absolutely no idea what went wrong (Index surely were in bounds)

Yeah even I tried to use this formula. Wasted time trying in Python 3 and then I realised the pre-written code in IDE was wrong. It was expecting the function to return array of integers whereas we needed to display just the number of possible combinations :triumph:.

There was one test case no 3 that was not working for me in problem number one


Yeah even I faced the same issue

Answer to What is the number of ways to distribute 8 identical balls in 3 different boxes, none being empty? by Anuj Mishra

Read 2nd paragraph

what was the corner case in problem.Any Idea?

Plus sign??
5 -10 7
-7 -12 -12
5 5 6
In this senario 41 is answer instead of 36.
then why plus sign??

I know the platform but really hate the interface . also unaware how to solve in practice llike cf and others…

any idea what the test case 3 was for the first question? also i was getting timeout in the second question, i was caculating the prime factors and then applying the stars and bars second formula.

For first problem you should consider the case when (n<=1).
And for 2nd problem you may be use sieve algorithm for fast calculation of prime factor.

what should be the output when n<=1? there was nothing mentioned in the post? was -1 to be returned?

Learn to learn and modify.

1 Like

That case n<=1 was incorrect in test data itself imo.

1 Like

Google beggars formula.

1 Like

Nope 3 test cases shows “aborted”.
Still no idea why. :disappointed:
It was not wrong answer definitely.

1 Like

Same here. One possibility is test cases were incorrect or Main function had issues.
Because n<=1 case was also incorrect in 1st problem.

1 Like

I got AC.
return input_list;

IMO n=0 should return given vector itself.
And n=1 should return vector having one element = 1


Same here. Cuz test cases were incorrect.