Interview blog

Goldman Sachs LeetCode Questions: What Candidates Report

Written March 11, 2026Updated October 19, 202611 min read
Top 30 Most Common Goldman Sachs LeetCode Interview Questions You Should Prepare For

Goldman's own HackerRank format, the CoderPad and Superday rounds candidates describe, and the problem types that keep coming back.

Goldman does not publish the questions it asks in live coding rounds, so every list of Goldman Sachs LeetCode questions, this one included, is built from what candidates report. Two things are solid. Goldman's own guide says campus applicants take a 30-minute HackerRank data structures and algorithms challenge, and engineering applicants add a 45-minute debugging challenge in an existing codebase. Candidate write-ups then describe a one-hour CoderPad screen with two LeetCode-style problems and a Superday of several rounds. Across the reports below, three problem families repeat: averaging student scores, compressing repeated characters, and counting islands in a grid.

What Goldman says about its coding test

Goldman's careers blog has a HackerRank guide from its Engineering Campus Recruiting team. It is the most useful official document for this search, because it says exactly what the online assessment contains:

  • Challenge — Who takes it — Time — What it tests
  • Software Fundamentals — All candidates — 30 minutes — Data structures and algorithms problems, in the language of your choice
  • Software Diagnostics — Engineering applicants — 45 minutes — Diagnosing and fixing issues in an existing Django (Python), Node.js (JavaScript) or Spring Boot (Java) application
  • Math — Quantitative Strategist applicants — 22 minutes — Multiple-choice probability, statistics, calculus and linear algebra

Two details change how you should prepare. First, the Diagnostics challenge includes a built-in "limited" AI assistant that, in Goldman's words, will not give you the full solution but can help with UI navigation, syntax and understanding the problem statement. Goldman tells candidates to treat it as they would on the job and to apply their own judgment to validate the result. Second, the guide's advice for that section is to practise understanding unfamiliar code, debugging, writing tests and making targeted changes, rather than building an application from scratch.

Goldman's student "Prepare" page fills in the rest of the campus process: a video interview of about 30 minutes, the HackerRank assessment for engineering applicants, and then a Superday of typically two to five interviews, depending on the division. The HackerRank guide says candidates should hear back from campus recruiting within three weeks of the assessment.

What that means for LeetCode prep

LeetCode practice covers one 30-minute section and the live coding rounds that follow. It does not cover the Diagnostics challenge at all. Grinding more medium problems will not help you find a bug in a Spring Boot service you have never seen before.

If you are applying through campus recruiting, split your time. Keep working through problems for the Fundamentals section, but also spend a few sessions inside an unfamiliar open-source project in Python, JavaScript or Java: run its tests, break something on purpose, and practise tracing a failure back to its cause. Goldman says you can pick the Fundamentals language yourself, so pick the one you write fastest.

Experienced hires describe a different first step. The reports below mention HackerRank tests of 90 minutes and two hours, each with two problems, rather than the timed campus sections. Expect the format to depend on whether you applied as a student or a lateral hire.

The rounds, from people who sat them

These are individual accounts on LeetCode Discuss, mostly from Bangalore, with one from Dallas and one from the US at Associate level. They agree on the outline.

  • Stage — What candidates report
  • Online assessment — HackerRank, usually two problems. Reported as easy-to-medium (2020), "2 medium questions" (2024) and arrays, strings and complexity (2025).
  • CoderPad screen — One hour, two problems, coded live with an interviewer. One 2020 candidate said Java was the default language.
  • Superday — Two to four rounds, usually on one day, often with two interviewers each. Typically one or two coding rounds, a "software engineering practices" or SDLC round, a design round, and a behavioral or Managing Director conversation.

Timing varies. One 2025 candidate waited 30 to 40 days after the HackerRank test before a recruiter called, got Superday confirmation a day or two after the CoderPad round, and reported the Superday was scheduled 18 days after that. The same candidate's application showed as turned down while they were still being scheduled for interviews under a different job ID, so do not read too much into portal status alone.

