Goldman Sachs College Campus FTE

They asked 20 questions among 3 were about coding -two medium in 30 min and one tough in 45 min and remaining 17 ques were about aptitude and probability

  1. code was about- On given array return max value (max value = indexelement) in which we can rotate the array as many times we want from both ends -
    ex-
    A[] = {8,3,1,2}
    Output: 29
    Explanation: Above the configuration
    possible by rotating elements are
    3 1 2 8 here sum is 3
    0+11+22+83 = 29
    1 2 8 3 here sum is 1
    0+21+82+33 = 27
    2 8 3 1 here sum is 2
    0+81+32+13 = 17
    8 3 1 2 here sum is 8
    0+31+12+2*3 = 11

  2. code was about - On given string we suppose to fill each char of string in square and if string size is not perfect square then put '.' in reamining block of square. Then rotate the square by 90 degree and print all the char row wise as string
    ex- I/P- "abcdefg"
    O/P- "cf.be.adg"
    explanation -

    a b c
    d e f
    g . .

    c f .
    b c.
    a d g

  3. code was about (NLP) - On a Given String with parenthesis need to create a tree and return all node value (from root to leaf) with largest height.
    ex - (Root(S)(NP(PRP my)(NN dog))(VP(VBZ like)S(VP(VBG eating)(NP(NN sausage))))))

Comments (2)