Goldman Sachs interview experience Real time questions & tips from candidates to crack your interview

SDE - 1

Goldman Sachs
upvote
share-icon
3 rounds | 6 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 6 months
Topics: Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Practice DP based questions as much as you can. 
Tip 2 : Also, be confident during the interview about your solution. For practice, you can prefer Coding Ninjas and Geeks For Geeks.

Application process
Where: Campus
Eligibility: No criteria
Resume Tip
Resume tip

Tip 1 : Keep it short. 
Tip 2 : Mention the academic and professional projects you've done. Add your educational details properly with percentage or CGPA obtained.

Interview rounds

01
Round
Hard
Telephonic
Duration60 min
Interview date4 May 2022
Coding problem1

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Minimum Cost Path

Moderate
25m average time
70% success
0/80
Asked in companies
Goldman SachsOlaSalesforce

You have been given a matrix of ‘N’ rows and ‘M’ columns filled up with integers. Find the minimum sum that can be obtained from a path which from cell (x,y) and ends at the top left corner (1,1).

From any cell in a row, we can move to the right, down or the down right diagonal cell. So from a particular cell (row, col), we can move to the following three cells:

Down: (row+1,col)
Right: (row, col+1)
Down right diagonal: (row+1, col+1)
Problem approach

s1- I had practiced enough of DP questions.
s2- so this one looked fairly easy. Since it was a standard DP question, the same approach worked here too.

Try solving now
02
Round
Medium
Face to Face
Duration30 min
Interview date6 Jul 2022
Coding problem2

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Maximum Subarray Sum

Moderate
35m average time
81% success
0/80
Asked in companies
QualcommUberAmazon

You are given an array 'arr' of length 'n', consisting of integers.


A subarray is a contiguous segment of an array. In other words, a subarray can be formed by removing 0 or more integers from the beginning and 0 or more integers from the end of an array.


Find the sum of the subarray (including empty subarray) having maximum sum among all subarrays.


The sum of an empty subarray is 0.


Example :
Input: 'arr' = [1, 2, 7, -4, 3, 2, -10, 9, 1]

Output: 11

Explanation: The subarray yielding the maximum sum is [1, 2, 7, -4, 3, 2].
Problem approach

s1- I used Kadane algorithm here to find subarray with maximum sum.
s2- It is a standard question for interview follow DP practices.

Try solving now

2. Convert Decimal into Irreducible Fraction

Easy
25m average time
75% success
0/40
Asked in companies
OracleHCL TechnologiesMicrosoft

You are given a real number, 'NUM'. You have to represent this number as an irreducible fraction of the form A/B, where 'A' and 'B' are the numerator and denominator respectively.

A fraction is called irreducible when the greatest common divisor (GCD/HCF) of the numerator and denominator is one.

Example :
Given 'NUM' : 1.75
Irreducible fraction  can be represented as 7/4.

Note that 14/8 = 1.75 as well, but 14/8 is not an irreducible fraction.
Note :
In order to preserve precision, the real number will be given to you in the form of two strings : the integer part, and the fractional part. 

The integer part will contain not more than 8 digits, whereas the fractional part will always contain 8 digits.
Problem approach

s1- I was unable to solve this question in given time. I thought of using decimal precision and other things but not able to solve this.
s2- Given a decimal number as N,
s3- Apply co-primes other common divisor other than 1.

Try solving now
03
Round
Hard
Face to Face
Duration30 min
Interview date18 Aug 2022
Coding problem3

- Morning time
- Environment was good.
- No
- Interviewer was good

1. Time to Burn Tree

Hard
50m average time
50% success
0/120
Asked in companies
OLX GroupPhonePeMicrosoft

You have a binary tree of 'N' unique nodes and a Start node from where the tree will start to burn. Given that the Start node will always exist in the tree, your task is to print the time (in minutes) that it will take to burn the whole tree.


It is given that it takes 1 minute for the fire to travel from the burning node to its adjacent node and burn down the adjacent node.


For Example :
For the given binary tree: [1, 2, 3, -1, -1, 4, 5, -1, -1, -1, -1]
Start Node: 3

    1
   / \
  2   3
     / \
    4   5

Output: 2

Explanation :
In the zeroth minute, Node 3 will start to burn.

After one minute, Nodes (1, 4, 5) that are adjacent to 3 will burn completely.

After two minutes, the only remaining Node 2 will be burnt and there will be no nodes remaining in the binary tree. 

So, the whole tree will burn in 2 minutes.
Problem approach

s1- This was a completely different question for me. I had not seen this question before, but by drawing various cases on paper, 
s2- I could write down the solution at the end. Also, I struggled a lot during this question but did not give up. I kept thinking out loud in order to at least explain my thought process to the interviewer, if not arrive at the right solution.

Try solving now

2. Count Subsequences

Moderate
30m average time
60% success
0/80
Asked in companies
OracleDell TechnologiesHCL Technologies

You have been given an integer array/list 'ARR' of size 'N'. Your task is to return the total number of those subsequences of the array in which all the elements are equal.

A subsequence of a given array is an array generated by deleting some elements of the given array with the order of elements in the subsequence remaining the same as the order of elements in the array.

Note :
As this value might be large, print it modulo 10^9 + 7
Problem approach

s1- For this question, I simply used some mathematics and considered the frequency of each element and their contribution to subsequences. 
s2- Wrote its fully commented code with neat handwriting.

Try solving now

3. Magical Pattern

Easy
20m average time
80% success
0/40
Asked in companies
Goldman SachsReliance Jio Infocomm LtdCRED

You have been given an integer 'N'. Your task is to print the Magical Pattern(see examples) for the given 'N'.

Example :

For 'N' : 4
Pattern :
4 3 2 1 2 3 4                                                                   
3 3 2 1 2 3 3                                                                   
2 2 2 1 2 2 2                                                                   
1 1 1 1 1 1 1                                                                   
2 2 2 1 2 2 2                                                                   
3 3 2 1 2 3 3                                                                   
4 3 2 1 2 3 4
Try solving now

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

How do you remove whitespace from the start of a string?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
2 rounds | 4 problems
Interviewed by Goldman Sachs
1883 views
0 comments
0 upvotes
company logo
SDE - 1
1 rounds | 3 problems
Interviewed by Goldman Sachs
1375 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Goldman Sachs
2094 views
0 comments
0 upvotes
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Goldman Sachs
974 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
115097 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58238 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35147 views
7 comments
0 upvotes