GS 2024 Papers
Previous year. View 2024 Papers →
This page contains actual Goldman Sachs placement papers from 2025 with latest HackerRank assessment questions.
| Round | Duration | Content |
|---|---|---|
| HackerRank OA | 90 min | 2 coding + 10 aptitude MCQs |
| Technical 1 | 60 min | DSA + live coding |
| Technical 2 | 60 min | System Design basics + CS |
| HR | 45 min | Behavioral + finance knowledge |
Answer: 0.3 × 100 + 0.7 × (-50) = 30 - 35 = -$5
Answer: 10000 / (1.1)² = $8,264.46
Answer: C(10,3) = 10!/(3!×7!) = 120
Answer: Discount (price < face value)
Difficulty: Medium
Time: 25 minutes
Find maximum sum of contiguous subarray (Kadane’s algorithm).
Input: [-2,1,-3,4,-1,2,1,-5,4]
Output: 6
public int maxSubArray(int[] nums) { int maxSum = nums[0]; int currentSum = nums[0]; for (int i = 1; i < nums.length; i++) { currentSum = Math.max(nums[i], currentSum + nums[i]); maxSum = Math.max(maxSum, currentSum); } return maxSum;}def max_subarray(nums): max_sum = current_sum = nums[0] for num in nums[1:]: current_sum = max(num, current_sum + num) max_sum = max(max_sum, current_sum) return max_sumDifficulty: Medium
Time: 35 minutes
Maximum profit with unlimited transactions but must wait 1 day after selling before buying again.
Input: [1,2,3,0,2]
Output: 3
public int maxProfit(int[] prices) { if (prices.length <= 1) return 0;
int hold = Integer.MIN_VALUE; int sold = 0; int rest = 0;
for (int price : prices) { int prevSold = sold; sold = hold + price; hold = Math.max(hold, rest - price); rest = Math.max(rest, prevSold); } return Math.max(sold, rest);}def max_profit(prices): if len(prices) <= 1: return 0
hold = float('-inf') sold = 0 rest = 0
for price in prices: prev_sold = sold sold = hold + price hold = max(hold, rest - price) rest = max(rest, prev_sold)
return max(sold, rest)Difficulty: Medium
Time: 30 minutes
Minimum coins needed to make amount.
Input: coins = [1,2,5], amount = 11
Output: 3 (5+5+1)
public int coinChange(int[] coins, int amount) { int[] dp = new int[amount + 1]; Arrays.fill(dp, amount + 1); dp[0] = 0;
for (int i = 1; i <= amount; i++) { for (int coin : coins) { if (coin <= i) { dp[i] = Math.min(dp[i], dp[i - coin] + 1); } } } return dp[amount] > amount ? -1 : dp[amount];}def coin_change(coins, amount): dp = [float('inf')] * (amount + 1) dp[0] = 0
for i in range(1, amount + 1): for coin in coins: if coin <= i: dp[i] = min(dp[i], dp[i - coin] + 1)
return dp[amount] if dp[amount] != float('inf') else -1Difficulty: Medium
Time: 30 minutes
Can string be segmented into dictionary words?
Input: s = “leetcode”, wordDict = [“leet”,“code”]
Output: true
public boolean wordBreak(String s, List<String> wordDict) { Set<String> wordSet = new HashSet<>(wordDict); boolean[] dp = new boolean[s.length() + 1]; dp[0] = true;
for (int i = 1; i <= s.length(); i++) { for (int j = 0; j < i; j++) { if (dp[j] && wordSet.contains(s.substring(j, i))) { dp[i] = true; break; } } } return dp[s.length()];}def word_break(s, word_dict): word_set = set(word_dict) dp = [False] * (len(s) + 1) dp[0] = True
for i in range(1, len(s) + 1): for j in range(i): if dp[j] and s[j:i] in word_set: dp[i] = True break
return dp[len(s)]GS 2024 Papers
Previous year. View 2024 Papers →
GS Coding
25+ problems. View Coding →
GS Preparation
Complete strategy. View Guide →
Complete Guide
Full guide. View Guide →
Master DSA + finance basics for Goldman Sachs!
Last updated: January 2026