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

SDE - 2

Goldman Sachs
upvote
share-icon
4 rounds | 8 Coding problems

Interview preparation journey

expand-icon
Journey
I got a referral to Goldman Sachs from one of my friends and have a very long interview process. I was able to crack the interviews. The interview experience was great and smooth.
Application story
I got a referral from one of my friends working at Goldman Sachs. Then HR connected with me to explain the process and also ask me to apply to their portal. I got the test link.
Why selected/rejected for the role?
I got selected for the role but I didn't join as the offered package was less than the other hand's offer.
Preparation
Duration: 3 months
Topics: Data Structures, Algorithms, OOPS, OS, Java, Springboot
Tip
Tip

Tip 1 : Practice DSA questions for all topics - LinkedList, stacks, queues etc
Tip 2 : Have a proper analysis of the DSA question before attempting it.
Tip 3 : Learn System Design

Application process
Where: Referral
Eligibility: 7 CGPA
Resume Tip
Resume tip

Tip 1 : Resume should be 1 page
Tip 2 : All the achievements and important things should be highlighted.

Interview rounds

01
Round
Easy
Online Coding Interview
Duration120 minutes
Interview date1 Jun 2022
Coding problem2

We were given 2 days of window to complete a test of 2 hour.

1. Decode String

Easy
15m average time
85% success
0/40
Asked in companies
DelhiveryPaytm (One97 Communications Limited)Ola

You have been given an encoded string. Your task is to decode it back to the original string.

- An encoded string will be of the form <count>[encoded_string], where the 'encoded_string' inside the square brackets is being repeated exactly 'count' times. Note that 'count' is guaranteed to be a positive integer and can be greater than 9.
- There are no extra white spaces and square brackets are well-formed.
For example -
Input: 2[a]
“a” is encoded 2 times, hence the decoded string will be "aa".

Input: 3[a2[b]]
“b” is encoded 2 times, which decodes as 3[abb]. Now, "abb" is encoded 3 times, hence decoded string will be "abbabbabb". 
Try solving now

2. Number Game

Hard
10m average time
90% success
0/120
Asked in companies
SamsungGoldman SachsWipro

Alice and Bob have invented a new game to play. The rules are as follows -

First, they get a set of ‘N’ distinct integers. And then they take turns to make the following moves. During each move, either Alice or Bob (the player whose turn is the current) can choose two distinct integers ‘X’ and ‘Y’ from the set, such that the set doesn't contain their absolute difference |X - Y|. Then this player adds integer |X - Y| to the set (so, the size of the set increases by one).

If the current player has no valid move, he (or she) loses the game. The question is who will finally win the game if both players play optimally. Remember that Alice always moves first.

Try solving now
02
Round
Easy
Video Call
Duration60 minutes
Interview date9 Jun 2022
Coding problem2

2 coding questions were asked

1. Trapping Rain Water

Moderate
15m average time
80% success
0/80
Asked in companies
Paytm (One97 Communications Limited)MyntraPaytm (One97 Communications Limited)

You have been given a long type array/list 'arr’ of size 'n’.


It represents an elevation map wherein 'arr[i]’ denotes the elevation of the 'ith' bar.



Note :
The width of each bar is the same and is equal to 1.
Example:
Input: ‘n’ = 6, ‘arr’ = [3, 0, 0, 2, 0, 4].

Output: 10

Explanation: Refer to the image for better comprehension:

Alt Text

Note :
You don't need to print anything. It has already been taken care of. Just implement the given function.
Problem approach

Starting with O(n square) approach then optimised to O(n)

Try solving now

2. Maximum of All Subarrays of Size K

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

You are given an array “A” of N integers. Your task is to find the maximum element in all K sized contiguous subarrays from left to right.

For Example:
If A = [3, 2, 3], and K = 2.
Then max of [3, 2] = 3 and max of [2, 3] = 3
So, the answer will be [3, 3]

If A = [3, 2, 3, 5, 1, 7] and K = 3.
Then max of [3, 2, 3] = 3 
Then max of [2, 3, 5] = 5 
Then max of [3, 5, 1] = 5 
Then max of [5, 1, 7] = 7 
So  the answer will be [3, 5, 5, 7]
Follow Up :
Can you solve the problem in O(N) time complexity and O(K) space complexity?
Problem approach

Solved using heap

Try solving now
03
Round
Easy
Video Call
Duration60 minutes
Interview date27 Jun 2022
Coding problem2

Basic java design patterns and multithreading questions

1. System Design

Singleton pattern - build a class that returns DB connection

Problem approach

Tip 1 : Used a singleton pattern
Tip 2 : Make it thread-safe.
Tip 3 : Write code in java

2. Java Questions

What is multi threading?

What do you mean by exception handling?

Problem approach

Tip 1 : Prepare basics of multi-threading
Tip 2 : Basics of Exception handling is a must
Tip 3 : In-depth knowledge of java keywords

04
Round
Easy
Video Call
Duration60 minutes
Interview date27 Jun 2022
Coding problem2

It was a mix of all things. Coding question, Basics of AWS, java related questions, all things were asked

1. Intersection of Two Linked Lists

Easy
25m average time
73% success
0/40
Asked in companies
MicrosoftAdobeApple

You are given two Singly Linked Lists of integers, which may have an intersection point.

Your task is to return the first intersection node. If there is no intersection, return NULL.


Example:-
The Linked Lists, where a1, a2, c1, c2, c3 is the first linked list and b1, b2, b3, c1, c2, c3 is the second linked list, merging at node c1.

alt.txt

Try solving now

2. Java Collections

  1. What are Java Collections?
  2. What is the difference between Set, List, and Map interfaces?
  3. What is the difference between ArrayList and LinkedList?
  4. How does the HashSet ensure uniqueness of elements?
  5. Explain the Comparable and Comparator interfaces.

Here's your problem of the day

Solving this problem will increase your chance to get selected in this company

Skill covered: Programming

Which traversal uses a queue as its primary data structure?

Choose another skill to practice
Similar interview experiences
company logo
SDE - 1
5 rounds | 8 problems
Interviewed by Goldman Sachs
29396 views
7 comments
0 upvotes
company logo
SDE - 1
3 rounds | 6 problems
Interviewed by Goldman Sachs
1492 views
0 comments
0 upvotes
company logo
Analyst
3 rounds | 5 problems
Interviewed by Goldman Sachs
7107 views
0 comments
0 upvotes
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Goldman Sachs
583 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 2
5 rounds | 12 problems
Interviewed by Walmart
27117 views
8 comments
0 upvotes
company logo
SDE - 2
3 rounds | 4 problems
Interviewed by HashedIn
8885 views
0 comments
0 upvotes
company logo
SDE - 2
3 rounds | 5 problems
Interviewed by Amazon
5940 views
0 comments
0 upvotes