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

SDE - 2

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

Interview preparation journey

expand-icon
Journey
I have been preparing for a job switch for the past month (starting February 2022). I applied on a couple of career websites and received calls from a few for online assessments. Goldman Sachs HR contacted me around March 1–2, 2022, and scheduled an online interview for the same day. After I passed the online assessment, they scheduled three rounds of interviews for the following week — all held on the same day. I later received a call from HR informing me that they had decided to proceed with another candidate.
Application story
The HR contacted me via phone and collected basic details about my education, current company, and years of experience. An online assessment was scheduled afterwards, which consisted of two DSA questions to be solved in 1.5 hours. I solved both successfully, with all test cases passing. The HR then scheduled three rounds of interviews for the following week, all to be held on the same day. I attended all three rounds, but there was no fourth (HR/Managerial) round, as I was rejected after the third.
Why selected/rejected for the role?
I was rejected because I was underprepared for the interview. Since I had just started studying and giving interviews, there was a lack of practice and understanding of system design, design patterns, and related concepts.
Preparation
Duration: 1 month
Topics: Data Structures (linked lists, trees, graphs, etc.), Algorithms (binary search, sliding window, two pointers, etc.), Databases (normalization, indexing, etc.), Operating Systems (multithreading, multiprocessing, race conditions, etc.), Programming Languages (Java, C++)
Tip
Tip

Tip 1: Goldman Sachs emphasizes problem-solving skills, so focus on algorithms such as Sliding Window, Two Pointers, Prefix Sum, Linked Lists, Stacks and Queues, Trees and Graphs, Dynamic Programming, and Binary Search.

Tip 2: SDE-2 roles require strong system design knowledge. Therefore, I focused on High-Level System Design, Low-Level Design, Databases and Caching, Concurrency, and Distributed Systems.

Tip 3: Since I have experience with Java and Spring, I also prepared topics such as Multithreading and Concurrency, JVM Internals (Garbage Collection, Memory Model), Spring Boot and Microservices, and Database Optimization (Indexing, Transactions, Query Optimization).

Application process
Where: Naukri
Eligibility: Tier 1 college, (Salary Package: 45-60 LPA)
Resume Tip
Resume tip

Tip 1: Include relevant keywords from the job description (Java, Spring, REST, Microservices, AWS, System Design, etc.).

Tip 2: Add a Projects section and have a hands-on understanding of the projects mentioned.

Interview rounds

01
Round
Medium
Online Coding Test
Duration90 minutes
Interview date3 Mar 2022
Coding problem2

Timing: Anytime during the day; the test was active for 3 days.
Environment: It could be taken at home on a personal laptop with the camera on.

1. Packet Management

Given a stream of packets, you can process only 10 packets per second. However, more than 10 packets may arrive within a second. Suggest an appropriate data structure or algorithm to handle this scenario.

Problem approach

We can use the Sliding Window approach here. There are two things to keep in mind: first, how to maintain a 1-second time interval, and second, ensuring that the window size does not exceed 10. While processing the packets, we need to save the start time of each interval. That is, if a packet arrives within the 1-second time interval from the start time and the count is less than 10, we process it; otherwise, if the count exceeds 10, we ignore it.

2. Maximum Rocks Collection

Moderate
0/80
Asked in company
Goldman Sachs

You are an explorer on an expedition to collect rare rocks. You are given a 2D grid of size m x n, where each cell grid[i][j] represents a city containing a certain number of these rocks.


Your journey must start at the bottom-left corner (grid[m-1][0]) and end at the top-right corner (grid[0][n-1]). From any city (i, j), you are only allowed to move to the city directly up (i-1, j) or to the city directly right (i, j+1). You cannot move outside the grid boundaries.


The total number of rocks you collect is the sum of the rocks in every city you visit, including the starting and ending cities. Your task is to find a path that maximizes the total number of rocks collected.


Return the maximum number of rocks you can collect.


Problem approach

We create a 2D DP array of the same size as the input grid.

Base Case: The value at (0, n-1) is the same as grid[0][n-1], since there’s no movement beyond this point.

Filling the DP Table: Start from (0, n-1) and move backwards toward (m-1, 0) using the transition formula.

Try solving now
02
Round
Medium
Video Call
Duration60 minutes
Interview date7 Mar 2022
Coding problem1

It was an online video call interview. The interviewer and I joined the call via a Google Meet invite link. He asked me questions about my résumé, the projects I had worked on, and a few Java basics. Then we moved on to a coding question, which I had to solve in CoderPad.

1. 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

Tip 1: Get hands-on experience with data structures such as min heap, max heap, etc.
Tip 2: Have a strong command of your programming language to effectively use its internal libraries.

Try solving now
03
Round
Easy
Video Call
Duration60 minutes
Interview date7 Mar 2022
Coding problem1

The interview was scheduled from 3 PM to 4 PM. The interviewer was very friendly and began by discussing basic details about my current job and the projects I’m contributing to. He asked about any optimizations I had implemented in my project, which I was able to answer well, as I had optimized one of the most frequently occurring database-related issues. We then moved on to database concepts such as indexing, normalization, SQL, and NoSQL. The interview concluded with a simple problem-solving round where he gave me a coding question.

1. Trapping Rain Water

Moderate
15m average time
80% success
0/80
Asked in companies
HCL TechnologiesCiti BankAtlassian

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

Gave 3 approaches:
1. Brute Force (O(n²)): Check left and right max for each bar.
2. Dynamic Programming (O(n) time, O(n) space): Precompute left and right max arrays.
3. Two-Pointer Technique (O(n) time, O(1) space): Efficiently calculate trapped water using two pointers.

Try solving now
04
Round
Easy
Video Call
Duration60 minutes
Interview date8 Mar 2022
Coding problem1

The interview was held from 4:30 to 5:30 PM. It was a System Design round. The interviewer first introduced himself and explained what was expected of me in the role. We then quickly moved on to designing a movie ticket booking system.

1. System Design

Design a system similar to BookMyShow.

Problem approach

Tip 1: Get well-versed with common design patterns such as Decorator, Adapter, Factory, and Proxy.

Tip 2: Have a good understanding of networking concepts, load balancing, SQL vs NoSQL, and caching.

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
SDE - 1
5 rounds | 8 problems
Interviewed by Goldman Sachs
31596 views
7 comments
0 upvotes
company logo
Analyst
3 rounds | 5 problems
Interviewed by Goldman Sachs
8167 views
0 comments
0 upvotes
company logo
SDE - 2
4 rounds | 8 problems
Interviewed by Goldman Sachs
4253 views
0 comments
0 upvotes
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Goldman Sachs
974 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 2
5 rounds | 12 problems
Interviewed by Walmart
29892 views
8 comments
0 upvotes
company logo
SDE - 2
3 rounds | 4 problems
Interviewed by HashedIn
9698 views
0 comments
0 upvotes
company logo
SDE - 2
3 rounds | 5 problems
Interviewed by Amazon
6765 views
1 comments
0 upvotes