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

Analyst

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

Interview preparation journey

expand-icon
Preparation
Duration: 3 months
Topics: DSA, Java(oops), DBMS, Spring, Hibernate.
Tip
Tip

Tip 1 : Be confident and try to communicate with the interviewer. 
Tip 2 : Practice all the coding concepts.
 

Application process
Where: Naukri
Eligibility: Experience of 1yr was required in java development
Resume Tip
Resume tip

Tip 1 : Have projects related to the skills mentioned in the job description.
Tip 2 : Be perfect with the things that you put on resume. If you feel not confident enough remove them from resume.

Interview rounds

01
Round
Medium
Online Coding Test
Duration120 minutes
Interview date19 Feb 2022
Coding problem2

A time window of 3 days will be provided. But once the exam gets started you will only have 120 minutes to finish. Exam will be of 120 points. You have to score at least 80-85 to qualify for the next round. Two coding questions were given. One was based on arrays and one was based on strings. Difficulty level - medium

1. Balanced parentheses

Moderate
10m average time
90% success
0/80
Asked in companies
SalesforceAmazonMicrosoft

Given an integer ‘N’ representing the number of pairs of parentheses, Find all the possible combinations of balanced parentheses with the given number of pairs of parentheses.

Note :

Conditions for valid parentheses:
1. All open brackets must be closed by the closing brackets.

2. Open brackets must be closed in the correct order.

For Example :

