Goldman Sachs 2024 Papers
Previous year papers with coding questions
Practice Goldman Sachs placement paper coding questions with detailed solutions. Access Goldman Sachs OA coding problems in Java, C++, Python.
This page contains Goldman Sachs coding questions from Goldman Sachs OA placement papers with detailed solutions.
Goldman Sachs OA Coding Section:
Solution (Java):
public int maxProfit(int[] prices) { int minPrice = Integer.MAX_VALUE; int maxProfit = 0;
for (int price : prices) { if (price < minPrice) { minPrice = price; } else if (price - minPrice > maxProfit) { maxProfit = price - minPrice; } }
return maxProfit;}Time Complexity: O(n)
Goldman Sachs 2024 Papers
Previous year papers with coding questions
Goldman Sachs Main Page
Complete Goldman Sachs placement guide
Practice Goldman Sachs coding questions regularly!