LogIn
I don't have account.

Goldman Sachs Analyst Interview Experience (5 Rounds, Selected) | Complete DSA Questions, System Design

Neeta Chakravorty
32 Views

Getting selected for an Analyst role at Goldman Sachs Group, Inc. is a dream for many engineers, especially for those aiming to enter top-tier product-based and finance-driven tech companies.

I recently went through the complete interview process for the Goldman Sachs Analyst interview and fortunately, I was selected after 5 rounds. The entire process was challenging, highly focused on problem-solving and full of follow-up questions that tested depth rather than surface-level preparation.

This was a remote interview process, applied through the company website and the complete timeline took around 2 to 3 weeks. If you are preparing for the Goldman Sachs Software Engineer / Analyst interview, searching for Goldman Sachs interview experience, Goldman Sachs DSA questions, Goldman Sachs Java coding round or how to crack Goldman Sachs interviews, this detailed experience will help you understand exactly what to expect.

One thing I want to mention honestly. this was not an interview where solving one correct answer was enough. The interviewers wanted optimization, edge-case handling and most importantly, confidence in explaining why your solution is correct.

Let me walk you through every round in detail, along with the optimal Java solutions for all coding problems asked during the interview.

Interview Process Overview

There were a total of 5 rounds:

  • Round 1 – DSA Round (2 Coding Problems)
  • Round 2 – DSA Round (2 Coding Problems)
  • Round 3 – Advanced DSA Round (2 Coding Problems)
  • Round 4 – System Design (Parking Lot Payment + Gate Automation)
  • Round 5 – Behavioral / Adaptability Round

Most rounds were medium difficulty, but follow-up questions made them significantly harder. The biggest lesson from this interview was simple:

Goldman Sachs tests problem-solving depth, not memorization.

Round 1 – DSA Round (Two Interviewers, Two Problems)

This round had two interviewers and each interviewer asked one problem. That itself created pressure because there was very little room for recovery.

Problem 1: Detect Cycle Length in a Linked List

This was not just the standard cycle detection problem. The interviewer specifically wanted the length of the cycle, not only whether a cycle exists. The best approach was using Floyd's Cycle Detection Algorithm (Slow and Fast Pointer).

Once both pointers meet, we keep moving one pointer until it returns to the same node and count the steps.

This gives the cycle length in O(N) time and O(1) space.


class ListNode {
    int val;
    ListNode next;
    ListNode(int val) {
        this.val = val;
    }
}

public class CycleLength {
    public int findCycleLength(ListNode head) {
        ListNode slow = head;
        ListNode fast = head;
        while (fast != null && fast.next != null) {
            slow = slow.next;
            fast = fast.next.next;
            if (slow == fast) {
                return calculateLength(slow);
            }
        }
        return 0; // No cycle
    }
    private int calculateLength(ListNode node) {
        int length = 1;
        ListNode current = node.next;
        while (current != node) {
            length++;
            current = current.next;
        }
        return length;
    }
}

Problem 2: Number of Connected Components in an Undirected Graph

This problem tested graph fundamentals. Given n nodes and edges, we had to count how many connected components existed.

The optimal solution was straightforward DFS or BFS traversal. For every unvisited node, start DFS and increment the component count.


import java.util.*;

public class ConnectedComponents {

   public int countComponents(int n, int[][] edges) {
       List<List<Integer>> graph = new ArrayList<>();

       for (int i = 0; i < n; i++) {
           graph.add(new ArrayList<>());
       }

       for (int[] edge : edges) {
           graph.get(edge[0]).add(edge[1]);
           graph.get(edge[1]).add(edge[0]);
       }

       boolean[] visited = new boolean[n];
       int count = 0;

       for (int i = 0; i < n; i++) {
           if (!visited[i]) {
               dfs(graph, visited, i);
               count++;
           }
       }

       return count;
   }

   private void dfs(List<List<Integer>> graph, boolean[] visited, int node) {
       visited[node] = true;

       for (int neighbor : graph.get(node)) {
           if (!visited[neighbor]) {
               dfs(graph, visited, neighbor);
           }
       }
   }
}

Round 2 – DSA Round

This round started with a short introduction and then quickly moved into coding. The interviewer was very focused and expected optimized solutions quickly.

Problem 1: Minimum Insertions to Make String Palindrome

This problem looked tricky initially but becomes easy once you identify the pattern. Find the minimum number of characters to insert so the string becomes a palindrome.

The minimum insertions needed is:

Length of String - Longest Palindromic Subsequence

And LPS can be found using LCS between the string and its reverse.


public class MinInsertionsPalindrome {

    public int minInsertions(String s) {
        String rev = new StringBuilder(s).reverse().toString();
        int lps = lcs(s, rev);
        return s.length() - lps;
    }

    private int lcs(String s1, String s2) {
        int n = s1.length();
        int[][] dp = new int[n + 1][n + 1];
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= n; j++) {
                if (s1.charAt(i - 1) == s2.charAt(j - 1)) {
                    dp[i][j] = 1 + dp[i - 1][j - 1];
                } else {
                    dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]);
                }
            }
        }
        return dp[n][n];
    }
}

