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

Summer Analyst Intern

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

Interview preparation journey

expand-icon
Preparation
Duration: 2 months
Topics: Data Structures and algorithms, Greedy, Dynamic Programming, Graph, OOPS, Operating System
Tip
Tip

Tip 1 : Practice more and more competitive programming questions and take part in contests.
Tip 2 : Do at least 1 good project and you must be confident to elaborate it. You must know in detail about some basic questions about your project, for example: which data structure you have used? what is your contribution to that project if it is done in the group?. 
Tip 3 : Solve puzzles from various platforms for example- geeksForGeeks puzzle section

Application process
Where: Other
Eligibility: open to all engineering students
Resume Tip
Resume tip

Tip 1 : Add your Achievements. for example- any hackathon that you have won. 
Tip 2 : Do not put false things on your resume.

Interview rounds

01
Round
Easy
Video Call
Duration20 minutes
Interview date25 Mar 2022
Coding problem1

Timing: 11:00 AM
Interviewer was good.

1. Find Permutation

Moderate
25m average time
65% success
0/80
Asked in companies
Goldman SachsOlaFacebook

You are given an integer ‘N’. You need to find an array of size 2*N that satisfies the following two conditions.

1. All numbers from 1 to N should appear exactly twice in the array.

2. The distance between the second occurrence and the first occurrence of any number should exactly be equal to the value of that number.

The distance between two numbers at indices ‘i’ and ‘j’ is defined as (j-i-1) where i < j.

If no such array exists, then you should return an empty array.

For example :
For N = 3 one valid array is [3,1,2,1,3,2].
Problem approach

The solution to the problem:
step 1 : make a pair vector of {val, freq} using the map
step 2 : sort pair vector based on greater freq at first.
step 3 : iterate over all pairs and keep track of the count (c) of the all previous pair to it and add (freq* c) to your answer.
By following the above steps you will get the minimum possible sum.

Try solving now
02
Round
Easy
Video Call
Duration25 Minutes
Interview date25 Mar 2022
Coding problem1

Timing: 12:01 PM
First, they asked me to describe my project. 
Then, they asked about what is your contribution in this project.
then, what data structure you have used. 
Then, they come to the coding problem.

The interviewer was good.

1. Binary Linked List To Integer

Easy
0/40
Asked in companies
MicrosoftFacebookQualcomm

You are given a singly linked list containing ‘n’ nodes, where every node in the linked list contains a pointer “next” which points to the next node in the list and having values either 0 or 1. Your task is to return the decimal representation of the given number in the linked list.

For Example:
n = 4, list: 1 -> 0 -> 1 -> 0.

Now in this example, the value in the linked list is 1010, which is 10 in Decimal.
Hence the answer is 10.
Problem approach

step 1 : Initialize ans number to be equal to head value: ans = head.val.

step 2 : Iterate over the linked list starting from the head: 
while head.next:
The current value is head.next.val. 
Update the ans by shifting it by one to the left and adding the current value using logical OR: 
ans = (ans<< 1) | head.next.val.

step 3 : Return ans.

Try solving now
03
Round
Medium
Video Call
Duration35 minutes
Interview date25 Mar 2022
Coding problem1

Timing: 1:30 PM
First, they ask about me.
Then, they come to a puzzle and told me to give a solution with a time complexity of O(1).
The interviewer was good and helpful.

1. Puzzle

There are N red balls and M blue balls in a bag. Any 2 balls are removed at each step and are replaced with a new ball on the basis of the following conditions:

1. If they are of the same color, then they are replaced by a red ball.
2. If they are of different colors, then they are replaced with a blue ball.

Find the last ball to remain after the entire process in O(1).

Problem approach

Solution:
step1: if two 2 balls removed are the same color
RR:
remaining ball in bag : N-2 + 1 , M => N-1 , M ------ eq (1)
BB: 
remaining ball in bag: N +1, M-2 => N+1 , M-2 ------- eq (2)
step2: if two balls removed are different colors:
RB or BR:
remaining ball in bag: N-1, M-1+1 => N-1 , M ----- eq(3)

from the above 3 eq in which eq(1) and eq(2) are the same, we can conclude:
if M is even then, our result will be a red ball.
if M is odd then, our result will be a blue ball.

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
Summer Analyst Intern
2 rounds | 2 problems
Interviewed by Goldman Sachs
2784 views
1 comments
0 upvotes
company logo
Summer Analyst Intern
3 rounds | 7 problems
Interviewed by Goldman Sachs
859 views
0 comments
0 upvotes
company logo
Python Developer
3 rounds | 9 problems
Interviewed by Goldman Sachs
700 views
0 comments
0 upvotes
company logo
Summer Analyst Intern
4 rounds | 8 problems
Interviewed by Goldman Sachs
162 views
0 comments
0 upvotes