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

Analyst

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

Interview preparation journey

expand-icon
Preparation
Duration: 8 Months
Topics: C++, Data Structures and Algorithms, Projects, Core Subjects
Tip
Tip

Tip 1 : Be prepared with whatever mentioned in your Resume
Tip 2 : Be prepared with your Projects

Application process
Where: Referral
Eligibility: 1 year of Industry Experience
Resume Tip
Resume tip

Tip 1 : Describe the Technologies, on which you have worked
Tip 2 : Provide Leetcode or other Platform links

Interview rounds

01
Round
Medium
Online Coding Test
Duration120 Minutes
Interview date3 Jan 2022
Coding problem2

There were 2 Questions which are of medium Level

1. Duplicate Characters

Easy
25m average time
70% success
0/40
Asked in companies
ThalesGoldman SachsHCL INFOSYSTEM

You are given a string ‘S’ of length ‘N’. You have to return all the characters in the string that are duplicated and their frequency.

Example:-
N = 5
S = ‘GEEK’

ANSWER:- The answer should be [(‘E’,2)] because ‘E’ is the only character that is duplicated and has frequency 2.
Problem approach

I had solved this question using stack

Try solving now

2. NINJA'S BIRTHDAY PARTY

Moderate
30m average time
70% success
0/80
Asked in companies
Dell TechnologiesGoldman SachsNykaa

Ninja and his friends went to a restaurant on the occasion of Ninja’s birthday. There he was offered by his friends to do some task, if he wins, he would not have to pay a single penny, his friends would pay instead of him. But if he loses, he would have to pay the whole bill. The task was that he was given a bar of chocolate and was asked to break it into single squares.

The rules were as follows:

1.Parts of the chocolate may be broken along the vertical and horizontal lines as indicated by the broken lines in the picture.

2.Each break of a part of the chocolate is charged a cost expressed by a positive integer.

3.This cost does not depend on the size of the part that is being broken but only depends on the line the break goes along.

4.Denoting the costs of breaking along consecutive vertical lines with x1, x2, ..., xm-1 and along horizontal lines with y1, y2, ..., yn-1.

5.The cost of breaking the whole bar into single squares is the sum of the successive breaks.

cakePic

Now, Ninja has to break the chocolate in such a way that results in minimum cost. So your task is to find the minimum cost.

Problem approach

This Question is pretty easy if guess the logic, one line greedy Approach

Try solving now
02
Round
Medium
Telephonic
Duration60 minutes
Interview date10 Jan 2022
Coding problem2

2 DSA Questions were asked after basic Introduction

1. Encode The String

Easy
10m average time
80% success
0/40
Asked in companies
Goldman SachsDeloitteMahindra Comviva

You are given a string ‘S’ of length ‘N’. The string can be encoded using the following rules:

1) If the ‘i-th’ character is a vowel, change it to the next character in the alphabetical sequence. For example, the next character of ‘o’ is ‘p’.

2) If the ‘i-th’ character is a consonant, change it to the previous character in the alphabetical sequence. For example, the previous character of ‘h’ is ‘g’.

3) The next character of ‘z’ is ‘a’.

4) The previous character of ‘a’ is ‘z’.

Find the encoded string.

Example :
‘N’ = 4, ‘S’ = “code”

Character ‘c’ gets changed to ‘b’.
Character ‘o’ gets changed to ‘p’.
Character ‘d’ gets changed to ‘c’.
Character ‘e’ gets changed to ‘f’.

Encoded string = “bpcf”
Try solving now

2. Median of Two Sorted Arrays

Hard
25m average time
65% success
0/120
Asked in companies
GrabMicrosoftWells Fargo

Given two sorted arrays 'a' and 'b' of size 'n' and 'm' respectively.


Find the median of the two sorted arrays.


Median is defined as the middle value of a sorted list of numbers. In case the length of list is even, median is the average of the two middle elements.


