Goldman Sachs Interview Experience | 1 year experienced
The recruiter contacted me over LinkedIn, and sent me the link for the written test.
Round 1
-
There is a shop with old-style cash registers. the price of each item is typed manually. Given a list of items and their correct prices, compare the prices to those entered when each item was sold. Determine the number of errors in selling price.
E.g.
Input: products = ['eggs','milk','cheese'] productPrices = [2.89,3.29,5.79] productsSold = ['eggs','eggs','milk','cheese'] sellingPrices = [2.89,2.99,3.29,5.97] Output: errors = 2
Round 2 (Coderpad):
-
Given a log file as some array of strings in a specified format where each line begins with an IP address. You have to find the most frequently occurring IP.
-
Given a 2-D String array of student-marks find the student with the highest average and output his average score. If the average is in decimals, floor it down to the nearest integer.
E.g.
Input: [{"Bob","87"}, {"Mike", "35"}, {"Bob", "52"}, {"Jason","35"}, {"Mike", "55"}, {"Jessica", "99"}] Output: 99
Basic questions on HashMap working, as both the above question solutions, I did use HashMap.
Round 3 (Technical): Taken by 2 senior members having 6-8 years exp. working with GS.
- Given a custom HashMap, in which only equals() method was overridden, he made small changes in the code, and I was expected to give the number of entries in HashMap after each change.
- Asked the internal working of HashMap in detail.
- When the new objects are created by JVM?
- Minimum steps to reach the target by a Knight
- Stock Buy Sell to Maximize Profit
- A code was given that has the method and variable overriding implemented in it with all possible scenarios, and I was expected to give the output in all possible scenarios. (If you have a complete understanding of how overriding works in java, you can answer them).
- How overriding works for methods and variables?
- What are immutable classes?
Round 4 (Technical): Taken by 2 senior members with 10-12 years exp working with GS.
- Discussed project and the technologies used, based on resume.
- String class and where they are stored in memory.
- Additions in java 8 in interfaces (about default keyword), and diamond problem, and how it is resolved when default keyword is used.
- How HashMap works, and the contract it follows.
- What are immutable classes, I was asked to implement a custom immutable class? When I implemented it, multiple cross-questions were asked, to check if I have a clear understanding of each part of the code, I wrote or not.
- Singleton Class, I started from a very basic form of Singleton Class and was asked in each implementation if there is some way in which I can break the Singleton Pattern. Then I wrote the code with double-check locking in singleton class.
- Volatile Keyword, and how it works.
- They were trying to ask about reflection API in java, but I did not hear of it before, so I clearly told them and they just skipped it.
- Sum of all the numbers that are formed from root to leaf paths
- Difference between Exception and Error, Checked and Unchecked Exception.
- DIfference between Final keyword and Immutable classes.
- Static keyword.
- How JVM takes memory back from objects.
Round 5 (Technical): Taken by 2 senior members with 10-12 years exp working with GS.
- What is minheap?
- Given numbers [1,2,3,4,5], they are inserted in any order in an array, Tell the probability that the array is a minheap.
- Find any local minima in the array. I told the O(n) approach, and then they asked to optimize it.
- I need to write the complete code for this question and was expected to tell any solution that comes to my mind: Given 4 rectangular coordinates in a 2-D plane, and the millions of points, I need to tell the points that lie inside the rectangle. I told the brute force approach first, then they asked to give something more optimal, then I started approaching it using Binary Search, interviewer gave a lot of hints as he wanted the question to be finished fast, and then asked me to write the code for it.
- Again the HashMap question, and its contract, which objects are safe to be used in hashmap. (Seemed like HashMap was their favourite, I was asked in each round).
Round 6 (Hiring Manager):
- Asked about the experience in the current company?
- Why Goldman Sachs?
- Why do you want to leave the organization so early?
- 2 scenario-based behavioral questions.
- Given a paragraph containing parenthesis and strings, I need to tell if the parenthesis is balanced or not. (I told the approach with stack first and then was asked if I can do it in any other way).
- Find the number appearing a maximum and minimum number of times in the array.
- HashMap contract.
- Then he started explaining about the team and the work they do, their tech stack, etc..etc…I also cleared a few of my doubts and asked multiple questions.
Result: I was told verbally by the recruiter that I am selected.
Please Login to comment...