Problems that keep coming back

Six reports from 2020 to 2025 is a small sample, but the overlap is striking.

  • Average student scores. Dallas, 2021: High Five, the average of each student's top five scores. Bengaluru, 2024: given student names and scores, find the maximum average. Bangalore, 2025: compute a class average from a list of student marks, with two or three approaches discussed. Three CoderPad screens, four years apart, asked a variation of the same idea.
  • Compressing repeated characters. Run-length encoding (2020), String Compression (2024), and a 2025 variant that replaces a repeated segment with an asterisk, turning ABCABCEABCABCE into ABC*E*.
  • Counting islands. Number of Islands came up in the 2024 US Associate CoderPad round and the 2025 Bangalore screen.

Other problems named in the same reports: Minimum Size Subarray Sum, Median of Two Sorted Arrays, next greater permutation, a min-stack, linked-list intersection, Best Time to Buy and Sell Stock II as a follow-up to the first version, forming a palindrome from a set of characters, Coin Change, Container With Most Water (with a follow-up asking what happens if the container is tilted), a Koko Eating Bananas-style binary search, a segment tree insert, and a trie problem.

The pattern is useful even if your questions differ. In these reports the screens lean towards hash maps, strings and grid traversal at easy-to-medium difficulty, and several candidates say the follow-up mattered as much as the first version.

Worked example: the best student average

Here is the version from the 2024 report: given a list of student names and scores, return the highest average. It takes five minutes to code, which is the point. The interviewer is watching how you handle the details.

from collections import defaultdict

def best_average(rows):
    totals = defaultdict(lambda: [0, 0])  # name -> [sum of scores, count]
    for name, score in rows:
        totals[name][0] += score
        totals[name][1] += 1
    if not totals:
        return None
    return max(total / count for total, count in totals.values())

One pass over the rows, O(n) time and O(k) memory for k students. What makes the answer strong is what you say before and after writing it:

  • Ask about the output. Exact average, rounded, or floored? Some versions of this problem want an integer. Ask rather than guess.
  • Ask about empty input. Returning None is a choice; say it out loud and offer to raise an error instead.
  • Avoid the zero trap. Many first attempts start with best = 0 and update it in a loop. That returns the wrong answer if every average is negative. Taking max over the computed averages avoids it.
  • Expect the follow-up. Return the student's name as well (and decide what to do with ties). Average only each student's top five scores, which is High Five: keep a min-heap of size five per student. Or handle scores arriving as a stream, where you keep running totals and need a way to track the maximum without recomputing everything.

The 2025 candidate said they discussed two or three approaches for the class-average version. Have a second approach ready, such as sorting by name and summing runs, and be able to explain why the hash map is simpler.

Number of Islands, and why one interviewer wanted BFS

In the 2025 Bangalore screen, the interviewer preferred breadth-first search over depth-first search for Number of Islands, to avoid a stack overflow. That is a fair concern in Python: a recursive DFS on a large grid can hit the interpreter's recursion limit, which exists to stop the underlying C stack from overflowing. An iterative BFS with a queue avoids the problem:

from collections import deque

def num_islands(grid):
    if not grid:
        return 0
    rows, cols = len(grid), len(grid[0])
    count = 0
    for r in range(rows):
        for c in range(cols):
            if grid[r][c] != "1":
                continue
            count += 1
            grid[r][c] = "0"              # mark visited when queued, not when popped
            queue = deque([(r, c)])
            while queue:
                i, j = queue.popleft()
                for x, y in ((i + 1, j), (i - 1, j), (i, j + 1), (i, j - 1)):
                    if 0 <= x < rows and 0 <= y < cols and grid[x][y] == "1":
                        grid[x][y] = "0"
                        queue.append((x, y))
    return count

Two things to say while you write it: the function overwrites the input grid, so ask whether that is allowed or copy it first; and marking a cell when it enters the queue, not when it leaves, stops the same cell being queued twice. Time is O(rows × cols), and the queue never holds more cells than the grid has.