The expected time complexity is O(min(logn, logm)), where 'n' and 'm' are the sizes of arrays 'a' and 'b', respectively, and the expected space complexity is O(1).


Example:
Input: 'a' = [2, 4, 6] and 'b' = [1, 3, 5]

Output: 3.5

Explanation: The array after merging 'a' and 'b' will be { 1, 2, 3, 4, 5, 6 }. Here two medians are 3 and 4. So the median will be the average of 3 and 4, which is 3.5.
Problem approach

I had given simple sorting solution and also given binary search optimized Approach

Try solving now
03
Round
Medium
Face to Face
Duration60 Minutes
Interview date14 Jan 2022
Coding problem2

2 Coding Problems were asked in this round

1. Group Anagrams Together

Moderate
0/80
Asked in companies
Dell TechnologiesPayPalArcesium

You have been given an array/list of strings 'STR_LIST'. You are supposed to return the strings as groups of anagrams such that strings belonging to a particular group are anagrams of one another.

Note :
An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase. We can generalize this in string processing by saying that an anagram of a string is another string with the same quantity of each character in it, in any order.
Example:
{ “abc”, “ged”, “dge”, “bac” } 
In the above example the array should be divided into 2 groups. The first group consists of { “abc”, “bac” } and the second group consists of { “ged”, “dge” }.
Problem approach

This Question is tough, I easily solved this Question using Hashmap and sorting Approach

Try solving now

2. Remove Duplicates From String

Moderate
25m average time
0/80
Asked in companies
SquadstackAmazonGoldman Sachs

You are given a string (STR) of length N, consisting of only the lower case English alphabet.

Your task is to remove all the duplicate occurrences of characters in the string.

For Example:
If the given string is:
abcadeecfb

Then after deleting all duplicate occurrences, the string looks like this:
abcdef
Try solving now
04
Round
Easy
Face to Face
Duration60 Minutes
Interview date14 Sep 2022
Coding problem2

2 Medium level Coding Questions were asked

1. Subset Sum

Easy
0/40
Asked in companies
AmazonGoldman SachsSAP Labs

You are given an array 'nums' of ‘n’ integers.


Return all subset sums of 'nums' in a non-decreasing order.


Note:
Here subset sum means sum of all elements of a subset of 'nums'. A subset of 'nums' is an array formed by removing some (possibly zero or all) elements of 'nums'.


For example
Input: 'nums' = [1,2]

Output: 0 1 2 3

Explanation:
Following are the subset sums:
0 (by considering empty subset)
1 
2
1+2 = 3
So, subset sum are [0,1,2,3].
Try solving now

2. Longest Valid Parentheses

Moderate
10m average time
90% success
0/80
Asked in companies
IntuitCIS - Cyber InfrastructureUber

You are given a string ‘S’ containing only the characters ‘)’ and ‘(‘. You need to find the length of the longest valid i.e. well-formed parentheses substring.

For example:
Let the given string be “(()())((”.

Here the valid parentheses substrings are: “()”, “()” and “(()())”. Out of these the longest valid string is “(()())” which has a length 6.
Problem approach

I told him 2 Approaches 1 is using Stack and other is using simple loops to calculate window size.

Try solving now
05
Round
Easy
HR Round
Duration50 Minutes
Interview date18 Jan 2022
Coding problem1

One Easy Coding question, some behavioural Questions and deep discussion about previous company Projects was happened.

1. Basic HR Questions

Who is your role model?

What are your plans?

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
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
2206 views
1 comments
0 upvotes
company logo
Analyst
6 rounds | 12 problems
Interviewed by Goldman Sachs
0 views
0 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)
2197 views
1 comments
0 upvotes
company logo
Analyst
2 rounds | 7 problems
Interviewed by Dunzo
876 views
0 comments
0 upvotes
company logo
Analyst
3 rounds | 9 problems
Interviewed by HCL Technologies
0 views
0 comments
0 upvotes