Goldman Sachs | Associate | Bangalore | March 2022 [Offer]
Anonymous User
2385

First Round (Coderpad) (1 hr)

Second Round (Zoom) (1 hr)

  • Solved using stack with concept of Previous Lower Element
  • N seats arranged in a line, whenever a new person comes, he/she should sit such that overall distance is maximum between any two sitting persons. Any person can leave or take the seat. complete two fns one for assigningSeat, one for RemovingSeat.
    Example: For 5 seats
    Initial arrangement: 0 0 0 0 0
    1st person enter: 1 0 0 0 0
    2nd person enter: 1 0 0 0 1
    3rd person enter: 1 0 1 0 1

Third Round (Zoom) (1 hr)

  • Return any peak in an array of integers, peak is when a number is bigger than its neighbours.
  • For a tree print left view, bottom view and right view elements.

Fourth Round (Zoom) (1 hr).

  • You receive 7 billion ages one by one from a data stream, and at the end find median. (Hint: numbers given are age)
  • Possible ways to optimize time taken by a query for SQL DB

Fifth Round (Zoom) (>1 hr)

Sixth Round (Zoom)(1 hour)

  • Why GS?
  • Project discussion
  • Min depth of tree. (All possible ways were asked)
  • Given array of integers, return number of ways to form a target number (say 100) by putting below operators in between consecutive integers: "+", "-", ".", here operator "." means concatenation of two numbers.
Comments (7)