Goldman Sachs Interview Experience | Off-Campus
I gave my off-campus interview at Goldman Sachs for the Analyst post (SDE1).
Experience: (1+ year)
Screening round: 2 coding questions (1.5 hours total time)
Round 1(1 hour):
- Search in a rotated sorted array
- max sum path in matrix starting from (row-1, 0) to (0, col-1)
- Design HashMap
Round 2 (1 hour):
- Design HashSet
- s distinct colors of socks are given each with frequency n. You have to pick k recent pairs of socks in a minimum number of polls.
- Given a string, find a string that is just greater in lexicographic ordering than the given string.
E.g. blackba -> blakabc Dcba -> Not possible
- Deep dive into one of the projects
Round 3 (1 hour):
- The Shortest distance from a source node to destination node in a directed and unweighted graph
- Each nut has its corresponding sized bolt in the other set. Arrange the nuts and bolts to align according to their sizes without comparing a nut to a nut or a bolt to a bolt
SNm = {N(4),N(9),N(1).....} SBm = {B(9),B(1),B(4).....} - Given an array of n elements find a set of k numbers that sum to zero
E.g. k=3, (print all sets of k numbers) arr= [1, 1, 0, -1, 2, -2] Ans: (1, 0, -1), (1, 0, -1), (0, -2, 2)
- Given a set of 5 blue balls and 5 red balls, arrange them in two containers such that the chances of picking up a red ball is highest
Round 4 (1 hour):
- Deep dive into 1 of the projects
- Count the number of rotations in an array that is rotated, sorted, and contains duplicate elements. (Expected O(log n))
Input: [3, 3, 4, 5, 6, 1, 1, 2]; Output: 3
- Difference between LinkedHashmap and HashMap
- Design of linked hashmap
- (As I had one of the internships done in graph algorithms the interviewer asked me) The traveling salesman problem. I told him that it is NP-complete but there exists a polynomial-time 2-approximate algorithm which is Minimum Spanning Tree. He then asked me the algorithm for MST.
Round 5 (Hiring Manager):
- Tell me about yourself
- Deep dive into many projects and the architecture that I used in the previous company
- Told me about the hierarchy in GS and different kinds of teams and tech stack
- What are your strengths and weaknesses?
- Why GS?
Result: Selected