Problem 2: Koko Eating Bananas

Classic binary search on answer problem.

Imagine Koko has several piles of bananas, and she loves bananas a lot. Every hour, she chooses one pile and eats a fixed number of bananas k. If the pile has fewer than k, she finishes that pile and waits for the next hour.

You are given:

  • an array piles[] where each value represents bananas in one pile
  • an integer h, the total number of hours available

Your task is to find the minimum eating speed k so that Koko can finish all bananas within h hours. The interviewer was not testing simple loops here. they were testing whether I could identify a Binary Search on Answer pattern.


public class KokoEatingBananas {

    public int minEatingSpeed(int[] piles, int h) {
        int left = 1;
        int right = 0;
        for (int pile : piles) {
            right = Math.max(right, pile);
        }
        while (left < right) {
            int mid = left + (right - left) / 2;
            if (canFinish(piles, h, mid)) {
                right = mid;
            } else {
                left = mid + 1;
            }
        }
        return left;
    }

    private boolean canFinish(int[] piles, int h, int speed) {
        int hours = 0;
        for (int pile : piles) {
            hours += (pile + speed - 1) / speed;
        }
        return hours <= h;
    }
}

Round 3 – Advanced DSA Round

This round was slightly harder because follow-up questions became aggressive. Optimization mattered a lot.

Problem 2: Largest Rectangle in Histogram

This is one of the most famous stack problems. You are given bar heights. you need to find Largest rectangular area possible.


import java.util.*;

public class LargestRectangle {
    public int largestRectangleArea(int[] heights) {
        Stack<Integer> stack = new Stack<>();
        int maxArea = 0;
        int n = heights.length;
        for (int i = 0; i <= n; i++) {
            int currentHeight = (i == n) ? 0 : heights[i];
            while (!stack.isEmpty() &&
                    currentHeight < heights[stack.peek()]) {

                int height = heights[stack.pop()];
                int width = stack.isEmpty()
                        ? i
                        : i - stack.peek() - 1;
                maxArea = Math.max(maxArea, height * width);
            }
            stack.push(i);
        }

        return maxArea;
    }
}

Problem 6: Minimum Steps to Reach a Target with Variable Jumps

This required BFS thinking combined with shortest path optimization.

The exact implementation depends on constraints, but the interviewer mainly wanted efficient state transition thinking rather than brute force recursion.

This round was more about approach clarity than code perfection.

Round 4 – System Design Round

Design a Parking Lot Payment and Gate Control System

This round tested practical engineering thinking. The problem statement was:

Design a system that automates payment and gate control for parking lots.

The focus areas were:

  • vehicle entry and exit
  • ticket generation
  • pricing calculation
  • payment integration
  • gate automation
  • slot management
  • failure handling
  • admin monitoring

I discussed components like:

  • Entry Gate Service
  • Exit Gate Service
  • Payment Service
  • Pricing Engine
  • Slot Management
  • Ticket Manager
  • Notification System

The interviewer kept asking:

  • What if payment fails but gate opens?

  • How do you handle duplicate tickets?

  • What if sensors fail?

This round taught me that system design is more about edge cases than architecture diagrams.

Round 5 – Behavioral Round

This was one of the most underrated rounds. Many people ignore it and regret later.

The interviewer focused on:

  • how I adapt to new technologies
  • how I handle project scope changes
  • how I stay calm during uncertainty
  • how I work under pressure
  • how I keep learning continuously

This was not about textbook answers. They were checking maturity. I answered using real project examples rather than generic statements and that helped a lot. Authenticity works better than memorized HR answers.

Final Result – Selected

Fortunately, I got selected. But honestly, what helped most was not solving all problems perfectly.

It was:

  • structured thinking
  • calm communication
  • optimization mindset
  • handling follow-up questions confidently

That matters a lot at Goldman Sachs Group, Inc.. Preparation Tips to Crack Goldman Sachs Interviews If I had to summarize preparation in one line:

Master DSA fundamentals first. Focus heavily on: Graphs,Trees,Dynamic Programming,Binary Search,Stack Problems,Linked List,BFS / DFS, Greedy + Optimization

Also prepare for:

  • follow-up questions
  • dry runs
  • edge cases
  • complexity analysis

Many candidates solve the main problem but fail in follow-ups. That is where interviews are won or lost.

Final Advice

If you're targeting Goldman Sachs, remember:

  • They do not just test coding.
  • They test how you think under pressure.
  • Your explanation matters.
  • Your trade-offs matter.
  • Your confidence matters.

And most importantly :-

your ability to stay calm when the interviewer pushes harder. That is the real interview. Prepare deeply, practice consistently and trust your process. That is how offers happen.

Trending Developer Reads

Responses (0)

Write a response

CommentHide Comments

No Comments yet.