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

5 rounds | 8 Coding
problems

Journey

Before applying for this role, I was working at Expedia and Arcesium as a software developer. I worked for many years in both the companies and I got to learn alot by working there as a software developer. As soon as I saw a job opening for Goldmann Sachs, I started preparing DSA again. I went through previous interview experiences and started giving mock interviews so as to master coding skills once again.

Application story

I saw a job opening on the company's website. I reached out to a lot of people on LinkedIn for referral. One of the employees agreed to give me referral. So, I applied through his referral and then they called me for the interview rounds. The interviews went on smoothly and I got selected.

Why selected/rejected for the role?

I was selected because of my never-give up attitude. I had a different way of approaching questions. I understood the question properly first and then thought of a solution for the question. In this manner, I gave the answers clearly and confidently.

Preparation

Duration: 6 Months

Topics: Data Structures, Algorithms, Database, System Design, Operating Systems

Tip

Practice DP based questions as much as you can. Also, be confident during the interview about your solution. For practice, you can prefer Coding Ninjas and Geeks For Geeks.

Application process

Where: Referral

Eligibility:

Resume tip

Keep it short. Mention the academic and professional projects you've done. Add your educational details properly with percentage or CGPA obtained.

01

Round

Easy

Telephonic

Duration60 minutes

Interview date29 Apr 2019

Coding problem1

The interviewer called my via phone and simultaneously provided me a link where I had to write the code for a given problem. It was scheduled at 12:30 pm, so timing was not an issue. It was a standard DP question involving a 2D matrix. The question was easy and I was able to code it within given time.

Given a cost matrix cost[][] and a position (m, n) in cost[][], write a function that returns cost of minimum cost path to reach (m, n) from (0, 0). Each cell of the matrix represents a cost to traverse through that cell. Total cost of a path to reach (m, n) is sum of all the costs on that path (including both source and destination). You can only traverse down, right and diagonally lower cells...

View more

Problem approach

- I had practiced enough of DP questions, so this one looked fairly easy. Since it was a standard DP question, the same approach worked here too.

02

Round

Easy

Face to Face

Duration60 minutes

Interview date5 May 2019

Coding problem2

The interviewer asked me two coding questions in this round.

Write an efficient program to find the sum of contiguous subarray within a one-dimensional array of numbers which has the largest sum.

Problem approach

- I used Kadane algorithm here to find subarray with maximum sum. It is a standard question for interview.

Given a decimal number as N, the task is to convert N into an equivalent irreducible fraction.

An irreducible fraction is a fraction in which numerator and denominator are co-primes i.e., they have no other common divisor other than 1.

Examples:

Input: N = 4.50

Output: 9/2

Explanation:

9/2 in decimal is wri...

View more

Problem approach

- I was unable to solve this question in given time. I thought of using decimal precision and other things but not able to solve this.

03

Round

Easy

Face to Face

Duration60 minutes

Interview date20 May 2019

Coding problem2

This was on-site round at their Bangalore office. The interviewer was friendly and helpful. The interview held inside a conference room.

Given an integer N as input, the task is to print the Magical Pattern as given below:

N . . 3 2 1 2 3 . . N

. . . . . . . . . . .

3 3 3 3 2 1 2 3 3 3 3

2 2 2 2 2 1 2 2 2 2 2

1 1 1 1 1 1 1 1 1 1 1

2 2 2 2 2 1 2 2 2 2 2

3 3 3 3 2 1 2 3 3 3 3

. . . . . . . . . . .

N . . 3 2 1 2 3 . . N

Examples:

<...

View more

Problem approach

- I simply use for and while loops with some conditions and printed the required pattern.

View more

Problem approach

- As I have to find a number of connected components in an undirected graph so I simply use
**Depth-first search**to solve this question by visiting each element and mapped it to the number of component in which it belongs. At last, I print the vertices of each component.

04

Round

Easy

Face to Face

Duration60 minutes

Interview date20 May 2019

Coding problem2

This was the next round of the onsite interviews. Took place in the same conference room as that of the previous round.

Given a node, how long will it take to burn a whole binary tree?

Problem approach

- This was a completely different question for me. I had not seen this question before, but by drawing various cases on paper, I could write down the solution at the end. Also, I struggled a lot during this question but did not give up. I kept thinking out loud in order to at least explain my thought process to the interviewer, if not arrive at the right solution.

Given an array A[] consisting of N integers, the task is to find the total number of subsequence which contain only one distinct number repeated throughout the subsequence.

Examples:

Input: A[] = {1, 2, 1, 5, 2}

Output: 7

Explanation:

Subsequences {1}, {2}, {1}, {5}, {2}, {1, 1} and {2, 2} satisfy the required c...

View more

Problem approach

- For this question, I simply used some mathematics and considered the frequency of each element and their contribution to subsequences. Wrote its fully commented code with neat handwriting.

05

Round

Easy

Face to Face

Duration60 minutes

Interview date20 May 2019

Coding problem1

This was the third round of the onsite interview.

Given two strings str1 and str2 and below operations that can performed on str1. Find minimum number of edits (operations) required to convert āstr1ā into āstr2ā.

Insert

Remove

Replace

All of the above operations are of equal cost.

Input: str1 = "geek", str2 = "gesek"

Output: 1

We can convert str1 into str2 by inserting a 's'.<...

View more

Problem approach

- Firstly I gave the interviewer, a recursive solution then he asked me to reduce complexity as it was exponential of recursive solution so I gave him a top-down DP solution.

Here's your problem of the day

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

Which of these collection class has the ability to grow dynamically?

Similar interview experiences

SDE - 1

2 rounds | 4 problems

Interviewed by Goldman Sachs

1027 views

0 comments

0 upvotes

SDE - 1

1 rounds | 3 problems

Interviewed by Goldman Sachs

741 views

0 comments

0 upvotes

SDE - 1

2 rounds | 3 problems

Interviewed by Goldman Sachs

477 views

0 comments

0 upvotes

SDE - 1

3 rounds | 5 problems

Interviewed by Goldman Sachs

1032 views

0 comments

0 upvotes

Companies with similar interview experiences

SDE - 1

5 rounds | 12 problems

Interviewed by Amazon

102452 views

24 comments

0 upvotes

SDE - 1

4 rounds | 5 problems

Interviewed by Microsoft

48217 views

5 comments

0 upvotes

SDE - 1

3 rounds | 7 problems

Interviewed by Amazon

30197 views

6 comments

0 upvotes

Comment Removed