Goldman Sachs | Software Engineer (Analyst) | Bangalore, India | August-September 2020 | Selected
Summary
I was interviewed at Goldman Sachs for a Software Engineer (Analyst) role in Bangalore, India, and successfully received an offer after a comprehensive six-round interview process that included coding, system design, and behavioral questions.
Full Experience
I secured an interview opportunity at Goldman Sachs through a referral, holding two years of experience as a Software Engineer in an MNC.
Round 1: Hackerrank Coding Round (2 Hours)
The HR team contacted me to outline the interview process. I received a HackerRank test link via email and was given three days to complete it. This two-hour assessment featured two coding questions, both ranging from easy to medium difficulty. One involved a matrix problem, and the other was a well-known Dynamic Programming question. Having encountered these problems previously, I managed to solve both.
Round 2: Coder Pad Round (1 Hour)
After clearing the HackerRank round, HR scheduled a CoderPad session. This was a one-hour live coding round, where I was expected to write code in front of the interviewer, with Java as the default language. The questions were again LeetCode easy-medium level, and I quickly solved them as I had seen them multiple times before.
Round 3: Video Conference Round (1 Hour)
HR informed me about the subsequent three video conference rounds, which were scheduled for a weekend, giving me ten days to prepare. The interviews were conducted via Zoom, with links to both Zoom and CoderPad shared in advance. This round had two interviewers who were very friendly. We started with introductions, and then they posed two easy-medium level coding questions. I had to explain my solution, time, and space complexities, and write clean, production-level code. The interview concluded with me asking about their experiences at Goldman Sachs.
Round 4: Video Conference Round (1 Hour 15 Min)
This round, led by a VP and an associate-level interviewer, focused heavily on Java, Spring Boot, and my project experience. I answered questions on project details, design choices, the internal workings of HashMap, Spring-specific scenarios, Java Streams, lambda expressions, and garbage collection mechanisms. I ended the interview by asking about their professional journeys at Goldman Sachs.
Round 5: Video Conference Round (1 Hour)
The interviewers in this round were very congenial. We began with a casual discussion about working from home before diving into core Java and coding questions. This round was quite intensive, involving detailed discussions on data structures, multithreading scenarios, and database concepts.
Round 6: Hiring Manager Round (30 Min)
After receiving positive feedback, HR advanced my candidature to the Hiring Manager. This thirty-minute round included introductions from both sides, questions about my motivation for leaving my current role, challenges faced in my projects, technologies I've worked with, and how I keep up-to-date with new tech. I utilized the opportunity to ask about his experiences and my potential roles and responsibilities at GS. He advised me to always give my best and continue learning new things.
A week later, HR confirmed my selection and requested documents for compensation details.
Interview Questions (28)
Decode Ways
Given a coded message as a string of digits, I had to return the number of ways it can be decoded. Each digit corresponds to a letter (A=1, B=2, ..., Z=26).
Positional Elements in a Matrix
I was asked to find the number of positional elements in a given matrix. A positional element is defined as an element that is either the minimum or maximum in its row or its column.
First Non-Repeating Character in a String
Given a string, I needed to find and return the first non-repeating character. A HashMap approach was suggested and accepted.
Maximum Path Sum in a Grid (O(1) Space)
I was asked to find the maximum path sum from a source index (n-1,0) to a destination index (0,m-1) in a grid. This is a standard dynamic programming problem, and I was specifically asked to solve it using O(1) extra space, which I achieved by modifying the input matrix itself.
Next Greater Permutation
Given a number represented as a string, I had to find and return the next lexicographically greater permutation of its digits. For example, if the input is '12345', the output should be '12354'.
Minimum Absolute Difference Between Two Arrays
Given two arrays, I needed to find two elements, one from each array, such that their absolute difference is minimized.
Project Explanation
I had to explain my project in detail.
Architectural Design Choices
I was asked to justify specific design choices in my project, explaining why a particular module was implemented in one way over another.
Internal Working of HashMap
I was questioned on the internal working mechanisms of Java's HashMap, including collision resolution, resizing, and performance characteristics, along with follow-up questions.
Spring Component Scanning
A Spring-based question was posed: 'What happens when we place our component classes in a package different from the one containing the @SpringBootApplication annotation?'
Runtime Dependency Switching with Spring
I was asked how to switch a dependency at runtime using annotations. Specifically, if Class A depends on Class B and Class C, and initially uses Class B for data fetching, how can Class A be configured to use Class C instead of Class B at runtime, solely using annotations?
Java Streams and Lambda Expressions
I was asked questions related to Java Streams API and lambda expressions, focusing on common operations such as map, filter, and forEach.
Java Garbage Collector
Questions about the Java Garbage Collector were asked, including its purpose, how it's typically invoked, and the implications of explicitly calling it from a program.
Set vs. List & Set Implementations
I was asked to differentiate between Set and List interfaces in Java, discuss various types of Set implementations (e.g., HashSet, TreeSet, LinkedHashSet), and explain their internal workings.
First Non-Repeating Character in Large String (Single Traversal)
Given an extremely large string, I had to find the first non-repeating character in a single traversal. My approach involved using a HashMap (frequency map) to store characters and their first indices.
First Non-Repeating Character in Extremely Large String (Multithreaded)
A modification to the previous question: for an extremely large string, find the first non-repeating character using multi-threading. Initially, I suggested synchronized blocks and semaphores, but the interviewer sought an approach that avoids sequential bottlenecks. I then proposed using a ConcurrentHashMap where locks apply only to internal segments, which was accepted.
First Non-Repeating Character (Multithreaded, No Shared Resources)
Further modification to the non-repeating character problem: solve it multithreaded without using any shared resources. My answer involved using Callable tasks instead of Runnable, where each task processes a segment of the string and returns its local frequency map as a Future object. These individual maps would then be processed to find the overall first non-repeating character.
Words by Increasing Frequency
Given a string containing words, I needed to print these words in increasing order of their frequency.
Remove 3 Consecutive Identical Elements from Array
Given an array, I was asked to write a function that removes any sequences of three or more consecutive identical elements. For example, Input: 1 2 2 3 3 3 2 5, Output: 1 5. I solved this using a stack approach.
Generate Customer Transaction Report from Sorted Lists
Given two sorted lists, a Transaction List and a Customer List (both sorted by Customer ID), I needed to write a function to generate a report showing Customer ID, customer name, and the total amount spent by each customer, using a single traversal.
SQL Query for Customer Transaction Report
As a follow-up to the previous question, if Transaction and Customer data were in SQL tables instead of lists, I had to write an SQL query to generate the same report (Customer ID, customer name, total amount spent by each customer).
Database Performance Improvement (Indexes)
A follow-up to the SQL query question, asking how to improve its performance. I suggested using indexes. The interviewer then asked about types of indexes, to which I replied with clustered indexes for primary keys and non-clustered indexes for non-primary keys, which satisfied him.
Self-Introduction
I was asked to give a brief introduction about myself.
Reason for Leaving Current Company
I was asked about my motivations for seeking a new opportunity and why I wanted to leave my current company.
Challenges Faced in Current Project
The interviewer inquired about the challenges I encountered in my current project.
Technologies Worked On
I was asked to elaborate on the technologies I have experience with.
Staying Updated with Technologies
The interviewer asked about my methods for staying current with new technologies and industry trends.
Candidate Questions for Interviewer
I was given an opportunity to ask questions to the Hiring Manager.
Preparation Tips
LeetCode was an invaluable resource for my interview preparation. I utilized a premium subscription, focusing on mock interviews for companies like Amazon and Microsoft, and found the company-specific question sets particularly helpful. I dedicated 3-4 months to preparation during the COVID-19 pandemic, solving 372 LeetCode questions, primarily focusing on Medium and Hard difficulty levels. Additionally, reading other LeetCode interview experiences helped me identify frequently asked questions for various companies. I also meticulously prepared notes on my resume projects and work experiences, and practiced scenario-based questions.
Tips for the Interview:
- Thoroughly understand all applications and projects you've worked on, end-to-end.
- Only mention projects and technologies on your resume that you are confident discussing in depth.
- Be prepared for enhancement questions, such as how a design could be improved.
- Communicate your thought process clearly during the interview, even if you're struggling to find a solution.
- Conclude the interview by asking the interviewers about their experiences at the company.
- Never speak negatively about your current company or manager.