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

SDE - 1

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

Interview preparation journey

expand-icon
Preparation
Duration: 3.5 Months
Topics: Arrays, linked list, Data Structures, Pointers, OOPS, System Design, Algorithms, Dynamic Programming
Tip
Tip

Tip 1 : Practice aptitude questions
Tip 2 : Practice coding questions
Tip 3 : Read books

Application process
Where: Naukri
Eligibility: 2+ years experience
Resume Tip
Resume tip

Tip 1 : Have atleast 3 great project
Tip 2 : Write only what you know and prepare well

Interview rounds

01
Round
Easy
Online Coding Test
Duration90 Minutes
Interview date10 Mar 2022
Coding problem3

coding questions were asked

1. Online Stock Span

Moderate
30m average time
70% success
0/80
Asked in companies
WalmartAmazonGoldman Sachs

Ninja Coin is a famous crypto-currency in Ninja Land. Ninja has an array/list ‘PRICE’ of size ’N’ where ‘PRICE[i]’ is the price of a Ninja Coin on an ith day in INR, where 0 <= 'i' <= N-1.

The span of the Ninja Coin price on an ith day is defined as the maximum number of consecutive days (starting from the ith day and going backward) for which the price of a Ninja Coin was less than or equal to its price at ith day.

Your task is to return an array/list of size ‘N’ where the ith integer is the span of Ninja Coin price on an ith day. Go through the example for more clarity.

For Example :
Let the price of Ninja Coin for 5 consecutive days is [4, 2, 3, 3, 7].

Then the span of Ninja Coin on the 0th day is 1 because we cannot move backward from day 0.

The span of Ninja Coin on the 1st day is 1 because the price on day 0 is 4 which is greater than 2, so the only day 1 is counted.

The span of Ninja Coin on the 2nd day is 2 because the price on day 2 and day 1 is less than or equal to 3 and then on day 0 price is 4 which is greater than 3, so we count day 2 and day 1.

The span of Ninja Coin on the 3rd day is 3 because the price on day 3, day 2, and day 1 is less than or equal to 3, and on day 0 price is 4 which is greater than 3, so we count day 3, day 2, and day 1.

The span of Ninja Coin on the 4th day is 5 because its value is higher than all previous days values.    

Thus you should return an array/list [1, 1, 2, 3, 5].
Try solving now

2. Shortest path in an unweighted graph

Moderate
25m average time
70% success
0/80
Asked in companies
AmazonMicrosoftGoldman Sachs

The city of Ninjaland is analogous to the unweighted graph. The city has ‘N’ houses numbered from 1 to ‘N’ respectively and are connected by M bidirectional roads. If a road is connecting two houses ‘X’ and ‘Y’ which means you can go from ‘X’ to ‘Y’ or ‘Y’ to ‘X’. It is guaranteed that you can reach any house from any other house via some combination of roads. Two houses are directly connected by at max one road.

A path between house ‘S’ to house ‘T’ is defined as a sequence of vertices from ‘S’ to ‘T’. Where starting house is ‘S’ and the ending house is ‘T’ and there is a road connecting two consecutive houses. Basically, the path looks like this: (S , h1 , h2 , h3 , ... T). you have to find the shortest path from ‘S’ to ‘T’.

For example
In the below map of Ninjaland let say you want to go from S=1 to T=8, the shortest path is (1, 3, 8). You can also go from S=1 to T=8  via (1, 2, 5, 8)  or (1, 4, 6, 7, 8) but these paths are not shortest.

altImage

Try solving now

3. Sorted Linked List to Balanced BST

Moderate
25m average time
70% success
0/80
Asked in companies
AppleRed HatMicrosoft

You have been given a singly linked list in which nodes are present in increasing order. Your task is to construct a Balanced Binary Search Tree with the same data elements as the given Linked List.

A Balanced BST is defined as a BST in which the height of two subtrees of every node differs no more than 1.

Try solving now

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
2 rounds | 4 problems
Interviewed by Goldman Sachs
1882 views
0 comments
0 upvotes
company logo
SDE - 1
2 rounds | 3 problems
Interviewed by Goldman Sachs
859 views
0 comments
0 upvotes
company logo
SDE - 1
3 rounds | 5 problems
Interviewed by Goldman Sachs
2094 views
0 comments
0 upvotes
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Goldman Sachs
973 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - 1
5 rounds | 12 problems
Interviewed by Amazon
115097 views
24 comments
0 upvotes
company logo
SDE - 1
4 rounds | 5 problems
Interviewed by Microsoft
58238 views
5 comments
0 upvotes
company logo
SDE - 1
3 rounds | 7 problems
Interviewed by Amazon
35147 views
7 comments
0 upvotes