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

SDE - Intern

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

Interview preparation journey

expand-icon
Preparation
Duration: 2 months
Topics: Data Structures, Pointers, Linked List, Trees, Graphs, Dynamic Programming, Back Tracking, React JS.
Tip
Tip

Tip 1: Practise leetcode questions as much as possible.
Tip 2: Try to come up with Optimised solution always. 
Tip 3: Try using c++ for the online assessments.

Application process
Where: Hackerrank
Eligibility: No standing arrears.
Resume Tip
Resume tip

Tip 1: Keep it to one side
Tip 2: Only add the things necessary for the role that you're applying for.
Tip 3: Don't lie in the resume and add projects related to the role.
Tip 4: Add any volunteering work that you did.

Interview rounds

01
Round
Easy
Online Coding Test
Duration90 Minutes
Interview date15 Oct 2022
Coding problem2

It was an online assessment. I was given 2 questions to complete.

1. Search In Rotated Sorted Array

Moderate
30m average time
65% success
0/80
Asked in companies
QuikrTata 1mgWalmart

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) ?
Problem approach

Step 1: int right(0) initializing right as zero and left(0) initializing left as zero
taking sum of all the element and assigning it to right
Step 2: running a loop through the whole array from left to right (i=0 --> n-1)
Step 3: at every step to find the if right sum = left sum we subtract current element from the array i.e. nums[i]
hence right-=nums[i]
Step 4: by implementing step 3 we check if right is equal to left now or not
if(left == right) return i;
Step 5: and if nothing is returned this step will be executed. the subtracted element from right is added to left
left += nums[i] loop is closed here
Step 6: return -1 out of loop implying no pivot found
by implementing these step we are trying to see at which element right sum becomes equal to left sum and we return index of that element.

Try solving now

2. Pairs with difference K

Moderate
0/80
Asked in companies
AckoAccentureGoldman Sachs

You are given with an array of integers and an integer K. You have to find and print the count of all such pairs which have difference K.

Note: Take absolute difference between the elements of the array.

Problem approach

Using HashMap

First we will create map for counting frequencies of each element in the array.

Now we have 2 cases over here as
-->a) if k == 0 it means we need to count frequency of the same element by using map.get(i) method.
-->b) we need to take counter approach for every element by adding k everytime and check whether that element is present in map or not.

Instead of iterating through array, we will iterate through map.keySet() for getting unique elements.

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

What is 3 + 2 * 4 based on operator precedence?

Choose another skill to practice
Similar interview experiences
company logo
SDE - Intern
3 rounds | 5 problems
Interviewed by Goldman Sachs
2211 views
0 comments
0 upvotes
company logo
SDE - Intern
3 rounds | 11 problems
Interviewed by Goldman Sachs
5624 views
0 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Goldman Sachs
808 views
1 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Goldman Sachs
633 views
0 comments
0 upvotes
Companies with similar interview experiences
company logo
SDE - Intern
3 rounds | 6 problems
Interviewed by Amazon
14185 views
4 comments
0 upvotes
company logo
SDE - Intern
4 rounds | 7 problems
Interviewed by Microsoft
13563 views
1 comments
0 upvotes
company logo
SDE - Intern
2 rounds | 4 problems
Interviewed by Amazon
9378 views
2 comments
0 upvotes