Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Goldman Sachs interview experience Real time questions & tips from candidates to crack your interview

SDE - Intern

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

Interview preparation journey

expand-icon
Preparation
Duration: 5 months
Topics: I covered major data structure topics like Arrays, Stacks, Queues, Linked List, Trees, Graphs, backtracking, Dynamic Programming. After reading each topic, I tried to practice maximum questions on the concerned topic from Coding Ninjas and when stuck on a question, I preferred watching solution videos provided by Coding Ninjas.
Tip
Tip

Tip 1 : It is important to practice coding consistently because it is what enables you to solve interview-questions in the stipulated time. But before this, it is even important to have a clear understanding of all the data-structures, so that they can be easily implemented as and when required to solve a problem. 
Tip 2 : They do not judge you upon the number of internships you have done or the number of projects you have made. A single,good-quality project is sufficient, provided you have in-depth knowledge about it. 
Tip 3 : Practise topic-wise questions, participate in lots of coding contests, watch lots of Youtube solutions even after you could solve a question, because you may find a different approach that is efficient than yours,

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

Tip 1 : Keep your resume short and clear. Mention your projects and internships with a brief description and year of completion. 
Tip 2 : Be very honest and figure out only those things in your resume that you really know.

Interview rounds

01
Round
Easy
Face to Face
Duration90 minutes
Interview date23 Jun 2019
Coding problem3

This was face to face interview round. The interviewer was very friendly. He started by asking tell me
something about yourself. I told him about my interest in competitive coding(since I am weak in
probability, I always mentioned competitive coding in my introduction so that the interviewer
asks me coding questions and didn’t move to the probability section).

1. Maximum value of an equation

Moderate
15m average time
85% success
0/80
Asked in companies
Goldman SachsWolters Kluwer

Given an array/list of integers, “POINTS” containing coordinates ('x', 'y') of ‘N’ points in 2D plane, sorted by x-values in non-decreasing order. You are supposed to find the maximum value of the equation ('yi + yj + |xi - xj|') where |'xi - xj'| <= ‘K’ and 0 <= 'i' < 'j' <= ‘N’ - 1.

Note:
It is guaranteed that there exists at least one pair of points in the given array/list that satisfies the constraint |'xi - xj'| <= 'K'.
Try solving now

2. Shortest Bridge

Moderate
35m average time
65% success
0/80
Asked in companies
UberWalmartFacebook

Every story has an Endgame. This is another such story.

Tony Stark and Thanos live in two different islands. Tony wants to reach Thanos's island in minimum time to save the world.

You are given a 2-D binary array of 'N' rows and 'M' columns. If the element of the array is 1 it means it has land in there else if the element is 0 means it has water in there. There are exactly two islands in this array. In one island Tony lives and in another island, Thanos lives. An island is a 4 – directionally connected component of 1’s.

For example

In the above figure, there are two islands coloured in brown and orange respectively.

Tony wants to build a bridge between these two islands. With the help of Friday Tony can build the bridge by changing 1 or more 0’s to 1’s. Size of the bridge is the number of 0’s changed to 1’s. Tony wants to minimize the size of the bridge as it minimizes time to reach Thanos.

For example

Here Bridge is marked in red colour and 1 is the minimum size of bridge possible.

Tony is busy assembling all the avengers, so he called you to solve this problem.

Try solving now

3. Beautiful City

Easy
10m average time
90% success
0/40
Asked in companies
FlipkartAmazonGoldman Sachs

Ninja decided to travel to a city. Each house in the city is connected via roads with at most two houses and forms a binary tree-like structure such that Kth level can have at most 2 ^ K houses. Now, the problem in the city is that persons from different houses at the same level can not meet without changing their level. Ninja wants to make this city beautiful by connecting houses at the same level. As Ninja is busy preparing for his travel, he gives this task to you. Can you help Ninja to make this city beautiful?

For example Figure A represents the city before making it Beautiful. Figure B represents a Beautiful city because all the houses on the same level are connected.

alt txt alt txt

Your task is to connect all the houses at the same level in the city. You are given a pointer next in the house class to do this. If there is no house on the right then set NULL to the next pointer.

Note:
1. The structure of the city is already defined. You should not change it.   

2. The address of the house at the 0’th level is already given.  

3. There is at least one house in the city.

4. You may only use constant extra space.
Try solving now
02
Round
Medium
Face to Face
Duration40 minutes
Interview date13 Jun 2019
Coding problem3

The interviewer was very friendly to me. She was praising me for every solution that I provided.

1. NINJA’S APARTMENT

Easy
15m average time
75% success
0/40
Asked in companies
InfosysGoldman Sachs

