Goldman Sachs coding interview
questions, leaked.
159 problems reported across recent Goldman Sachs interviews. Top patterns: array, string, hash table. The list below is what most candidates actually saw, plus the honest play if you can't grind all of it.
Goldman Sachs pulls from a pool of 159 problems, and 64% are medium or harder. You're looking at heavy array coverage (92 problems), paired with strings, hash tables, and dynamic programming. The company rotates through classics like Trapping Rain Water and Median of Two Sorted Arrays, but also hits simulation, greedy, and matrix problems you might not have drilled. If you blank mid-OA on a two-pointer or DP pattern, StealthCoder runs invisibly during screen share and surfaces a working solution in seconds, letting you move past the wall and finish strong.
Top problems at Goldman Sachs
| # | Problem | Diff | Frequency | Pass % | Patterns |
|---|---|---|---|---|---|
| 01 | Trapping Rain Water | HARD | 100.0 | 65% | Array · Two Pointers · Dynamic Programming |
| 02 | Median of Two Sorted Arrays | HARD | 79.9 | 44% | Array · Binary Search · Divide and Conquer |
| 03 | First Unique Character in a String | EASY | 77.8 | 64% | Hash Table · String · Queue |
| 04 | Fraction to Recurring Decimal | MEDIUM | 76.5 | 26% | Hash Table · Math · String |
| 05 | High Five | EASY | 0.0 | 74% | Array · Hash Table · Sorting |
| 06 | Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold | MEDIUM | 0.0 | 70% | Array · Sliding Window |
| 07 | Car Pooling | MEDIUM | 0.0 | 56% | Array · Sorting · Heap (Priority Queue) |
| 08 | Best Time to Buy and Sell Stock | EASY | 64.2 | 55% | Array · Dynamic Programming |
| 09 | Number of Islands | MEDIUM | 63.6 | 62% | Array · Depth-First Search · Breadth-First Search |
| 10 | Minimum Path Sum | MEDIUM | 62.4 | 66% | Array · Dynamic Programming · Matrix |
| 11 | String Compression | MEDIUM | 61.1 | 58% | Two Pointers · String |
| 12 | LRU Cache | MEDIUM | 59.7 | 45% | Hash Table · Linked List · Design |
| 13 | Two Sum | EASY | 59.7 | 56% | Array · Hash Table |
| 14 | Container With Most Water | MEDIUM | 58.9 | 58% | Array · Two Pointers · Greedy |
| 15 | Find Minimum in Rotated Sorted Array | MEDIUM | 58.9 | 53% | Array · Binary Search |
| 16 | Group Anagrams | MEDIUM | 58.9 | 71% | Array · Hash Table · String |
| 17 | Robot Return to Origin | EASY | 0.0 | 76% | String · Simulation |
| 18 | Decode Ways | MEDIUM | 56.4 | 37% | String · Dynamic Programming |
| 19 | Longest Substring Without Repeating Characters | MEDIUM | 55.5 | 37% | Hash Table · String · Sliding Window |
| 20 | Search in Rotated Sorted Array | MEDIUM | 55.5 | 43% | Array · Binary Search |
| 21 | Minimize the Maximum of Two Arrays | MEDIUM | 53.5 | 31% | Math · Binary Search · Number Theory |
| 22 | Best Time to Buy and Sell Stock II | MEDIUM | 52.4 | 70% | Array · Dynamic Programming · Greedy |
| 23 | Kth Largest Element in an Array | MEDIUM | 51.2 | 68% | Array · Divide and Conquer · Sorting |
| 24 | Valid Arrangement of Pairs | HARD | 50.0 | 66% | Depth-First Search · Graph · Eulerian Circuit |
| 25 | Maximum Subarray | MEDIUM | 48.6 | 52% | Array · Divide and Conquer · Dynamic Programming |
| 26 | Construct Smallest Number From DI String | MEDIUM | 48.6 | 86% | String · Backtracking · Stack |
| 27 | Merge Intervals | MEDIUM | 48.6 | 49% | Array · Sorting |
| 28 | Power of Three | EASY | 48.6 | 48% | Math · Recursion |
| 29 | Longest Increasing Subsequence | MEDIUM | 48.6 | 58% | Array · Binary Search · Dynamic Programming |
| 30 | Longest Palindromic Substring | MEDIUM | 48.6 | 36% | Two Pointers · String · Dynamic Programming |
| 31 | Valid Parentheses | EASY | 47.2 | 42% | String · Stack |
| 32 | Jump Game | MEDIUM | 47.2 | 39% | Array · Dynamic Programming · Greedy |
| 33 | Count Palindromic Subsequences | HARD | 47.2 | 39% | String · Dynamic Programming |
| 34 | Minimum Cost Homecoming of a Robot in a Grid | MEDIUM | 47.2 | 51% | Array · Greedy |
| 35 | Range Product Queries of Powers | MEDIUM | 47.2 | 42% | Array · Bit Manipulation · Prefix Sum |
| 36 | Sliding Window Maximum | HARD | 45.6 | 48% | Array · Queue · Sliding Window |
| 37 | Keep Multiplying Found Values by Two | EASY | 45.6 | 71% | Array · Hash Table · Sorting |
| 38 | Count Number of Texts | MEDIUM | 45.6 | 49% | Hash Table · Math · String |
| 39 | Find All Good Indices | MEDIUM | 45.6 | 40% | Array · Dynamic Programming · Prefix Sum |
| 40 | Successful Pairs of Spells and Potions | MEDIUM | 45.6 | 45% | Array · Two Pointers · Binary Search |
| 41 | Determine if Two Events Have Conflict | EASY | 45.6 | 52% | Array · String |
| 42 | String to Integer (atoi) | MEDIUM | 43.8 | 19% | String |
| 43 | Product of Array Except Self | MEDIUM | 43.8 | 68% | Array · Prefix Sum |
| 44 | Search a 2D Matrix | MEDIUM | 43.8 | 52% | Array · Binary Search · Matrix |
| 45 | Subarray Sum Equals K | MEDIUM | 41.8 | 45% | Array · Hash Table · Prefix Sum |
| 46 | House Robber | MEDIUM | 41.8 | 52% | Array · Dynamic Programming |
| 47 | Pow(x, n) | MEDIUM | 41.8 | 37% | Math · Recursion |
| 48 | Word Search | MEDIUM | 39.5 | 45% | Array · String · Backtracking |
| 49 | Linked List Cycle | EASY | 39.5 | 53% | Hash Table · Linked List · Two Pointers |
| 50 | Next Permutation | MEDIUM | 39.5 | 43% | Array · Two Pointers |
Frequencies derived from public community-tagged interview reports. Click a row to view on LeetCode.
You have a week, maybe less. You can't out-grind the list above. StealthCoder runs invisibly during the actual Goldman Sachs OA. The proctor cannot see it. Screen share cannot detect it. Made for the engineer who has done the work but might still blank with a webcam pointed at him.
Get StealthCoder- array92 · 58%
- string49 · 31%
- hash table42 · 26%
- dynamic programming35 · 22%
- math24 · 15%
- two pointers22 · 14%
- sorting22 · 14%
- stack15 · 9%
- greedy15 · 9%
- binary search14 · 9%
Arrays dominate at 58% of the topic distribution, so you need speed on sliding window, two-pointer traversal, and prefix-sum logic before you test. Strings (31%) and hash tables (26%) come next, often combined in problems like Fraction to Recurring Decimal or First Unique Character. Dynamic programming (22%) threads through array problems like Trapping Rain Water and Minimum Path Sum. The hard problems (20 total) cluster around DP, binary search, and monotonic stack techniques. Start with array and string fundamentals, then stack DP patterns. The medium tier (102 problems) is where most interviews live, so don't treat easy problems as a warm-up. StealthCoder is your hedge for whatever pattern didn't stick during prep when the clock is live.
Companies with similar patterns
If you prepped for Goldman Sachs, these companies recycle ~60% of the same topics.
You've seen the list.
Now make sure you pass Goldman Sachs.
Memorizing every problem above in a week is a fantasy. StealthCoder is the hedge: an AI overlay that's invisible during screen share. It reads the problem on screen and surfaces a working solution in under 2 seconds. Made for the engineer who has done the work but might still blank with a webcam pointed at him. Works on HackerRank, CodeSignal, CoderPad, and Karat.
Goldman Sachs interview FAQ
How many array problems should I solve before a Goldman Sachs OA?+
Array appears in 92 of 159 problems (58%), so it's your core. Focus on sliding window, two pointers, and prefix sums first. You should be able to solve at least 30-40 array problems cleanly, including medium-difficulty ones like Container With Most Water and Number of Sub-arrays of Size K.
Is dynamic programming required for Goldman Sachs interviews?+
Yes. DP shows up in 35 problems and often overlaps with arrays and strings. Problems like Trapping Rain Water, Minimum Path Sum, and Best Time to Buy and Sell Stock are high-frequency. You need to understand both top-down and bottom-up approaches before you interview.
Should I study hash tables or strings first?+
Start with strings (49 problems), since hash-table knowledge follows naturally when you solve string problems that require counting or duplicate tracking. First Unique Character and Fraction to Recurring Decimal are good bridges between the two.
How many medium problems do I need to solve to be ready?+
Goldman Sachs has 102 medium-difficulty problems, which is 64% of the pool. You won't see all of them, but aim to solve 50-70 medium problems across array, string, and DP topics. That covers the variance in what you'll face during the OA.
Are hard problems worth studying before the OA?+
Hard problems make up 20 of 159 (12%). If you're strong on medium-tier array and DP, you'll recognize hard patterns. Focus on medium first, but know that Median of Two Sorted Arrays and Trapping Rain Water are high-probability hard problems worth drilling.