GeeksforGeeks » Interview Questions

Goldman Sachs Interview Question for Software Engineer/Developer (Fresher)

(7 posts)

Tags:

  1. Sameer
    guest
    Posted 1 year ago #

    You have 4218 no of balls. put 1 balls at top layer 3 at 2nd top layer then 6 and then 10 ... Continue in this way. How many layers are possible.?

  2. amansach
    guest
    Posted 1 year ago #

    for n =1, value is 1 , nth term = (n-1) th term + n for n >1

  3. amansach
    guest
    Posted 1 year ago #

    f(1) = 1 , f(n) = f(n-1) + n , so summation of f(n) = 4218

    f(n) + f(n-1) + f(n-2) + + 10 + 6 + 3 + 1 = 4218
    n + f(n-1) + f(n-2) + n - 1 + f(n-3) + n - 2 + ...................+ 10 + 6 + 3 + 1 = 4218

  4. amansach
    guest
    Posted 1 year ago #

    i am not sure how to solve it ..

    wrote a program and answer is 91

  5. Amit Jaspal
    guest
    Posted 1 year ago #

    a(n)=(n*(n+1))/2

  6. kp101090
    Member
    Posted 1 year ago #

    Answer is 28

    Number of balls at i'th level is "num ==> i*(i+1)/2" ...
    (If we generate this series this series is called series of triangular numbers)
    (i.e. series 1,3,6,10,15,... is called series of triangular numbers)
    then sum of balls before (& including) i'th level = i*(i+1)*(i+2)/6
    (This is the standard expression for the summation of Triangular numbers)

    Pure maths follows now:
    We must have :
    i*(i+1)*(i+2)/6 <= 4218
    i^3 + 3*(i^2) + 2*i - (4218*6) = 0 (Considering equality only to make it clearer)
    Solving this 3rd degree equation we get "i = 28.37"
    We need greatest integer number less than this...(remember '<' sign that we dropped above)
    which is nothing but 28.

  7. hamburg113
    Member
    Posted 5 months ago #

    Hi

    You can find this info by using search box in the top of website with some keywords related before posting questions.


Reply

You must log in to post.

RSS feed for this topic