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

Python Developer

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

Interview preparation journey

expand-icon
Journey
The interview experience was such a great process of gaining knowledge and learning. Take good care of your resume, as questions will arise based on that.
Application story
It was during campus placements, and we had different rounds. All the final-year students had a chance to attend the first round. They tested all our basics on data structures and OOP concepts.
Why selected/rejected for the role?
I did not get selected for this role because of some flaws on my side. For instance, I got a bit scared during the coding round and messed up. I did not provide solutions with less time complexity; instead, I explained them the harder way.
Preparation
Duration: 5-6 months
Topics: Data Structures, Aptitude, OOPS, Machine Learning, Statistics, Competitive Programming
Tip
Tip

Tip 1: Go through the questions on coding platforms for coding.
Tip 2: Be patient and calm. This process is time and energy-consuming, but I am sure you can get through it.

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

Tip 1: Your projects should be related to the current emerging topics.
Tip 2: Be prepared with the areas of interest that you included in your resume.

Interview rounds

01
Round
Medium
Online Coding Interview
Duration120 minutes
Interview date18 Jan 2022
Coding problem2

Online test

1. Fastest Horse

Moderate
25m average time
75% success
0/80
Asked in companies
Goldman SachsChegg Inc.Nagarro Software

There are ‘N’ horses running in ‘N’ different lanes numbered from 1 to ‘N’. You are given an array “FINISHTIME” containing ‘N’ integers where “FINISHTIME[i]” represents the time taken by the ith horse to complete the race.

You are now given ‘Q’ queries, each containing two integers each, ‘L’ and ‘R’. For each query, return the time taken by the fastest horse amongst the horses with numbers {L, L + 1, L + 2, …., R - 1, R} to complete the race.

Note:
The fastest horse is the one that takes the minimum time to finish the race. 
Try solving now

2. Count Triplets

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

You have been given an integer ‘X’ and a non-decreasing sorted doubly linked list with distinct nodes.

Your task is to return the number of triplets in the list that sum up to the value ‘X’.

Try solving now
02
Round
Medium
Face to Face
Duration75 minutes
Interview date20 Jan 2022
Coding problem4

Face to Face interview

1. Rearrange Linked List

Moderate
22m average time
80% success
0/80
Asked in companies
AmazonIntuitOptum

You have been given a singly Linked List in the form of 'L1' -> 'L2' -> 'L3' -> ... 'Ln'. Your task is to rearrange the nodes of this list to make it in the form of 'L1' -> 'Ln' -> 'L2' -> 'Ln-1' and so on. You are not allowed to alter the data of the nodes of the given linked list.

For example:
If the given linked list is 1 -> 2 -> 3 -> 4 -> 5 -> NULL.

Then rearrange it into 1 -> 5 -> 2 -> 4 -> 3 -> NULL. 
Try solving now

2. Implement Trie

Hard
41m average time
0/120
Asked in companies
UberAmazonWalmart

Implement Trie Data Structure to support these operations:

insert(word) - To insert a string "word" in Trie
search(word) - To check if string "word" is present in Trie or not.
startsWith(word) - To check if there is any string in the Trie that starts with the given prefix string "word".


Three type of queries denote these operations:

Type 1: To insert a string "word" in Trie.
1 word

Type 2: To check if the string "word" is present in Trie or not.
2 word

Type 3: To check if there is any string in the Trie that starts with the given prefix string "word".
3 word


Try solving now

3. Add Two Numbers As Linked Lists ll

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

You have been given two singly Linked Lists, where each of them represents a positive number without any leading zeros.

Your task is to add these two numbers and print the summation in the form of a linked list.

Example:
If the first linked list is 1 -> 2 -> 3 -> 4 -> 5 -> NULL and the second linked list is 4 -> 5 -> NULL.

The two numbers represented by these two lists are 12345 and 45, respectively. So, adding these two numbers gives 12390. 

So, the linked list representation of this number is 1 -> 2 -> 3 -> 9 -> 0 -> NULL.
Problem approach

Following are the steps:
1) Calculate the sizes of the given two linked lists.
2) If the sizes are the same, then calculate the sum using recursion. Hold all nodes in the recursion call stack until the rightmost node, calculate the sum of the rightmost nodes, and forward the carry to the left side.
3) If the sizes are not the same, then follow the below steps:
....a) Calculate the difference in sizes of the two linked lists. Let the difference be 'diff'.
....b) Move 'diff' nodes ahead in the bigger linked list. Now use step 2 to calculate the sum of the smaller list and the right sub-list (of the same size) of the larger list. Also, store the carry of this sum.
....c) Calculate the sum of the carry (calculated in the previous step) with the remaining left sub-list of the larger list. Nodes of this sum are added at the beginning of the sum list obtained in the previous step.

Try solving now

4. Count vowels, consonants, and spaces

Easy
10m average time
90% success
0/40
Asked in companies
Goldman SachsSamsungKaleidofin

Given a string, write a program to count the number of vowels, consonants, and spaces in that string.

EXAMPLE :
Input: ‘N’= 25, ‘s’ =”Take u forward is Awesome”
Output: 10 11 4
Try solving now
03
Round
Hard
Face to Face
Duration90 minutes
Interview date22 Jan 2022
Coding problem3

1. Insertion in AVL Tree

Moderate
20m average time
80% success
0/80
Asked in companies
Goldman SachsQuikrPhonePe

Ninja has to implement an ‘AVL_TREE’ from scratch.

He is given ‘N’ values, representing the values of nodes to be inserted. Ninja has to insert these values into the ‘AVL_TREE’ and return its root after inserting all the nodes.

Note: An ‘AVL_TREE’ is a self-balancing Binary Search Tree (BST) where the difference between heights of left and right subtrees cannot be more than one for all nodes.

For example:

Try solving now

2. Longest Consecutive Sequence

Moderate
40m average time
70% success
0/80
Asked in companies
WalmartOptumAmazon

You are given an unsorted array/list 'ARR' of 'N' integers. Your task is to return the length of the longest consecutive sequence.

The consecutive sequence is in the form ['NUM', 'NUM' + 1, 'NUM' + 2, ..., 'NUM' + L] where 'NUM' is the starting integer of the sequence and 'L' + 1 is the length of the sequence.

Note:

If there are any duplicates in the given array we will count only one of them in the consecutive sequence.
For example-
For the given 'ARR' [9,5,4,9,10,10,6].

Output = 3
The longest consecutive sequence is [4,5,6].
Follow Up:
Can you solve this in O(N) time and O(N) space complexity?
Try solving now

3. Puzzle Question

There are 4 persons - say A, B, C, and D. Each can hold either 6, 7, or 8 balls in hand. If one has 6 or 8, the person speaks the truth. Otherwise, if a person holds 7 balls, he/she lies. When asked about the total number of balls, the replies from A, B, C, and D are: A - 25, B - 26, C - 27, D - 28. Only one is telling the truth. Who is telling the truth? What is the actual number of balls?

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
Software Engineer Intern
2 rounds | 3 problems
Interviewed by Goldman Sachs
1202 views
0 comments
0 upvotes
company logo
New Analyst
5 rounds | 6 problems
Interviewed by Goldman Sachs
1907 views
1 comments
0 upvotes
company logo
SDE - 1
1 rounds | 3 problems
Interviewed by Goldman Sachs
1374 views
0 comments
0 upvotes
company logo
Software Engineer
2 rounds | 4 problems
Interviewed by Goldman Sachs
906 views
0 comments
0 upvotes