← Goldman Sachs Interview Insights

Goldman Sachs·Software Engineer·Technical Phone Screen·Junior

JuniorPrefer not to say
May 2026London

Summary

Did a technical round for the DevOps SRE associate role at Goldman Sachs in London and walked out without writing a single line of code. The interviewer kept redirecting every question into a conceptual discussion, so what I expected to be a coding exercise turned into something closer to a verbal theory exam.

Questions Asked (2)

Q1

Given a forest of tree nodes, solve the related traversal or structural problem.

Algorithms & Data Structures
Author's notes

I knew the answer.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the exact problem (e.g., traversal order, structural property, or modification) and the forest representation (adjacency list, parent pointers, etc.). Then, discuss a recursive or iterative approach using DFS/BFS, analyzing time and space complexity, and handle edge cases like empty forest or single-node trees.

Pro tip: In a Goldman Sachs interview, explicitly connect your solution to real-world financial data processing, such as traversing hierarchical risk models or trade trees, to show business awareness.

1. Clarify the problem and input format

Ask questions to confirm the traversal type (pre-order, in-order, post-order, level-order), whether the forest is represented as an array of roots or adjacency lists, and any constraints (e.g., node values, tree size).

2. Choose the right traversal strategy

Decide between DFS (recursive or iterative with stack) and BFS (queue) based on the problem requirements, such as needing level-order or avoiding recursion depth issues.

3. Design the algorithm and handle edge cases

Outline the steps for traversing each tree in the forest, ensuring all nodes are visited exactly once. Consider edge cases: empty forest, single tree, skewed trees, and cycles (if not guaranteed acyclic).

4. Analyze complexity and optimize

State the time complexity O(N) where N is total nodes, and space complexity O(H) for DFS or O(W) for BFS. Discuss potential optimizations like iterative traversal to avoid stack overflow.

5. Test with examples and discuss trade-offs

Walk through a small example, verify correctness, and mention trade-offs between recursive and iterative approaches, or between different traversal orders.

Key Points to Mention

  • Time and space complexity analysis (O(N) time, O(H) or O(W) space)
  • Choice of data structures: stack for DFS, queue for BFS
  • Handling of multiple trees in a forest (e.g., iterating over roots)
  • Edge cases: empty forest, single node, skewed tree, large depth
  • Recursive vs iterative trade-offs (stack overflow risk, code simplicity)
  • Potential applications in finance (e.g., hierarchical data, risk trees)

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Implement a counter and calculate the number of hops in a cycle.

Algorithms & Data Structures
Author's notes

Same pattern as the first question.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the problem: determine whether the counter is a simple integer counter or a counter used in a cycle detection algorithm (e.g., Floyd's tortoise and hare). Then, implement the counter and the cycle detection logic, ensuring to count the number of hops (steps) taken to detect the cycle or to complete the cycle. Discuss time and space complexity, and consider edge cases such as no cycle or cycle at the start.

Pro tip: Demonstrate awareness of cycle detection algorithms like Floyd's and Brent's, and mention how to calculate cycle length once a cycle is detected. Also, emphasize the importance of handling large inputs efficiently, as financial systems often deal with high-frequency data.

1. Clarify the problem

Ask clarifying questions to understand what 'counter' and 'hops in a cycle' mean. Is it about detecting a cycle in a linked list or array? Or is it a counter that increments and wraps around? Confirm the expected input and output.

2. Choose an algorithm

Select an appropriate cycle detection algorithm (e.g., Floyd's tortoise and hare, Brent's algorithm) or design a simple counter with modulo arithmetic if the cycle is predefined. Explain your choice.

3. Implement the solution

Write clean, efficient code. For cycle detection, implement the chosen algorithm, ensuring to count the number of hops (steps) until the cycle is detected or the cycle length is computed. Handle edge cases like empty input or no cycle.

4. Analyze complexity

Discuss the time and space complexity of your solution. For Floyd's algorithm, it's O(n) time and O(1) space. Mention trade-offs if using other approaches.

5. Test and validate

Walk through test cases: a cycle at the beginning, middle, end, and no cycle. Verify that the hop count is correct. Consider large inputs and performance.

Key Points to Mention

  • Cycle detection algorithms: Floyd's tortoise and hare, Brent's algorithm
  • Time and space complexity: O(n) time, O(1) space for Floyd's
  • Edge cases: no cycle, cycle at head, single node cycle
  • Counting hops: steps until meeting point, then calculating cycle length
  • Counter implementation: integer overflow, modulo arithmetic for wrap-around
  • Real-world applications: detecting loops in financial transactions, linked lists

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.