← Goldman Sachs Interview Insights

Goldman Sachs·Software Engineer·Technical Phone Screen·Intermediate

Intermediate
Jun 2026

Summary

Goldman Sachs SWE interview with a pretty meaty in-memory design problem. The whole session was basically one question about building a tree-structured workspace manager, and they cared a lot about edge cases and efficiency under scale.

Questions Asked (1)

Q1

Design and implement an in-memory workspace resource manager that supports a tree of folders and files, with operations to create, list, delete, and move resources, including cycle detection and recursive deletion.

System DesignAlgorithms & Data StructuresData Modeling
Author's notes

This one took me a while to even set up the data model.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and defining the data model (e.g., nodes with parent/child references). Then outline the core operations (create, list, delete, move) and discuss algorithms for cycle detection (e.g., DFS with visited set) and recursive deletion (post-order traversal). Finally, analyze time/space complexity and potential optimizations.

Pro tip: Emphasize thread-safety and concurrency considerations, as Goldman Sachs often deals with high-performance, multi-threaded systems. Mentioning locking strategies or concurrent data structures can set you apart.

1. Clarify Requirements and Constraints

Ask about expected scale, concurrency needs, and whether operations should be atomic. Confirm if paths are case-sensitive and if there are any restrictions on names.

2. Design the Data Model

Propose a tree structure where each node has a name, type (file/folder), parent pointer, and children map. Discuss trade-offs between adjacency list and other representations.

3. Implement Core Operations

Detail algorithms for create (add child), list (return children), delete (recursive post-order removal), and move (update parent pointers). Include cycle detection for move using ancestor traversal.

4. Address Edge Cases and Concurrency

Handle cases like moving a folder into itself, deleting root, and concurrent access. Discuss locking (e.g., fine-grained locks per node) or using concurrent collections.

5. Analyze Complexity and Optimizations

Provide time/space complexity for each operation (e.g., O(1) for create, O(n) for recursive delete). Suggest optimizations like caching or lazy deletion if needed.

Key Points to Mention

  • Tree data structure with parent and children references for efficient traversal.
  • Cycle detection using DFS or ancestor chain to prevent invalid moves.
  • Recursive deletion via post-order traversal to avoid orphaned nodes.
  • Thread-safety mechanisms such as read-write locks or concurrent hash maps.
  • Time and space complexity analysis for each operation.
  • Handling of edge cases: moving into self, deleting root, duplicate names.

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