Goldman Sachs Interview Questions

Review this list of 35 Goldman Sachs interview questions and answers verified by hiring managers and candidates.
  • Goldman Sachs logoAsked at Goldman Sachs 

    "Microservices for resolving diffs, storage S3 for keeping files"

    Anonymous Jellyfish - "Microservices for resolving diffs, storage S3 for keeping files"See full answer

    Software Engineer
    System Design
  • Goldman Sachs logoAsked at Goldman Sachs 
    Video answer for 'Find a triplet in an array with a given sum.'
    +9

    " import java.util.*; class Solution { // Time Complexity: O(n^2) // Space Complexity: O(n) public static List> threeSum(int[] nums) { // Ensure that the array is sorted first Arrays.sort(nums); // Create the results list to return List> results = new ArrayList(); // Iterate over the length of nums for (int i = 0; i < nums.length-2; i++) { // We will have the first number in"

    Victor O. - " import java.util.*; class Solution { // Time Complexity: O(n^2) // Space Complexity: O(n) public static List> threeSum(int[] nums) { // Ensure that the array is sorted first Arrays.sort(nums); // Create the results list to return List> results = new ArrayList(); // Iterate over the length of nums for (int i = 0; i < nums.length-2; i++) { // We will have the first number in"See full answer

    Software Engineer
    Data Structures & Algorithms
    +3 more
  • Goldman Sachs logoAsked at Goldman Sachs 
    +10

    "function hasCycle(head) { if (!head) return false; let slow = head; let fast = head.next; while (fast && fast.next && slow !== fast) { slow = slow.next; fast = fast.next.next; } return slow === fast; } `"

    Tiago R. - "function hasCycle(head) { if (!head) return false; let slow = head; let fast = head.next; while (fast && fast.next && slow !== fast) { slow = slow.next; fast = fast.next.next; } return slow === fast; } `"See full answer

    Software Engineer
    Data Structures & Algorithms
    +4 more
  • Goldman Sachs logoAsked at Goldman Sachs 
    +39

    " Brute Force Two Pointer Solution: from typing import List def two_sum(nums, target): for i in range(len(nums)): for j in range(i+1, len(nums)): if nums[i]+nums[j]==target: return [i,j] return [] debug your code below print(two_sum([2, 7, 11, 15], 9)) `"

    Ritaban M. - " Brute Force Two Pointer Solution: from typing import List def two_sum(nums, target): for i in range(len(nums)): for j in range(i+1, len(nums)): if nums[i]+nums[j]==target: return [i,j] return [] debug your code below print(two_sum([2, 7, 11, 15], 9)) `"See full answer

    Software Engineer
    Data Structures & Algorithms
    +5 more
  • "I solved it using recursion and then memoization. Used Dynamic programming approach"

    Ravi teja N. - "I solved it using recursion and then memoization. Used Dynamic programming approach"See full answer

    Software Engineer
    Coding
    +1 more
  • 🧠 Want an expert answer to a question? Saving questions lets us know what content to make next.

  • Goldman Sachs logoAsked at Goldman Sachs 
    +1

    "As a project or program manager to influence effectively without direct authority, focus on building credibility and trust by consistently delivering results, demonstrating empathy for stakeholder needs, and aligning everyone on shared goals. When managing up, tailor communication to leadership’s priorities and concerns—bring actionable insights, clear data, and potential solutions to the table. When managing down, empower teams by promoting ownership, offering timely recognition, and maintainin"

    Elle - "As a project or program manager to influence effectively without direct authority, focus on building credibility and trust by consistently delivering results, demonstrating empathy for stakeholder needs, and aligning everyone on shared goals. When managing up, tailor communication to leadership’s priorities and concerns—bring actionable insights, clear data, and potential solutions to the table. When managing down, empower teams by promoting ownership, offering timely recognition, and maintainin"See full answer

    Data Engineer
    Behavioral
    +2 more
  • Goldman Sachs logoAsked at Goldman Sachs 
    Software Engineer
    Data Structures & Algorithms
    +4 more
  • Goldman Sachs logoAsked at Goldman Sachs 
    Software Engineer
    Data Structures & Algorithms
    +2 more
  • Goldman Sachs logoAsked at Goldman Sachs 
    +7

    "def traprainwater(height: List[int]) -> int: n = len(height) totalwaterlevel = 0 for i in range(n): j = i+1 while j = n: break rows = j - i -1 intrwaterlevel = min(height[j], height[i]) * rows for k in range(i+1, j): intrwaterlevel -= height[k] totalwaterlevel += intrwaterlevel i = j return totalwaterlevel"

    Manoj R. - "def traprainwater(height: List[int]) -> int: n = len(height) totalwaterlevel = 0 for i in range(n): j = i+1 while j = n: break rows = j - i -1 intrwaterlevel = min(height[j], height[i]) * rows for k in range(i+1, j): intrwaterlevel -= height[k] totalwaterlevel += intrwaterlevel i = j return totalwaterlevel"See full answer

    Software Engineer
    Data Structures & Algorithms
    +4 more
  • "Construct a min-heap either inplace, or by making a copy of the array and then applying heapify on that copy. This is done in O(n) time. Maintain two zero-initialised variables - sum and count. Keep popping off the heap while sum < k, and update count. In the worst case you will have to do n pops, and each pop is O(log n), so the algorithm would take O(n log n) in total. Space complexity depends on whether you're allowed to modify inplace or not, so either O(1) or O(n) respectively."

    Anonymous Wolf - "Construct a min-heap either inplace, or by making a copy of the array and then applying heapify on that copy. This is done in O(n) time. Maintain two zero-initialised variables - sum and count. Keep popping off the heap while sum < k, and update count. In the worst case you will have to do n pops, and each pop is O(log n), so the algorithm would take O(n log n) in total. Space complexity depends on whether you're allowed to modify inplace or not, so either O(1) or O(n) respectively."See full answer

    Software Engineer
    Coding
    +1 more
  • Goldman Sachs logoAsked at Goldman Sachs 
    +6

    "Less efficient version, yet effective for the interview: def is_palindrome(s: str) -> bool: dim = len(s) if dim str: dim = len(s) if dim < 2: return s left = 0 longest = "" while left < dim: righ"

    Gabriele G. - "Less efficient version, yet effective for the interview: def is_palindrome(s: str) -> bool: dim = len(s) if dim str: dim = len(s) if dim < 2: return s left = 0 longest = "" while left < dim: righ"See full answer

    Data Engineer
    Data Structures & Algorithms
    +3 more
  • Goldman Sachs logoAsked at Goldman Sachs 

    "standard answer for this."

    Shar N. - "standard answer for this."See full answer

    Software Engineer
    Coding
    +1 more
  • Data Scientist
    Concept
Showing 21-35 of 35