The rounds LeetCode will not prepare you for

Several Superday rounds in these reports had little to do with algorithms.

  • Software engineering practices. The 2024 Bengaluru candidate was asked about method overriding and overloading, version control, making a Java class immutable, SDLC phases, types of testing, regression testing and a Java Stream filter. They were rejected after struggling with the Spring Boot and React questions. Read your own resume line by line and be ready to defend every framework on it.
  • Design. Reports mention a URL shortener, an e-commerce checkout with cancellation and payment flows, a recipe lookup by ingredients, a traffic-light system and, for an Associate role, distributed caching and load balancing. The 2021 Dallas candidate expected two coding rounds on site and got none.
  • Data structures without code. The US Associate candidate's first interview round after the CoderPad screen discussed a trie for autocomplete and two stacks for browser back and forward navigation, with no coding.
  • Behavioral and Managing Director rounds. Questions included a time you went beyond your comfort zone, how you handled feedback from a manager, working with customers, and why Goldman Sachs. One round asked how to handle overhearing confidential salary news about a colleague.

What to do now

If your Goldman interview is a week or two away:

  1. Take Goldman's HackerRank practice assessment linked from its guide, so the platform is familiar before the timed version.
  2. Drill the three repeat families above, then their follow-ups. For each, practise saying your questions about input, output and edge cases before you code.
  3. Prepare for Diagnostics if you are a campus applicant. Spend time debugging an unfamiliar codebase in Django, Node.js or Spring Boot, whichever you know best.
  4. Write iterative versions of your graph traversals, and know why you would choose them.
  5. Rehearse the SDLC round. Testing types, code review, environments, version control and the frameworks on your resume.
  6. Prepare three stories for the behavioral round, including one about feedback and one about a customer or stakeholder.

For the explaining-out-loud part, an AI mock interview is a low-stakes way to rehearse. After you have solved a problem yourself, Verve AI's Coding Copilot can capture the question from your screen and return a solution, and its Complexity and Edge Case quick actions are a quick way to check your own analysis against another one. For the finance and behavioral side of the firm, see our Goldman Sachs question bank, and if you are interviewing at other banks too, our guide to Bloomberg LeetCode questions covers a similar loop.

Sources

  • HackerRank challenge types, who takes each, time limits (30, 45 and 22 minutes), Django/Node.js/Spring Boot, the limited AI assistant, preparation advice, the practice assessment and the three-week update (page metadata dates it 13 Aug 2026): https://www.goldmansachs.com/careers/blog/guide-to-hackerrank
  • Campus process: video interview of about 30 minutes, HackerRank for engineering applicants, Superday of two to five interviews depending on division: https://www.goldmansachs.com/careers/students/prepare
  • Bangalore Associate, Jan 2025: 90-minute HackerRank with two problems, one-hour CoderPad (class average, repeated segments to asterisks), 30 to 40 days before the recruiter call, Superday 18 days later, four interviews in a day, two interviewers per Superday round, segment tree and trie problems, URL shortener, e-commerce checkout, portal status shown as turned down: https://leetcode.com/discuss/interview-experience/6344866/
  • Bangalore Analyst, Oct 2025: HackerRank on arrays and strings, CoderPad with cycle length in an array and Number of Islands (BFS preferred to avoid stack overflow), Superday with palindrome, Koko-style binary search, Coin Change, Container With Most Water (tilted follow-up), traffic-light design, confidential salary scenario: https://leetcode.com/discuss/interview-experience/7289995
  • US Associate, Nov 2024: CoderPad with a 2D DP problem and Number of Islands, trie autocomplete and two-stack browser navigation without coding, SDLC discussion, distributed caching and load balancing, Managing Director behavioral questions: https://leetcode.com/discuss/interview-question/5994129/Goldman-Sachs-Interview-Experience-Associate/
  • Bengaluru Analyst, May 2024 (rejected): OA with two medium problems, one-hour CoderPad with String Compression and maximum student average, Best Time to Buy and Sell Stock I and II, palindrome from characters, software engineering practices round topics: https://leetcode.com/discuss/interview-experience/5148428/
  • Dallas Software Engineer, April 2021: CoderPad with High Five and Minimum Size Subarray Sum, onsite with recipe lookup design, resume and SDLC, TinyURL, no coding rounds: https://leetcode.com/discuss/interview-experience/1186620/goldman-sachs-software-engineer-dallas-april-2021/
  • Bangalore Analyst, Sept 2020 (rejected): two-hour HackerRank with two easy-to-medium problems, one-hour CoderPad with Java as default, run-length encoding and median of two sorted arrays, next greater permutation, min-stack, linked-list intersection: https://leetcode.com/discuss/interview-experience/884687/
  • Python recursion limit and why it exists: https://docs.python.org/3/library/sys.html
  • Coding Copilot screen capture and quick actions: https://docs.vervecopilot.com/features/coding-copilot
