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

Software Developer

Goldman Sachs
upvote
share-icon
5 rounds | 10 Coding problems

Interview preparation journey

expand-icon
Preparation
Duration: 1 month
Topics: Dynamic Programming, Trees, Graphs, Linear Data structures, Strings, System Design, OOPS
Tip
Tip

Tip 1 : If you have done thorough competitive Programming and computer science fundamentals. All these faang interviews will be very easy.
Tip 2 : Prepare enough so that the moment the interviewer throws the problem you solve it in your mind instantly. If you solve it on spot then it can result in a serious waste of time.
Tip 3 : Always explain the brute force approach first then go for optimized solution in a gradual way

Application process
Where: Referral
Resume Tip
Resume tip

Tip 1 : Always have relevant points and make a 1-page resume.
Tip 2 : Don't leave a lot of white spaces.

Interview rounds

01
Round
Easy
Online Coding Test
Duration180 minutes
Interview date15 Sep 2021
Coding problem2

For some reason the online test was very easy. I was able solve both problems in 10 mins. But interviews were really good.

1. Ninja’s Circular Array

Moderate
0/80
Asked in companies
MicrosoftGoldman Sachs

Ninja has a circular array ‘Nums’ containing ‘N’ positive integers. An array is called circular if we consider the first element as next of the last element.

Ninja wants you to find the first greater number to the right of each element in the array, if there is no greater element to the right of an element, then output -1 for this element.

Example :
If N = 5 and the array is: { 1, 6, 4, 3, 5 }

We will return { 6, -1, 5, 5, 6 }
because 6 is the first element to the right of 1 that is greater than 1,
no element exists that is greater than 6,
5 is the first element to the right of 4 that is greater than 4,
5 is the first element to the right of 3 that is greater than 3,
6 is the first element to the circular-right of 5 that is greater than 5.
Try solving now

2. Josephus

Moderate
30m average time
70% success
0/80
Asked in companies
IntuitCultfitAmazon

‘N’ people are standing in a circle numbered from ‘1’ to ‘N’ in clockwise order. First, the person numbered 1 will proceed in a clockwise direction and will skip K-1 persons including itself and will kill a Kth person. Now (K+1)th person from 1 will start and will kill the Kth person from itself.

You have to find the position of the last person surviving with respect to initial numbering.

Note:
A person can also kill himself.
Try solving now
02
Round
Hard
Face to Face
Duration60 minutes
Interview date27 Nov 2021
Coding problem2

1. Median Marks

Hard
45m average time
25% success
0/120
Asked in company
Goldman Sachs

There are 'N' students in a class, where 'N is odd'. The 'ith' student wants their marks to be in the range 'L[i]' to 'R[i]' (both inclusive). The teacher can give a total of at most 'X' marks to students. To show that the result is good, the teacher wants the median marks to be as large as possible.

Return the maximum median marks the teacher can obtain provided they optimally distribute the 'X' marks among students satisfying the ranges.

To find the median of a sequence of odd length, you have to sort it and take the element in the middle position after sorting.

It is guaranteed that the teacher has enough marks to give, i.e. L[1]+L[2]+.....+L[N] <= 'X'.

For Example:-
Let 'N' = 3, 'X' = 13, 'L' = [2, 3, 5], 'R' = [4, 5, 7].
We can assign 2 marks to the first student, 5 marks to the second student, and 5 marks to the third student.
So the median mark is 5 which is the maximum possible. 
Try solving now

2. Kth Element of Two Sorted Arrays

Hard
10m average time
90% success
0/120
Asked in companies
AmazonGoldman SachsAdobe

Ninja wants to serve food to needy people. So, he bought Ladoos from a sweet shop and placed them on plates. There can be any number of Ladoos present in a plate.

Plates containing Ladoos are placed in two rows. Each row is sorted in increasing order by the number of Ladoos in a plate.

For example :
‘ROW1’ :  [2, 5, 8, 17] and  ‘ROW2’ :  [1, 4, 8, 13, 20]

Now people come one by one in a line to take plates of Ladoos from Ninja. Ninja picks the two plates in front, one from each row and gives that plate to people in which the number of ladoos is the smallest (if both plates contain equal numbers of ladoos then he serves any plate from the two plates) and places the other plate back to its position.

