Goldman Sachs | Analyst | Bangalore | [Offer]

goldman sachs logo
goldman sachs
AnalystBangalore2 yearsOffer
December 19, 202124 reads

Summary

I successfully interviewed for an Analyst position at Goldman Sachs in Bangalore and received an offer. The interview process consisted of several coding and problem-solving rounds heavily focused on Data Structures & Algorithms, concluding with a combined coding and hiring manager discussion.

Full Experience

My interview journey at Goldman Sachs for the Analyst role in Bangalore began with a Coding Round. I was presented with two questions that tested my problem-solving skills, likely involving array manipulations and algorithmic thinking.

Following this, I moved to a CoderPad Round focused on DSA. Here, I had to implement a function to encode strings, for instance, transforming 'aaab' into 'a3b1', and then tackle the classic problem of finding the median of two sorted arrays, requiring an optimized approach.

The first Problem Solving Round challenged me with grouping anagrams from a list of strings and again, the 'Array Burst Problem', which I recognized as similar to the 'Remove All Adjacent Duplicates in String II' problem on LeetCode.

The second Problem Solving Round continued with DSA, where I was asked to solve the 'Subset Sum problem', specifically the 'Partition Equal Subset Sum' problem, and determine the length of the 'longest valid parentheses' in a string.

My final round was a combined Coding & Hiring Manager discussion. This round included a unique sorting problem: given an array of strings and a character, I needed to sort the array such that strings containing that character came first, followed by others, with an example like sorting 'Hello', 'Apple', 'World', 'Football' by 'U' to get 'World', 'Apple', 'Football', 'Hello'. I also faced a problem involving finding the nearest hotel to each customer on a grid, along with extensive follow-up questions on its implementation, various use cases, and how to scale the solution for a large customer base. Additionally, I was asked several behavioral questions during this segment.

All onsite rounds were conducted virtually via Zoom.

Interview Questions (8)

Q1
Encode String
Data Structures & Algorithms

Implement a function to encode a string where consecutive identical characters are replaced by the character followed by its count. For example, 'aaab' should become 'a3b1'.

Q2
Median of Two Sorted Arrays
Data Structures & Algorithms

Given two sorted arrays, find their median. The solution should be optimized, typically aiming for an O(log(min(m,n))) time complexity.

Q3
Group Anagrams
Data Structures & Algorithms

Given an array of strings, group anagrams together.

Q4
Array Burst Problem (Remove All Adjacent Duplicates in String II)
Data Structures & Algorithms

The problem is to remove all k adjacent duplicate characters from a string. When k adjacent duplicates are found, they are removed, and the remaining string is processed further. This is precisely 'Remove All Adjacent Duplicates in String II' as found on LeetCode.

Q5
Subset Sum Problem (Partition Equal Subset Sum)
Data Structures & Algorithms

Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal. This is the 'Partition Equal Subset Sum' problem.

Q6
Longest Valid Parentheses
Data Structures & Algorithms

Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.

Q7
Custom String Sort by Character
Data Structures & Algorithms

Given an array of strings and a specific character, sort the array such that strings containing the character come first, and within those, strings are sorted lexicographically. Strings not containing the character follow, also sorted lexicographically. The example shows sorting by character 'U' resulting in ['World','Apple','Football','Hello'] from ['Hello','Apple','World', 'Football'].

Q8
Nearest Hotel to Customer in Grid
System Design

Given a grid-based input representing Hotels, Customers, and Blockers, find the nearest hotel for each customer. This problem also involved follow-up discussions on implementation details, various use cases, and how to handle scaling for a large number of customers.

Preparation Tips

To prepare for this interview, I primarily focused on strengthening my foundation in Data Structures and Algorithms. I practiced a wide range of problems, particularly those involving arrays, strings, dynamic programming, and graph-like traversals, similar to problems found on platforms like LeetCode. For the system design aspects and behavioral questions, I reviewed common architectural patterns and prepared answers using the STAR method to effectively articulate my experiences.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!