R

Ryan

CEO of Verve AI

Related reads

Explore related blog posts

What Should I Know About Mercor Interview Psychiatrists
February 18, 2026Interview blog

What Should I Know About Mercor Interview Psychiatrists

Discover key insights, common questions, and practical tips to prepare for interviews with Mercor psychiatrists.

Read story
What Do Mercor Interview Questions Actually Test And How Can You Ace Them
February 27, 2026Interview blog

What Do Mercor Interview Questions Actually Test And How Can You Ace Them

Discover what Mercor interview questions test and proven strategies to prepare, answer confidently, and ace the process.

Read story
How Can Mercor Interview Rehabilitation Counselors Help You Land A Rehabilitation Counselor Role
February 17, 2026Interview blog

How Can Mercor Interview Rehabilitation Counselors Help You Land A Rehabilitation Counselor Role

Discover how Mercor interview strategies and coaching can help you secure a rehabilitation counselor role.

Read story
Why Does Mercor Interview How To Prepare Matter More For Remote Tech Roles
February 19, 2026Interview blog

Why Does Mercor Interview How To Prepare Matter More For Remote Tech Roles

Learn why Mercor's interview focus and preparation are crucial for landing and succeeding in remote tech roles, with tips.

Read story
What Makes Mercor Interview Software Engineering & Systems Design Expert Such A High-Stakes Screening Tool
March 13, 2026Interview blog

What Makes Mercor Interview Software Engineering & Systems Design Expert Such A High-Stakes Screening Tool

Explore why Mercor Interview's Software Engineering & Systems Design Expert is used as a high-stakes screening tool.

Read story
How Can You Ace A Mercor Interview Sociology Teachers, Postsecondary
February 8, 2026Interview blog

How Can You Ace A Mercor Interview Sociology Teachers, Postsecondary

Tips and strategies to ace a Mercor interview for postsecondary sociology teacher roles, including prep and sample questions.

Read story
What Should I Know About Mercor Interview Soil And Plant Scientists
February 8, 2026Interview blog

What Should I Know About Mercor Interview Soil And Plant Scientists

Learn what to expect in Mercor interviews for soil and plant scientist roles, with common questions and preparation tips.

Read story
What Should I Know About Mercor Interview Special Education Teachers, Preschool
March 20, 2026Interview blog

What Should I Know About Mercor Interview Special Education Teachers, Preschool

Tips and insights for Mercor interviews for preschool special education teachers, with prep steps and sample questions.

Read story
What Do You Need To Know About Mercor Interview System Review Before You Try It
February 10, 2026Interview blog

What Do You Need To Know About Mercor Interview System Review Before You Try It

Discover key insights, pros, cons, and tips about Mercor Interview System to decide if it's right for you.

Read story

Ace your live interviews with AI support!

Get Started For Free

Available on Mac, Windows, browser and mobile