Prep for Goldman Sachs coding rounds with 30 high-frequency LeetCode questions, pattern breakdowns, and a fresher vs. experienced study plan.
Goldman Sachs LeetCode Interview Questions: 30 most asked (2026)
Goldman Sachs leetcode interview questions lean harder on math, optimization, and finance-flavored problem framing than most big-tech coding rounds. If you're preparing for a Goldman Sachs SDE interview in 2026, this guide covers the 30 highest-frequency problems from a reported pool of roughly 325, the eight patterns that dominate, and a prep plan split by experience level.
The difficulty breakdown across that pool: about 24% Easy, 63% Medium, 13% Hard. Medium is the real battleground. Goldman Sachs interviewers routinely push past a first working solution and ask you to optimize — so arriving with only a brute-force answer is a common way to lose a round you could have won.
What Goldman Sachs actually tests in coding interviews
Difficulty breakdown
Across approximately 325 reported Goldman Sachs coding problems, the split runs roughly 24% Easy, 63% Medium, and 13% Hard. SDE Round 1 typically involves one or two easy-to-medium problems focused on arrays, strings, hashing, or straightforward data structures. The medium tier is where most interviews are decided — not because the problems are obscure, but because interviewers expect clean code, clear communication, and an optimization step beyond the obvious solution.
The finance flavored twist
Goldman Sachs rounds carry a stronger math and probability flavor than standard big-tech interviews. Problems involving modular arithmetic, long-division simulation, and scheduling optimization show up more often here. Stopping at an O(n²) solution is a frequent failure point — Goldman Sachs interviewers expect you to ask yourself "can I do better?" before they ask you.
Ethics and cultural-fit questions can appear alongside technical rounds. They're brief, but they exist. Don't be caught off guard.
Top patterns behind Goldman Sachs LeetCode interview questions
These eight pattern families cover the majority of what Goldman Sachs has historically asked, ordered by frequency:
- Array (59.1%) — the dominant category. Expect sliding window, prefix sum, and two-pointer variants constantly.
- String (29.8%) — character frequency, substring search, and encoding problems.
- Hash Table (25.5%) — fast lookup, deduplication, and counting patterns. Often combined with arrays or strings.
- Dynamic Programming (22.5%) — optimization problems with overlapping subproblems. Goldman Sachs leans into DP more than many peer firms.
- Binary Search — appears in medium and hard problems, frequently combined with sorted arrays.
- Two Pointers / Sliding Window — high-frequency for array and string problems. Monotonic deque variants are a Goldman Sachs favorite.
- Trees / BST — less dominant but present. "All Elements in Two Binary Search Trees" is a confirmed ask.
- Greedy / Heap — scheduling and allocation optimization problems like IPO.
Master these eight families and you've covered the core of Goldman Sachs coding prep.
The 30 Goldman Sachs LeetCode interview questions (ranked by frequency)
This list is drawn from reported frequency data and confirmed problem appearances across multiple tracking sources. Problems are grouped into three tiers by frequency signal and difficulty — not listed as a flat ranking.
Tier 1 — High frequency, must know (Easy / Medium)
These are the problems that show up most often and form the foundation of any Goldman Sachs prep plan.
- Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit — Medium — Sliding Window / Deque — reported at 100% frequency on some trackers. Tests monotonic deque fluency.
- Open the Lock — Medium — BFS / Hash Table — reported at 82% frequency. Tests BFS on state-space graphs.
- Two Sum — Easy — Array / Hash Table — foundational. Goldman Sachs uses it to evaluate clean code and edge-case handling, not just whether you know the hash-map trick.
- High Five — Easy — Array / Sorting — tests basic aggregation logic. Often used as a warm-up problem.
- First Unique Character in a String — Easy — String / Hash Table — fast to solve, reveals hash-map fluency and attention to detail.
- Invalid Transactions — Medium — String / Hash Table — 191.9k submissions, 31.2% success rate. Harder than its medium label suggests.
- Number of People Aware of a Secret — Medium — DP / Simulation — tests rolling-window dynamic programming.
- Fraction to Recurring Decimal — Medium — Math / Hash Table — finance-adjacent. Tests long-division simulation and cycle detection.
- Count Nice Pairs in an Array — Medium — Math / Hash Table — tests modular arithmetic pattern recognition.
- Trapping Rain Water — Hard (often treated as medium-level prep) — Two Pointers / Stack — classic optimization problem that Goldman Sachs interviewers use to test whether you can move past brute force.
Tier 2 — Medium frequency, pattern builders (Medium / Hard)
These problems appear regularly enough that skipping them is a risk, and they reinforce the core patterns from Tier 1.
- IPO — Hard — Greedy / Heap — 180.9k submissions, 49.7% success. Tests two-heap scheduling, a pattern that maps directly to finance-style allocation problems.
- Maximum Good People Based on Statements — Hard — Backtracking / Bit Manipulation — 22.4k submissions, 49.2% success. Harder than the acceptance rate suggests because the search space is deceptive.
- Get Biggest Three Rhombus Sums in a Grid — Medium — Array / Matrix — tests diagonal traversal logic and prefix-sum techniques on 2D grids.
- All Elements in Two Binary Search Trees — Medium — Tree / Sorting — tests in-order traversal merge, a clean two-pointer application on trees.
- Maximum Points in an Archery Competition — Medium — Greedy / Backtracking — tests allocation optimization under constraints.
- Count Good Triplets in an Array — Hard — Array / BIT (Binary Indexed Tree) — tests frequency counting with ordering constraints.
- Minimum Consecutive Cards to Pick Up — Medium — Sliding Window / Hash Table — tests minimum-window identification with duplicate tracking.
- Longest Substring Without Repeating Characters — Medium — Sliding Window / Hash Table — a classic that reinforces the sliding-window pattern Goldman Sachs favors.
- Merge Intervals — Medium — Array / Sorting — interval problems appear across Goldman Sachs rounds, especially in scheduling contexts.
- Group Anagrams — Medium — String / Hash Table — tests string hashing and categorization.
- 3Sum — Medium — Two Pointers / Sorting — extends the Two Sum pattern and tests duplicate-handling discipline.
- Coin Change — Medium — DP — a core DP problem that maps to optimization thinking Goldman Sachs values.
Tier 3 — Lower frequency, good for experienced candidates
These problems appear less often but tend to surface in experienced-hire and senior rounds where interviewers push for deeper optimization and broader pattern coverage.
- LRU Cache — Medium — Hash Table / Linked List / Design — tests system-design thinking at the data-structure level.
- Word Ladder — Hard — BFS / Hash Table — tests BFS on word-transformation graphs; a step up from Open the Lock.
- Median of Two Sorted Arrays — Hard — Binary Search / Divide and Conquer — tests binary-search mastery.
- Longest Palindromic Substring — Medium — String / DP — tests expand-around-center or DP approaches.
- Serialize and Deserialize Binary Tree — Hard — Tree / Design — tests tree traversal and encoding under constraints.
- Maximal Rectangle — Hard — Stack / DP / Matrix — extends histogram-based thinking to 2D grids.
- Task Scheduler — Medium — Greedy / Heap — scheduling optimization with cooldown constraints; finance-adjacent framing.
- Kth Largest Element in an Array — Medium — Heap / Quickselect — tests partition-based selection and heap fluency.
Experienced candidates should expect follow-up optimization questions on any problem they solve. Goldman Sachs interviewers frequently ask "can you do better?" after a correct but suboptimal answer.
How to prepare — fresher vs. experienced
If you're a fresher
Start with Tier 1. Get comfortable with arrays, strings, and hash tables before branching out. SDE Round 1 is typically one or two easy-to-medium problems — don't burn time on hards before you've locked in the basics.
Aim for at least 40 problems across the top patterns before your interview date. If you have 4–8 weeks, spread practice across that window rather than cramming. And practice explaining your approach out loud before you write a single line of code. Goldman Sachs interviewers evaluate how you think, not just whether you get the right answer.
If you're experienced
Expect to be pushed past your first solution. Goldman Sachs interviewers frequently ask for optimization after an initial working answer — arriving with only a brute-force approach is a common way to lose a round you should have won.
Prioritize DP, greedy/heap, and graph problems in Tier 2 and Tier 3. Spaced repetition matters: revisit solved problems the following week, not just once. Finance-domain context — IPO scheduling, transaction validation, probability-flavored framing — is fair game. Don't be surprised when a problem is wrapped in financial language.
How to practice Goldman Sachs LeetCode questions effectively
Time-box each problem: 25–35 minutes for medium, 35–45 for hard. Real interviews don't run open-ended, and your practice shouldn't either.
Work on paper or a plain text editor first, not an IDE with autocomplete. The goal is writing correct code without tooling assistance, because that's what the interview environment looks like.
For each problem, follow this sequence: articulate the problem in your own words → confirm assumptions → generate example inputs and expected outputs → estimate Big-O before coding → implement → test with your examples → optimize. After solving, ask yourself: "Can I get this below O(n²)?" At Goldman Sachs, that question should come from you before the interviewer asks it.
mock interviews close the gap between solo practice and live performance. Talking through your reasoning under time pressure is a separate skill from solving the problem quietly — and it's the skill Goldman Sachs is actually evaluating. Verve AI's mock interview mode lets you practice these problems in a realistic interview format with real-time feedback, no scheduling required. It's a good way to test whether you can explain your thinking while coding, not just after.
Common mistakes to avoid
- Ignoring math-heavy problems. Goldman Sachs uses more probability and math-flavored questions than most big-tech companies. Fraction to Recurring Decimal and Count Nice Pairs are examples. If your prep skips these, you're leaving a gap.
- Stopping at the first working solution. A brute-force O(n²) answer may pass basic tests but will cost you in the debrief. Always push for the next optimization step.
- No spaced repetition. Solving a problem once and moving on is the most common prep mistake. Schedule a review session one week later. Problems you solved easily the first time will surprise you when you revisit them.
- Skipping the communication layer. Goldman Sachs interviewers evaluate how you think, not just whether you get the right answer. Practice narrating your approach — assumptions, tradeoffs, why you chose one data structure over another.
- Over-indexing on hard problems too early. 63% of Goldman Sachs questions are medium. Master medium before grinding hard. A candidate who solves every medium cleanly and communicates well will outperform a candidate who can sometimes solve hards but stumbles on mediums.
Wrapping up
Thirty problems, eight core patterns, two prep tracks depending on your experience level. Medium is the battleground, optimization is the differentiator, and communication is what separates candidates who get the answer from candidates who get the offer.
If you want to pressure-test your prep before the real thing, Verve AI's Interview Copilot and mock interview tools let you run through Goldman Sachs-style coding rounds with structured feedback — so you find the gaps on your schedule, not theirs.
Verve AI
Archive
