Today I had my coderpad round with GS. We dived straight into the code. This was the First question: https://leetcode.com/discuss/interview-question/1837422/Goldman-Sachs-or-Coderpad-or-First-non-repeating-character
Second question:
Variant of: https://leetcode.com/problems/minimum-path-sum/
A 2D array 'arr' was given with m rows and n columns. arr[i][j] represents the amount of gold present in the cell. I needed to find the maximum gold that can be collected while going from the bottom-left cell (arr[m-1][0]) to the top-right cell (arr[0][n-1]).
We can only travel in the top and the right direction.
Input:
[[0,0,0,0,5]]
[[0,1,1,1,0]]
[[2,0,0,0,0]]
Output:
10
Used a dp array and travelled from the destination to the source while maintaining the maximum of the two cells from the top and the right direction.
Third question:
https://leetcode.com/discuss/interview-question/1837497/Goldman-Sachs-or-Coderpad-or-Find-the-largest-tree
Hope it helps!