()()()() is a valid parentheses.
)()()( is not a valid parentheses.
Problem approach

Tip 1 : Read the problem statement carefully before starting to code.
 

Try solving now

2. Compress the String

Moderate
32m average time
60% success
0/80
Asked in companies
MicrosoftArcesiumAmazon

Write a program to do basic string compression. For a character which is consecutively repeated more than once, replace consecutive duplicate occurrences with the count of repetitions.

Example:
If a string has 'x' repeated 5 times, replace this "xxxxx" with "x5".
The string is compressed only when the repeated character count is more than 1.
Note:
Consecutive count of every character in the input string is less than or equal to 9. You are not required to print anything. It has already been taken care of. Just implement the given function and return the compressed string.
Try solving now
02
Round
Medium
Face to Face
Duration60 minutes
Interview date9 Mar 2022
Coding problem2

Slots will be provided and one slot was chosen by me. Environment used was coderpad which will be shared with us and the interviewer. Interviewer was good and patiently cleared all my doubts.

1. Sort 0 1

Moderate
0/80
Asked in companies
Goldman SachsHCL TechnologiesMorgan Stanley

You have been given an integer array/list(ARR) of size N that contains only integers, 0 and 1. Write a function to sort this array/list. Think of a solution which scans the array/list only once and don't require use of an extra array/list.

Note:
You need to change in the given array/list itself. Hence, no need to return or print anything. 
Try solving now

2. First non repeating character

Easy
15m average time
80% success
0/40
Asked in companies
QuikrHCL TechnologiesMakeMyTrip

Ninja is now bored with numbers and is now playing with characters but hates when he gets repeated characters. Ninja is provided a string, and he wants to return the first unique character in the string.The string will contain characters only from the English alphabet set, i.e., ('A' - 'Z') and ('a' - 'z'). If there is no non-repeating character, print the first character of the string. If there is no non-repeating character, return the first character of the string.

Problem approach

This can be solved using maps or by taking extra array(storing frequencies).

Try solving now
03
Round
Medium
Face to Face
Duration60 minutes
Interview date25 Mar 2022
Coding problem3

This round was 1st interview of superday(all interviews will be conducted on same day). Each round lasts for one hour. 2 interviewers will be there and are very supportive. Coderpad will be provided for coding the problem.

1. Bubble Sort

Easy
10m average time
90% success
0/40
Asked in companies
Lenskart.comOptumWells Fargo

Bubble Sort is one of the sorting algorithms that works by repeatedly swapping the adjacent elements of the array if they are not in sorted order.

You are given an unsorted array consisting of N non-negative integers. Your task is to sort the array in non-decreasing order using the Bubble Sort algorithm.

For Example:
Bubble Sort implementation for the given array:  {6,2,8,4,10} is shown below :-

Alt test

Try solving now

2. Maximum Path Sum

Easy
0/40
Asked in companies
Goldman SachsMicrosoftOracle

You are given an n-ary tree consisting of ‘N’ nodes. Your task is to return the maximum sum of the path from the root to the leaf node.

For example:
For the given tree:

The path 1 -> 3 -> 7 produces the maximum i.e, 11.
Problem approach

I have solved this problem through recursion. I have discussed my approach with the interviewer and this discussion was good as it went on for 20minutes. He asked me all the edge case scenarios to check my code covers them or not. I have explained him all his cases and he satisfied.

Try solving now

3. Level order traversal

Easy
15m average time
85% success
0/40
Asked in companies
FacebookMcAfeeOYO

You have been given a Binary Tree of integers. You are supposed to return the level order traversal of the given tree.

For example:
For the given binary tree

Example

The level order traversal will be {1,2,3,4,5,6,7}.
Problem approach

I was asked to code this question fast as we were running out of time. I have codes this in short time as I was aware of tree traversals. I have solved this using the height concept of tree.

Try solving now
04
Round
Medium
Face to Face
Duration60 minutes
Interview date25 Mar 2022
Coding problem3

This round was taken just after 1st round(10minutes break was provided). This was taken on zoom with the help of coderpad. This interview also had 2interviewers.

1. Regular Expression Match

Easy
10m average time
90% success
0/40
Asked in companies
HCL TechnologiesAckoAmazon

Given a string ‘str’ and a string ‘pat’. The string s has some wildcard characters i.e ‘?’ and ‘*’.

If any character is a ‘?’ we can replace that character with any other character. 

If a character is a * we can replace * with any sequence of characters including the empty sequence.  

Your task is to determine if it is possible that we can make ‘str' = 'pat’ using appropriate conversions in ‘str’.

For example:
Let str = “abc?" and pat= “abcd”

We return true as ‘?’ can be replaced with ‘d’ and this makes ‘str’ and ‘pat’ same.
Problem approach

I solved it with the help of frequency. Extra array was taken and stored all the frequencies and solved it.

Try solving now

2. Best Time to Buy and Sell Stock III

Hard
0/120
Asked in companies
Samsung R&D InstituteMicrosoftSalesforce

You are Harshad Mehta’s friend. He told you the price of a particular stock for the next ‘n’ days.


You are given an array ‘prices’ which such that ‘prices[i]’ denotes the price of the stock on the ith day.


You don't want to do more than 2 transactions. Find the maximum profit that you can earn from these transactions.


Note

1. Buying a stock and then selling it is called one transaction.

2. You are not allowed to do multiple transactions at the same time. This means you have to sell the stock before buying it again. 
Example:
Input: ‘n’ = 7, ‘prices’ = [3, 3, 5, 0, 3, 1, 4].

Output: 6

Explanation: 
The maximum profit can be earned by:
Transaction 1: Buying the stock on day 4 (price 0) and then selling it on day 5 (price 3). 
Transaction 2: Buying the stock on day 6 (price 1) and then selling it on day 6 (price 4).
Total profit earned will be (3 - 0) + ( 4 - 1) = 6. 
Problem approach

Can go through above link. My solution is also similar to the one in link.

Try solving now

3. Puzzle Question

There are 9 boxes and 36 balls. Can we arrange odd number of balls in every box?

05
Round
Medium
Face to Face
Duration40 minutes
Interview date25 Mar 2022
Coding problem1

3round of superday. Only 1 interviewer was present.

1. Minimum Cost Tree From Leaf Nodes

Hard
20m average time
80% success
0/120
Asked in companies
MicrosoftGoldman Sachs

Given an array/list ‘ARR' of size ‘N’, the task is to generate a Complete Binary Tree in such a way that the sum of the non-leaf nodes is minimum, whereas values of the leaf node correspond to the array elements in an In-order Traversal of the tree and value of each non-leaf node corresponds to the product of the largest leaf value in the left sub-tree and right sub-tree.

Example:

Let's say we have an 'ARR' = {1, 2, 3, 4}, so the possible complete 
binary trees will be:
   4                                                          12                      
  /  \                                                       /  \
 1   8                                                      6    4
     / \                                                   /  \
   2   12                                                  2   3   
        /  \                                              /  \
        3   4                                             1   2
  Sum of non-leaf nodes  = 24                    Sum of non-leaf nodes = 20
  So the required answer you have to return is 20.
Try solving now
06
Round
Medium
Face to Face
Duration60 minutes
Interview date25 Mar 2022
Coding problem1

This was 4th round. It is completely based on oops and core Java. It was like rapid fire as 2interviewers kept on asking questions one after the other.

1. OOPS

All the oops concepts were asked. All the collection frameworks were asked and asked me to explain how hashmap works(algorithm). Thread questions were asked and I have no work experience in multi threading and I told the interviewer same and he didn't ask any from multi threading.

Problem approach

Tip 1 : Be thorough with all the oops concepts and examples.
Tip 2 : Don't mention any word which you don't know as your next question can be on the word that you said.

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
Analyst
1 rounds | 3 problems
Interviewed by Goldman Sachs
1890 views
0 comments
0 upvotes
company logo
Analyst
3 rounds | 8 problems
Interviewed by Goldman Sachs
1218 views
0 comments
0 upvotes
company logo
Analyst
5 rounds | 7 problems
Interviewed by Goldman Sachs
2205 views
1 comments
0 upvotes
company logo
Analyst
3 rounds | 5 problems
Interviewed by Goldman Sachs
8167 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
Analyst
3 rounds | 4 problems
Interviewed by Ernst & Young (EY)
2196 views
1 comments
0 upvotes
company logo
Analyst
2 rounds | 7 problems
Interviewed by Dunzo
875 views
0 comments
0 upvotes
company logo
Analyst
3 rounds | 9 problems
Interviewed by HCL Technologies
0 views
0 comments
0 upvotes