Goldman Sachs Interview Experience – Analyst (Java Developer)
I received an interview call from Goldman Sachs through a job portal (Naukri or a similar platform) for a Java Developer position. My profile was Analyst, and the entire interview process consisted of 9 technical rounds conducted over approximately 2 months.
Here's my experience with each round.
Round 1: HackerRank (Online Assessment)
Duration: 90 minutes
The assessment consisted of 2 coding questions (1 Easy and 1 Medium).
Q1. Digit Comparison
Given a range of numbers [x, y] and an integer q, multiply every number in the range by q and count how many products contain no digit that is the same as the corresponding original number.
Example:
Input: x = 10, y = 12, q = 2
Products: 20, 22, 24
Output: 1
Q2. 0/1 Knapsack Problem
Solve the standard 0/1 Knapsack problem and also return the items selected in the optimal solution.
I attempted both questions. Based on my experience, solving at least one question correctly may also be sufficient to progress, depending on the evaluation.
Round 2: CoderPad – Technical Interview 1
Duration: 60 minutes
The interviewer shared a CoderPad session where both of us could view, execute, and debug the code.
Two coding questions were asked:
Josephus Problem: Students are sitting in a circle, numbered from 1 to n. Starting with a given position, students are eliminated in a circular sequence. Find the last remaining student.
Given students' scores across multiple subjects, find the student with the maximum average score.
I solved both questions.
The interviewer focused on my problem-solving approach, implementation, debugging skills, and ability to pass all test cases.
Round 3: CoderPad – Technical Interview 2
Duration: 60 minutes
This round followed a similar format, with an interviewer based in New York.
Two questions were asked:
Find the median of two sorted arrays without using extra space.
Given a log file where each line starts with an IP address, find the most frequently occurring IP address.
I solved both questions.
Tips for CoderPad rounds:
Communicate your thought process throughout the interview.
Be prepared for additional test cases and follow-up questions.
Discuss optimization whenever required.
Don't panic if your code fails initially. Debug it systematically.
Focus on passing all test cases rather than rushing to finish.
Round 4: Technical Telephonic Interview
Duration: 60 minutes
This was comparatively the easiest round. Four questions were discussed:
Given an array containing positive and negative integers, find the element whose removal maximizes the product of the remaining elements.
Check whether a binary tree is height-balanced and optimize the solution to O(n).
Explain how HashMap works internally. What happens if equals() and hashCode() are not overridden in a custom class?
Given two strings, check whether one is a substring of the other.
I had to write code for questions 1, 2, and 4 and explain the implementation line by line.
Onsite Interview Rounds
The next five rounds were conducted onsite. Each round involved two interviewers and lasted approximately 60–75 minutes.
Round 5: Face-to-Face Technical Interview
The discussion started with a system-oriented question:
Q1. Suppose 50 million users access the Goldman Sachs website. How would you reduce manual customer support by automating the support system?
This was followed by several related questions.
Q2. Project Discussion
Around 30 minutes were spent discussing my current project, implementation details, and technical decisions. The discussion was interesting and interactive.
Q3. Coding Questions
Find the longest decreasing subarray in a given array.
Modify the solution to handle a circular array.
Explain the time complexity.
Q4. Design a stack that supports retrieving the maximum element in O(1) time with minimum additional space.
Round 6: Face-to-Face Technical Interview
This round was conducted by two senior engineers.
The main focus was Java fundamentals, HashMap internals, data structures, and implementation.
Questions included:
If you were implementing a custom HashMap, what factors would you consider?
How would you implement hashCode() and equals() for an Employee class?
How would you store employee details to support efficient searches by employee ID and employee name? How would you optimize the solution to support both?
Implement a custom iterator for a List of Lists in Java.
For the iterator question, I had to implement both hasNext() and next() methods.
Example:
Input: [[1, 2, 3], [4, 5], [6, 7]]
Expected iteration order: 1, 2, 3, 4, 5, 6, 7.
The implementation needed to correctly skip empty lists and handle transitions between nested lists.
I was expected to write production-level code.
Q5. Why Goldman Sachs?
Round 7: Face-to-Face Technical Interview
This round focused on algorithms, problem-solving, and design.
Questions included:
Given a sentence with misplaced spaces, such as "Iam anI ndian", reconstruct the original sentence using a dictionary of valid English words. The interviewer was mainly interested in my approach.
Design a typeahead/autocomplete search system.
Given the postorder traversal of a tree, determine its inorder traversal. Can multiple trees have the same postorder traversal? If yes, how many possibilities exist?
Given an expression containing brackets, determine whether the brackets are balanced and valid.
Round 8: Face-to-Face Technical Interview
This round included application design, data structures, and problem-solving questions.
Employee Hierarchy: Given a company portal UI, design a way to store and display the employee hierarchy. I initially suggested using a tree with a database backend, followed by a discussion about caching and database queries.
First Non-Repeating Word: Given a document, find its first non-repeating word. How would you handle a 50 GB file? The discussion included parallel processing using multiple cores.
Why do you want to switch jobs?
Generic Histogram Design: Design a backend data representation for a generic histogram without hardcoding specific categories. I suggested using a HashMap. The interviewer then extended the question to support multiple levels of granular information, such as area-wise population within cities.
Round 9: Final Technical Interview
The final round focused on production experience, Spring Framework, Java, and OOP concepts.
Questions included:
How would you troubleshoot an OutOfMemoryError in a production environment?
What production issues have you faced, and how did you debug them?
How have you used Spring in your projects?
Write a Spring REST API, including the required annotations.
Is the parameter in @RequestParam mandatory?
What alternatives can be used instead of @RequestParam?
What is a Spring Bean?
Explain Dependency Injection with code.
What is Inversion of Control (IoC)?
What is Autowiring? Demonstrate it with code.
Design a car showroom system where adding a new car model requires minimal code changes.
Explain abstract classes vs interfaces.
Given a binary tree, implement vertical order traversal.
Overall Experience & Preparation Tips
A few important things I learned throughout the interview process:
Strong coding skills matter: You may not know the answer to every question, but your problem-solving and implementation skills should be strong.
Don't panic when stuck: During the production OutOfMemoryError question, I initially struggled to answer. However, I was able to discuss practical debugging scenarios from my experience, and the interviewer moved forward.
Communication is important: Explain your approach clearly and engage with the interviewer.
Prepare for behavioral questions: Interviewers also evaluate your communication, attitude, and cultural fit.
Understand your projects: Be prepared to explain your architecture, technical decisions, challenges, and implementation details.
Final Result
I was informed immediately after the interview process that I had been selected. Generally, the offer letter processing may take around 1–3 weeks.
Overall, it was a great experience. All the interviewers were supportive, knowledgeable, and encouraging throughout the process.


Discussions