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

Goldman Sachs

4 rounds | 10 Coding
problems

Journey

I started coding from 11th class in my school. I did Codechef and Leetcode questions on daily basis , participated in every possible Hackathons to develop my skills.

Application story

I got a message in my WhatsApp group about the company visiting our campus to hire a Software Analyst. As I was in my fourth year, I was sure I would apply for it. I started preparing accordingly and got selected at last.

Why selected/rejected for the role?

I got selected because of my coding and communicational skills.

Preparation

Duration: 4 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 Code Studio and when stuck on a question, I preferred watching solution videos provided by Coding Ninjas.

Tip

Tip 1: It is essential to practice coding consistently because it enables you to solve interview questions in the stipulated time. But before this, it is essential 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. It is also mandatory to clearly understand algorithms' time and space complexities because this is what you are judged upon in actual interviews: good intuition and an excellent approach to solving a problem help to crack the interview of such companies.

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. What matters to them is how efficient a learner you are, how good your problem-solving skills are, and how confident you are with your answers.

Tip 3: Practise topic-wise questions, participate in lots of coding contests, and watch lots of YouTube solutions even after you can solve a question because you may find a different approach that is more efficient than yours, and watching video solutions is always a better option than just reading the solution, as it gives a clear and deeper understanding of the logics. Also, pray hard along with your preparation.

Application process

Where: Campus

Eligibility: 7.0 CGPA

Resume tip

Tip 1: Keep your resume short and precise. Mention your projects and internships with a brief description and year of completion. Mention coding languages that are known to you or other technical skills that you are good at. Do not mention anything that you are not good at. Highlight the topics that you are good at.

Tip 2: Be very honest and figure out only the things you know in your resume. Anything extra or unknown may hurt your interview if asked by the interviewer.

01

Round

Easy

Face to Face

Duration90 minutes

Interview date16 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).

Problem approach

At first, I didn’t get any approach in my mind but then I gave the interviewer a completely brute force solution but the interviewer was not satisfied. Then I thought to do something with sorting but after making a lot of efforts I still couldn’t give an approach to the interviewer and he moved to the next question. Also, I was a little bit nervous at that time.

Problem approach

Firstly, I pretended that I am seeing this question for the first time. Then told him the sorting-based solution. After a few minutes of thinking. I simply sort both arrival time and departure time array and found the minimum number of platforms.

```
Type 1: Two Wheeler Road, It means only vehicles having two wheels can use this road.
Type 2: Four Wheeler Road, It means only vehicles having four wheels can use this road.
Type 3: Both two and four Wheeler Road, It means this road can be used by both type of vehicles.
```

```
1. Roads may form a cycle.
2. The cities do not have multiple same roads i.e all the roads are unique.
3. If every city cannot be reached, then return -1.
```

Problem approach

I simply gave him a brute force approach for this question and he was quite satisfied with that.

02

Round

Easy

Face to Face

Duration40 minutes

Interview date16 Jun 2019

Coding problem3

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

An archer is hitting the target(a circle). He fires the first shot and then the second shot. Given that his

shot was better than the second. Find the probability that the third shot that he fires is best among

the three. The three shots are independent of each other.

Problem approach

This was a probability-based question and I am weak in that. I thought of various approaches like Bayes, intersection, etc but could not find the answer to this question.

```
You must sell the stock before you buy it again.
```

Problem approach

This was the standard question and I solved it using local minima and local maxima concept and wrote code for the interviewer and he was satisfied with my code as well as approach.

```
A leaf is a node with no children.
```

```
For the given binary tree
```

```
Output: 2
The shortest path is from root node 1 to leaf node 2 which contains 2 nodes in the path. Hence, the minimum depth is 2.
```

Problem approach

I first gave him a recursion approach then he asked me to optimize it in case of a skew tree. I gave him a level order traversal based approach and he was happy with that approach.

03

Round

Easy

Face to Face

Duration50 minutes

Interview date16 Jun 2019

Coding problem2

This round was about System Design, Data Structures and Algorithms

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.

Problem approach

I gave him a solution using multithreading with proper explanation. My communication with the interviewer was very good so he got my solution very easily.

```
update(l, r, val) : Add (val + i) to arr[l + i] where, 0 <= i <= r - l.
rangeSum(l, r): return the sum of all elements in the array from index l to r, i.e., the sum of array arr[l...r].
```

```
Type 1: for update(l, r, val) operation.
Type 2: for rangeSum(l, r) operation.
Note: (1 based indexing) for the queries.
```

Problem approach

Before giving me this question, he asked me if I know about the segment tree then about the lazy propagation(I said yes). Then he asked me the above question.

I thought a lot about this question with lazy propagation and mad optimizations in that according to question but could not solve this question a few minutes were given to me for this question.

04

Round

Easy

Face to Face

Duration30 minutes

Interview date16 Jun 2019

Coding problem2

Only puzzles were asked in this round

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

At first, I could not get any approach and then I asked for a hint and then I solved this question by dividing the circle into two semicircles and considering the cases for point and finding probability in each case, and integrating them.

My wife and I recently attended a party with 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? (Learn)

Problem approach

This was a very high-level puzzle and I almost took 10 minutes to think this at the time of the interview. The answer was 1 which I found out considering the pairs and making cases. After this, I found out that the married couples shook hands in pairs 8th person shook hand with 0, 7th with 1, 6th with 2, 5th with 3. The only person left who shook hands with 4 is the wife and hence answer was one.

Here's your problem of the day

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

What does ROLLBACK do in DBMS?

Start a Discussion

Similar interview experiences

Software Analyst

4 rounds | 8 problems

Interviewed by Goldman Sachs

8265 views

1 comments

0 upvotes

Software Analyst

4 rounds | 6 problems

Interviewed by Goldman Sachs

2320 views

0 comments

0 upvotes

Software Analyst

3 rounds | 9 problems

Interviewed by Goldman Sachs

702 views

0 comments

0 upvotes

Software Analyst

3 rounds | 8 problems

Interviewed by Goldman Sachs

456 views

0 comments

0 upvotes

Companies with similar interview experiences

Software Analyst

3 rounds | 5 problems

Interviewed by Cognizant

1269 views

1 comments

0 upvotes

Software Analyst

3 rounds | 3 problems

Interviewed by Tata Consultancy Services (TCS)

812 views

1 comments

0 upvotes

Software Analyst

4 rounds | 4 problems

Interviewed by Accenture

778 views

0 comments

0 upvotes