For Example :
If ‘ROW1’ is [2, 5, 8, 17] and ‘ROW2’ is [1, 4, 8, 13, 20], then Ninja picks the first plates from each rows, plate containing 2 ladoos from ‘ROW1’ and a plate containing 1 ladoo from ‘ROW2’. 
Then he gives the plate with 1 Ladoo to the first person in line and places the other plate back to its position.

Can you tell how many ladoos the ‘K'th’ person will get?

Problem approach

Nested Binary Search

Try solving now
03
Round
Medium
Face to Face
Duration60 minutes
Interview date27 Nov 2021
Coding problem2

There were 2 interviewers both asked problems on Binary Search and Linear Data Structure.

1. Weighted Job Scheduling

Moderate
15m average time
85% success
0/80
Asked in companies
AmazonIntuitPhonePe

You are given 'N' jobs with their start time 'Start', end time 'End' and profit 'Profit'. You need to tell the maximum profit you can obtain by performing these jobs such that no two jobs overlap.

Note:
The start time of one job can be equal to the end time of another.
Problem approach

Binary Search

Try solving now

2. Next Greater Element

Easy
10m average time
90% success
0/40
Asked in companies
MicrosoftAmazonDisney + Hotstar

You have been given an array/list ‘ARR’ consisting of ‘N’ positive integers. Your task is to return the Next Greater Element(NGE) for every element.

The Next Greater Element for an element ‘X’ is the first element on the right side of ‘X’ in the array 'ARR', which is greater than ‘X’. If no such element exists to the right of ‘X’, then return -1.

For example:
For the given array 'ARR' = [7, 12, 1, 20]

The next greater element for 7 is 12.
The next greater element for 12 is 20. 
The next greater element for 1 is 20. 
There is no greater element for 20 on the right side.

So, the output is [12, 20, 20, -1].
Try solving now
04
Round
Hard
Face to Face
Duration60 minutes
Interview date27 Nov 2021
Coding problem2

2 interviewers and 1 problem by both of them

1. Boyer Moore Algorithm For Pattern Searching

Moderate
30m average time
70% success
0/80
Asked in companies
Goldman SachsAmdocsGoogle inc

You are given a string ‘text’ and a string ‘pattern’, your task is to find all occurrences of pattern in the string ‘text’ and return an array of indexes of all those occurrences. You may assume that the length of ‘text’ is always greater than the length of ‘pattern’.

For example :
Let text = “this is a good place to have a good start”, pattern = “good” so you have to return {10, 31} because at 10 and 31 index pattern is present in the text.
Note :
If there is no such index in the text then just return an array containing -1.
Try solving now

2. Longest Common Subsequence

Moderate
39m average time
0/80
Asked in companies
PayPalSliceShareChat

Given two strings, 'S' and 'T' with lengths 'M' and 'N', find the length of the 'Longest Common Subsequence'.

For a string 'str'(per se) of length K, the subsequences are the strings containing characters in the same relative order as they are present in 'str,' but not necessarily contiguous. Subsequences contain all the strings of length varying from 0 to K.

Example :
Subsequences of string "abc" are:  ""(empty string), a, b, c, ab, bc, ac, abc.
Try solving now
05
Round
Medium
Face to Face
Duration60 minutes
Interview date27 Nov 2021
Coding problem2

2 interviewers asking about project and design questions

1. Project Questions

Describe the functionality of your project.

What is one thing that you want to change in your project?

Problem approach

Tip 1 : Thoroughly revise your projects
Tip 2 : Know the ins-n-outs of your projects
Tip 3 : Know about tools regularly used in other firms.

2. System Design

Design a File generator. Give a JSON data in the database and design a file generator that will convert JSON to pdf, txt, docx and other file format.

Problem approach

Tip 1 : Design a flexible system so that it can sustain extensions and modifications in the future.
Tip 2 : Know OOPS concepts
Tip 3 : Inheritance and class high-level designing.

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
5 rounds | 8 problems
Interviewed by Goldman Sachs
31596 views
7 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Goldman Sachs
1903 views
0 comments
0 upvotes
company logo
Analyst
3 rounds | 5 problems
Interviewed by Goldman Sachs
8167 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
Software Developer
5 rounds | 14 problems
Interviewed by Microsoft
4029 views
1 comments
0 upvotes
company logo
Software Developer
6 rounds | 12 problems
Interviewed by SAP Labs
2912 views
0 comments
0 upvotes
company logo
Software Developer
3 rounds | 3 problems
Interviewed by Amazon
1271 views
0 comments
0 upvotes