Ninja is planning to build a new apartment but he wants an apartment in the shape of a rectangle whose length is greater than the breadth of the rectangle. Also, the difference between the length and breadth should be minimum for the area of the apartment.

So your task is to print the length and breadth of the rectangle. You are provided with the ‘AREA’ of the region in which the apartment is to be built.

Example:

Suppose given ‘AREA’ is ‘6’. So, possible combinations are [ [ 1, 6 ], [ 2, 3 ], [ 3, 2 ], [ 6, 1 ] ]. We can’t choose [ 1, 6 ], [ 2, 3 ] as in this case breadth is greater than length.
So, we choose [ 3, 2 ] over [ 6, 1 ] as the difference between | 3 - 2 | < | 6 - 1 | so we return | 3, 2 | as the answer.
Note:
You are not required to print anything explicitly. It has already been taken care of. Just implement the function.
Try solving now

2. Buy and Sell Stock

Hard
0/120
Asked in companies
ZomatoInfo Edge India (Naukri.com)Expedia Group

You are Harshad Mehta’s friend. He told you the price of a particular stock for the next ‘n’ days.


You are given an array ‘prices’ which such that ‘prices[i]’ denotes the price of the stock on the ith day.


You don't want to do more than 2 transactions. Find the maximum profit that you can earn from these transactions.


Note

1. Buying a stock and then selling it is called one transaction.

2. You are not allowed to do multiple transactions at the same time. This means you have to sell the stock before buying it again. 
Example:
Input: ‘n’ = 7, ‘prices’ = [3, 3, 5, 0, 3, 1, 4].

Output: 6

Explanation: 
The maximum profit can be earned by:
Transaction 1: Buying the stock on day 4 (price 0) and then selling it on day 5 (price 3). 
Transaction 2: Buying the stock on day 6 (price 1) and then selling it on day 6 (price 4).
Total profit earned will be (3 - 0) + ( 4 - 1) = 6. 
Try solving now

3. Replace Node With Depth

Easy
20m average time
85% success
0/40
Asked in companies
AmazonMicrosoftGoldman Sachs

For a given Binary Tree of integers, replace each of its data with the depth of the tree.

Root is at depth 0, hence the root data is updated with 0. Replicate the same further going down the tree in the depth of the given tree.

Try solving now
03
Round
Easy
Face to Face
Duration50 minutes
Interview date13 Jun 2019
Coding problem2

This round was about System Design, Data Structures and Algorithms

1. System Design

Design a job scheduler. Tasks will be given as inputs with an extra parameter ‘delay’.That meaning the task has to run after this ‘delay’ time.

2. Search In Rotated Sorted Array

Moderate
30m average time
65% success
0/80
Asked in companies
Tata 1mgWalmartDelhivery

Aahad and Harshit always have fun by solving problems. Harshit took a sorted array consisting of distinct integers and rotated it clockwise by an unknown amount. For example, he took a sorted array = [1, 2, 3, 4, 5] and if he rotates it by 2, then the array becomes: [4, 5, 1, 2, 3].

After rotating a sorted array, Aahad needs to answer Q queries asked by Harshit, each of them is described by one integer Q[i]. which Harshit wanted him to search in the array. For each query, if he found it, he had to shout the index of the number, otherwise, he had to shout -1.

For each query, you have to complete the given method where 'key' denotes Q[i]. If the key exists in the array, return the index of the 'key', otherwise, return -1.

Note:

Can you solve each query in O(logN) ?
Try solving now
04
Round
Medium
Face to Face
Duration30 minutes
Interview date13 Jun 2019
Coding problem2

THIS WAS A PUZZLE BASED ROUND

1. Puzzle

Given a point on the perimeter of the circle and an interior point. Find the probability that the rectangle formed with diagonal as the line segment joining these points lies inside the circle.

Problem approach

Tip 1 : Practise from gfg
 

2. Puzzle

My wife and I recently attended a party at which there were four other married couples. Various handshakes took place. No one shook hands with oneself, nor with one's spouse, and no one shook hands with the same person more than once. After all the handshakes were over, I asked each person, including my wife, how many hands he (or she) had shaken. To my surprise, each gave a different answer. How many hands did my wife shake?

Here's your problem of the day

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

Skill covered: Programming

Suppose list1 is [2, 133, 12, 12], what is max(list1) in Python?

Choose another skill to practice
Start a Discussion
Similar interview experiences
company logo
SDE - Intern
3 rounds | 5 problems
Interviewed by Goldman Sachs
2079 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 11 problems
Interviewed by Goldman Sachs
5474 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Goldman Sachs
715 views
1 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Goldman Sachs
543 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
13501 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
12619 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
8992 views
2 comments
0 upvotes