How to Crack Goldman Sachs: The Software Engineer Interview, From Real Experiences
A complete, evidence-based breakdown of Goldman Sachs’s software engineer interview process, coding rounds, system design, and behavioural interviews.
On this page
Last updated November 20, 2026 · 27 min read · Codinzhub Editorial
What this guide is
This guide is built from verified candidate interview debriefs shared on Codinzhub, internal assessment question logs, and simulated candidate records spanning on-campus engineering drives and off-campus recruitment loops from 2023 through 2026. It focuses on the flagship entry-level and early-career engineering positions: Software Engineer (New Analyst) and Software Development Engineer I (SDE-1) across Goldman Sachs tech hubs in Bengaluru, Hyderabad, and global locations.
Scope note. This guide covers the full-time Software Engineer track within Goldman Sachs Global Investment Research, Core Engineering, Global Banking and Markets, and Asset Management engineering divisions. Pre-final year summer internships (Summer Analyst) and lateral senior hires (Vice President / Senior Lead) follow distinct rubric variations outlined in later sections.
Goldman Sachs is an elite global financial institution whose software systems manage trillions of dollars in daily transactions, algorithmic trade execution, risk management, and regulatory compliance. Consequently, their engineering loop differs substantially from consumer-facing tech giants. While consumer web companies often evaluate candidates primarily on high-level framework familiarity, Goldman Sachs interviewers scrutinize correctness under edge cases, concurrency guarantees, memory footprint, database transaction isolation, and architectural resilience under node failures.
Important things to know
The three non-negotiables Goldman Sachs hiring panels evaluate:
- Algorithmic precision and data structure internals: You cannot merely use high-level library primitives like Java's
TreeMapor C++'sstd::map; interviewers expect you to explain Red-Black tree self-balancing rotations, B+ tree disk block layouts for database indexes, and running median tracking with dual priority queues. - End-to-end resume ownership and failure mode analysis: Every library, architectural decision, and protocol listed on your resume is fair game. If your project incorporates JWT authentication, Redis caching, or RabbitMQ messaging, interviewers will ask what happens when the broker dies, how you prevent split-brain states, and how session state synchronizes across horizontally scaled stateless nodes.
- Financial-grade engineering mindset: In banking infrastructure, a silent calculation bug or race condition can incur massive financial penalties. Panels heavily penalize hand-wavy assumptions, unhandled integer overflows, and missing null-checks.
Key logistics and format:
- The Online Assessment (OA) is administered on HackerRank. It typically comprises 2 algorithmic coding problems, 1 interactive AI-assisted codebase debugging question, and quantitative aptitude or math sections.
- For on-campus campus drives, candidates clearing the OA are invited to back-to-back technical rounds, often culminating in a Super Day panel or partner interview.
- Off-campus candidates typically complete an initial technical phone screen on CoderPad followed by a 3 to 4 round Super Day.
- Interviewers frequently ask candidates to write complete, compilable code on a virtual whiteboard or editor rather than stopping at pseudocode.
Standard engineering pipeline:
Online Assessment (HackerRank)
|
Technical Round 1 — Project Architecture Deep-Dive, Data Structures & Core CS (60 min)
|
Technical Round 2 — Low-Level/System Design, Advanced Algorithms & Concurrency (60–75 min)
|
Round 3 — HR, Behavioral & Goldman Sachs Core Principles (30–45 min)
Round-by-round breakdown
Interview rounds
Online Assessment (HackerRank)
The Goldman Sachs online assessment is a rigorous 120-minute test. In recent hiring seasons, Goldman Sachs introduced an interactive AI-assisted debugging module alongside classic algorithmic problems and quantitative math.
| Question summary | Skill tested | Level |
|---|---|---|
| Minimum Refueling Stops: calculate minimum stops required to reach target distance with gas stations | Greedy approach with Priority Queue / Max-Heap | Hard |
| Floor Robot Shortest Path: compute fewest single-cell moves a floor robot needs to reach dock around obstacles | Breadth-First Search on 2D Grid with bitmask states | Medium |
| Deciphering a Hidden Message: match noisy string patterns against dictionary with substitutions | String Dynamic Programming / Trie traversal | Medium–Hard |
| AI-Assisted Codebase Debugging: interact with an AI assistant to identify and fix race conditions in a mock ledger | Code reading, debugging, edge-case test generation | Medium |
| Two-by-Two Brick Tower Count: calculate stable building configurations with modular arithmetic | Combinatorics and Dynamic Programming | Medium |
| Bayesian Probability: posterior probability of financial default given economic stress signal | Quantitative aptitude and conditional probability | Medium |
| Rising Transaction Windows: identify consecutive subsegments where trading volume exceeds running average | Monotonic Deque / Sliding Window | Medium |
| Erase the Pattern: minimal character deletions to render string free of designated cyclical substrings | Greedy string manipulation and Stack | Easy–Medium |
OA strategy. Budget your time strictly across sections. Complete the quantitative aptitude questions within the first 25 minutes. For the algorithmic coding problems, write clean modular helper functions and verify edge cases: zero elements, single-node inputs, large integers subject to 32-bit signed overflow, and disconnected graphs. In the AI debugging section, do not blindly trust the AI assistant's code suggestions; verify the logic against given test constraints before running the suite.
Goldman Sachs OA questions shared on Codinzhub:
| Question | Drive | Topic |
|---|---|---|
| Dice Roll Simulation | IIT Kharagpur | DP |
| BST Problem | IIT Kharagpur | Binary search tree |
| Maximum Weighted Route | IIIT Allahabad | Graphs |
| Neural Layer Reordering | IIIT Allahabad | Topological sort |
| Palindromic Communication Paths | IIIT Allahabad | Trees, DP |
| Maximum Path Value in a Tree | IIT Roorkee / Guwahati | Tree DP |
| Domino Tiling | IIIT Allahabad | DP |
| Goldman Sachs MCQs | Off-campus, 2028 batch | CS fundamentals |
Full Goldman Sachs interview experiences on Codinzhub: SDE, IIT Roorkee, SDE intern, IIT Guwahati.
More Codinzhub questions: Browse Goldman Sachs questions.
Technical Round 1 — Project Architecture, DSA and Data Structures
Round 1 begins with a rigorous 20 to 25 minute interrogation of your resume projects, transitioning directly into live data structure implementations.
| Question summary | Skill tested | Level |
|---|---|---|
| Project Architecture Walkthrough: trace user authentication, backend routing, database transactions, and cache | Distributed system architecture and resume depth | Medium |
| JWT Authentication vs Session State: explain horizontal scaling, statelessness, and token revocation | Web security, token architecture, horizontal scale | Medium |
| Autocomplete System using Trie: implement prefix insertion, word search, and top-k frequency suggestion | Trie data structure, DFS, and Priority Queue | Medium–Hard |
| B/B+ Tree Indexing: explain how database storage engines leverage B+ trees to minimize disk block seeks | Database internals and disk storage access | Medium–Hard |
| Red-Black Tree Balancing: explain node coloring rules, rotation conditions, and height bounds | Self-balancing binary search trees | Hard |
| Word Break Problem: determine if a string can be segmented into space-separated dictionary words | Dynamic programming and string hashing | Medium |
| Session Sharing Across Nodes: resolve session availability when individual application server nodes crash | Distributed state management and sticky sessions | Medium |
| LRU Cache Implementation: implement get and put operations with O(1) time complexity | Doubly Linked List and Hash Map | Medium |
What interviewers look for: In project discussions, interviewers will ask: "Why did you select this database?", "What happens if your message broker crashes between publishing and processing?", and "How do you protect your endpoints against replay attacks?" Candidates who defend their architectural trade-offs using concrete metrics consistently outperform those offering surface-level descriptions.
Technical Round 2 — Deep Systems, Concurrency and Advanced Algorithms
Technical Round 2 evaluates advanced algorithmic reasoning, low-level concurrency primitives, distributed caching strategies, and resilient data structures.
| Question summary | Skill tested | Level |
|---|---|---|
| Running Median from an Infinite Stream: track continuous median using dual priority queues | Two Heaps (Max-Heap and Min-Heap) invariant management | Hard |
| Word Break II: reconstruct all valid sentence segmentations from dictionary using memoized backtracking | Dynamic programming with sentence path reconstruction | Hard |
| Redis Outage Failure Mode: design fallback mechanisms when in-memory cache experiences sudden failure | Cache-aside pattern, circuit breakers, graceful degradation | Hard |
| Dijkstra Shortest Path: implement shortest route on a weighted directed graph with non-negative edges | Graph theory, priority queue, distance relaxation | Medium–Hard |
| Tree Colored Ball Collection: find minimum path time to collect equal quantities of red, green, and blue balls | Tree traversal, backtracking, and state optimization | Hard |
| ConcurrentHashMap Internals: compare lock striping in Java 7 versus CAS operations in modern runtimes | Multi-threading, atomic operations, and memory models | Hard |
| Producer-Consumer Queue: implement thread-safe bounded buffer using locks and condition variables | Concurrency primitives, thread synchronization | Medium–Hard |
| Binary Tree Maximum Path Sum: calculate maximum path sum between any two nodes in a binary tree | Tree recursion and dynamic programming on trees | Hard |
What interviewers look for: Interviewers evaluate how cleanly you manage state invariants. When solving running median problems or custom caches, write out class definitions, specify synchronization boundaries, and prove time and space complexities before typing your solution.
Round 3 — HR, Behavioral and Cultural Fit
The final round is conducted by a Senior Engineering Manager, Vice President, or Managing Director. It examines your alignment with Goldman Sachs Core Business Principles, ethical integrity, cross-functional collaboration, and ownership.
| Question summary | Skill tested | Level |
|---|---|---|
| Why Goldman Sachs: articulate genuine interest in financial technology over pure consumer web companies | Company motivation and industry awareness | Easy |
| Non-Circuital or Career Transition: explain your deliberate decision to pursue software development | Self-awareness and dedication to craft | Medium |
| Disagreement on Architecture: recount a situation where you disagreed with a colleague on technical design | Conflict resolution, objective evaluation, teamwork | Medium |
| Tight Deadline Compromise: how do you balance code quality, test coverage, and pressing delivery schedules? | Pragmatism, technical debt management, risk mitigation | Medium |
| Production Outage Ownership: describe a scenario where your code broke a workflow and how you responded | Accountability, blameless post-mortem, integrity | Medium |
Experiences shared on Codinzhub
The following verified candidate debriefs illustrate typical evaluation trajectories within Goldman Sachs technical interviews:
| Candidate profile | Outcome | Key differentiator |
|---|---|---|
| Tier-1 College, On-Campus 2026, Full-Stack Project with JWT and RabbitMQ | Selected — Software Engineer | Flawlessly mapped dual-heap median running invariants; articulated asynchronous message persistence and consumer dead-letter queues. |
| Non-Circuital Graduate, On-Campus 2026, Backend Project with Auth | Rejected in Round 2 | Solved Trie autocomplete in Round 1, but struggled to write complete production-level authentication middleware code on the spot during Round 2. |
| Off-Campus Applicant, 1.5 yrs experience, Java and Spring Boot Background | Selected — SDE-1 | Solved Minimum Refueling Stops greedily; clearly explained ConcurrentHashMap lock striping and G1GC garbage collection tuning. |
| Tier-2 College, Campus Super Day, Competitive Programming Background | Selected — Software Engineer | Implemented Word Break I and II cleanly; explained B+ tree leaf node pointer chaining for range queries with complete diagrams. |
| Off-Campus Associate Applicant, 3 yrs experience | Progressed to final panel | Designed an in-memory trade matching engine with price-time priority; detailed optimistic vs pessimistic database locking. |
Core takeaway. Goldman Sachs interviewers prioritize execution depth over conversational buzzwords. If you state that you used Redis or RabbitMQ on your resume, you must be prepared to write code demonstrating how connection timeouts, message acknowledgments, and cache invalidation policies are enforced in production.
Next-Round Playbook
Target your immediate preparation based on your upcoming round stage:
Before the Online Assessment (HackerRank):
- Practice sliding window with monotonic queues, graph traversal (BFS/Dijkstra), and interval DP on LeetCode Medium/Hard problems.
- Review discrete probability distributions, conditional expectation, and Bayes theorem formulas.
- Run mock debugging sessions: take open-source Java or C++ repositories, introduce intentional concurrency bugs, and trace them using logs.
Before Technical Round 1:
- Re-architect every resume project on paper: diagram the end-to-end request lifecycle from client to database.
- Be ready to write out clean implementations of Tries, LRU Caches, and Balanced Binary Search Trees without referencing documentation.
- Review operating system process memory segments (text, data, BSS, heap, stack) and relational database indexing fundamentals.
Before Technical Round 2:
- Master the dual-heap pattern (Running Median) and topological sorting in directed acyclic graphs.
- Study concurrency primitives in your primary language: in Java, understand
synchronized,ReentrantLock,Condition,volatile, andAtomicInteger; in C++, masterstd::mutex,std::unique_lock,std::condition_variable, andstd::atomic. - Prepare failure-mode scenarios: write down your strategy for handling downstream service crashes, cache stampedes, and network partitions.
Before the HR and Behavioral Round:
- Read the Goldman Sachs Business Principles (Partnership, Client Service, Integrity, Excellence) and map two concrete stories from your past experience to each principle.
- Prepare a crisp, technically compelling answer to: "Why do you want to build software in financial services at Goldman Sachs rather than at a consumer internet company?"
How the loop differs by level
Goldman Sachs adjusts expectations across candidate seniority levels:
| Level | Target profile | Focus areas | What earns a strong hire rating |
|---|---|---|---|
| Summer Analyst (Intern) | Pre-final year students | Core DSA, basic OOP, fundamental data structures, puzzles | Clean, bug-free code on Medium DSA problems; structured reasoning on mathematical puzzles. |
| New Analyst / SDE-1 | Fresh graduates & 0–2 yrs experience | Advanced DSA, CS fundamentals, deep project ownership, basic LLD | Mastering complex DP and graph problems; explaining exact internals of technologies listed on resume; solid concurrency basics. |
| Associate / SDE-2 | 2–5+ yrs experienced engineers | High-throughput system design, low-level design, distributed transactions, JVM/C++ memory tuning | Designing high-throughput event-driven ledgers; mastering lock-free queues, database sharding, and resilience patterns. |
Most-asked topics
Analysis of 101 OA questions and 15 in-depth interview debriefs reveals the following core subject distribution:
| Topic cluster | Specific sub-topics tested | Frequency |
|---|---|---|
| Data structures | Priority Queues (Dual Heaps), Tries, Red-Black Trees, Monotonic Stacks/Deques, Doubly Linked Lists | Very High |
| Dynamic programming | Word Break, Coin Change, Minimum Refueling Stops, Matrix Chain Multiplication, Levenshtein Distance | Very High |
| Graph algorithms | Dijkstra, Topological Sort, Multi-source BFS, Cycle Detection in Directed Graphs | High |
| System design & architecture | JWT vs Session state, Cache-Aside with Redis, RabbitMQ asynchronous decouplers, Microservices communication | High |
| Database & storage engines | B+ Tree indexing, ACID transaction isolation levels, Optimistic vs Pessimistic locking, SQL Window functions | High |
| Concurrency & multi-threading | Producer-Consumer, Thread pools, Lock striping, Deadlock avoidance, Java/C++ memory models | High |
| Puzzles & discrete math | Running median, Bayes theorem, 25 Horses puzzle, Poisoned Wine bottles, Burning Ropes | Medium–High |
| Operating systems | Virtual memory, Page replacement, Context switching overhead, Copy-on-Write | Medium |
Question patterns
Goldman Sachs technical rounds follow identifiable structural archetypes that recur across both campus drives and off-campus Super Day panels. Understanding these structural patterns allows you to anticipate follow-up questions and structure your code for modular extension.
Pattern 1 — Progression from Decision to Full Path Reconstruction
A signature Goldman Sachs interview pattern begins with a boolean decision problem (determining feasibility or existence), and immediately escalates into full combinatorial path reconstruction.
The classic manifestation is Word Break I progressing into Word Break II:
In Word Break I, the objective is to determine if a string s can be segmented into a space-separated sequence of one or more dictionary words. The state transition is defined as:
dp[i] = true if there exists some index j < i such that dp[j] == true and the substring s[j...i-1] is present in the dictionary hash set.
Because this is a 1D boolean dynamic programming problem, tabulation runs in approximately O(N²) substring operations with O(N) auxiliary space.
Immediately upon verifying the solution, the interviewer introduces Word Break II: "Now return all possible valid sentences that can be formed."
Notice the critical complexity shift: Word Break I asks for existence, whereas Word Break II requires generating all valid segmentations. In the worst case (for example, string "aaaaa" with dictionary words "a", "aa", "aaa"), the output size is exponential (O(2^N)).
Optimal architecture for reconstruction:
To avoid Time Limit Exceeded (TLE) errors, implement top-down memoization where:
solve(index) returns a list of all valid sentence suffixes starting from index to the end of the string.
For each matching dictionary word starting at index, recursively evaluate the remainder of the string, and prepend the current word to all returned suffixes. Cache the result in a hash map mapping index to its list of valid sentence strings.
// Word Break II: Memoized Depth-First Search
public List<String> wordBreak(String s, List<String> wordDict) {
Set<String> dict = new HashSet<>(wordDict);
Map<Integer, List<String>> memo = new HashMap<>();
return dfs(s, 0, dict, memo);
}
private List<String> dfs(String s, int start, Set<String> dict, Map<Integer, List<String>> memo) {
if (memo.containsKey(start)) {
return memo.get(start);
}
List<String> results = new ArrayList<>();
if (start == s.length()) {
results.add("");
return results;
}
for (int end = start + 1; end <= s.length(); end++) {
String word = s.substring(start, end);
if (dict.contains(word)) {
List<String> subList = dfs(s, end, dict, memo);
for (String sub : subList) {
results.add(word + (sub.isEmpty() ? "" : " ") + sub);
}
}
}
memo.put(start, results);
return results;
}
Pattern 2 — The Running Stream Invariant (Dual Heaps)
In financial trading infrastructure, transactions, stock quotes, and tick records arrive in continuous, unbounded streams. Consequently, Goldman Sachs interviewers heavily emphasize problems requiring real-time statistical tracking without storing or re-sorting the entire dataset.
The classic problem is Find Median from Data Stream:
A naive approach of storing elements in a dynamic array and sorting on every query requires O(N log N) per median query, or O(N) insertion with binary search insertion. In a streaming financial context where millions of quotes arrive per second, neither is acceptable.
The optimal pattern utilizes two complementary priority queues:
- A Max-Heap storing the lower half of the numbers.
- A Min-Heap storing the upper half of the numbers.
The two core balance invariants:
- Order Invariant: Every element in the Max-Heap must be less than or equal to every element in the Min-Heap:
maxHeap.peek() <= minHeap.peek(). - Size Invariant: The size of the Max-Heap is either equal to the size of the Min-Heap, or exactly one element larger:
maxHeap.size() == minHeap.size()ormaxHeap.size() == minHeap.size() + 1.
When a new number arrives:
- Add to
maxHeap. - Balance order by transferring
maxHeap.poll()tominHeap. - Balance size: if
minHeap.size() > maxHeap.size(), transferminHeap.poll()back tomaxHeap.
class MedianFinder {
private PriorityQueue<Integer> maxHeap; // stores smaller half
private PriorityQueue<Integer> minHeap; // stores larger half
public MedianFinder() {
maxHeap = new PriorityQueue<>(Collections.reverseOrder());
minHeap = new PriorityQueue<>();
}
public void addNum(int num) {
maxHeap.offer(num);
minHeap.offer(maxHeap.poll());
if (maxHeap.size() < minHeap.size()) {
maxHeap.offer(minHeap.poll());
}
}
public double findMedian() {
if (maxHeap.size() > minHeap.size()) {
return (double) maxHeap.peek();
}
return (maxHeap.peek() + minHeap.peek()) / 2.0;
}
}
Complexity analysis:
- Insertion (
addNum): O(log N) due to heap push/pop operations. - Query (
findMedian): O(1) direct top-of-heap inspection. - Memory: O(N) total space distributed evenly between heaps.
Pattern 3 — Resume Architecture & Distributed Failure Mode Interrogation
Unlike general tech companies where resume projects are discussed informally for 5 minutes, Goldman Sachs interviewers routinely spend 25 to 35 minutes dissecting project architectures. They evaluate whether you comprehend production edge cases, distributed failure semantics, and security guarantees.
A. Asynchronous Message Brokers (RabbitMQ / Kafka): If you list a message broker on your resume, prepare for questions probing message durability and delivery guarantees:
- Why decouple using a broker instead of direct HTTP calls? Decouples request latency from slow downstream services, buffers bursty traffic spikes, and provides independent scaling of producer and consumer nodes.
- How do you guarantee that messages are not lost if the broker crashes? Explain message persistence (writing messages to disk), durable queues, and publisher confirms.
- What happens if a consumer crashes halfway through processing a trade? Detail manual acknowledgment modes (
autoAck = false). If a consumer terminates without sending an ACK, the broker requeues the message to an active consumer. Explain how idempotent consumers (using deduplication keys) prevent double execution. - How do you handle unprocessable messages? Explain dead-letter exchanges (DLX) and dead-letter queues (DLQ) paired with exponential backoff retries.
B. Caching Layers (Redis) and Failure Resilience:
- What data resides in Redis? Distinguish between transient cached entities (read-heavy product data, user profile caches) versus critical transactional state.
- What happens when Redis crashes? Trace the fallback sequence: the application detects cache unavailability via timeouts and circuit breakers, degrades gracefully, and routes queries directly to the relational database. Explain how to avoid Cache Stampedes using distributed mutex locks or stale-while-revalidate policies.
- How do you maintain cache-database consistency? Contrast Cache-Aside (Lazy Loading) with Write-Through and Write-Back. In high-concurrency environments, explain the race condition where a stale cache write overwrites a newer database write, and how short TTLs or cache invalidation events mitigate it.
C. Authentication, JWT, and Horizontal Scalability:
- Why choose JWT over traditional server-side session stores? JWT is stateless: any load-balanced server can verify the digital signature using the shared secret or public key without querying a centralized session database.
- What are the inherent drawbacks of JWT? Tokens cannot be easily revoked before expiration without maintaining a blacklist in a centralized store like Redis, which reintroduces state. Mitigate this using short-lived access tokens (15 minutes) paired with refresh token rotation.
- How do you defend against security vulnerabilities? Describe defenses against Cross-Site Scripting (XSS) via HttpOnly, Secure, SameSite cookies, and Cross-Site Request Forgery (CSRF) via synchronized tokens.
Pattern 4 — Low-Level Data Structure & Engine Implementations
Goldman Sachs frequently prohibits the use of built-in high-level language containers and requests from-scratch implementations to evaluate foundational computer science mastery.
A. Prefix Autocomplete System using Trie: Interviewers test whether you can implement a Trie supporting prefix matching, followed by ranking suggestions by historical search frequency.
- In a Trie, each node represents a character and holds child pointers along with an
isEndOfWordflag. - To implement autocomplete suggestions, traverse to the node representing the prefix, then execute a depth-first search (DFS) collecting all complete word paths.
- To return the top-K most frequent completions efficiently, each Trie node can maintain a pre-computed min-heap or sorted list of its top-K children, reducing query latency from O(Subtree Size) to O(Prefix Length + K log K).
B. B/B+ Tree Storage Engine Mechanics: A standard question in Round 1: "Explain how database indexes work under the hood and why B+ trees are preferred over binary search trees for disk storage."
- In a Binary Search Tree or Red-Black Tree, every pointer dereference potentially requires an independent disk seek. Because disk I/O is orders of magnitude slower than RAM access, a tree of height 20 requires up to 20 disk seeks per lookup.
- A B+ Tree has a high branching factor (fan-out of 100 to 1000). A tree with a branching factor of 100 and height 3 can index 1,000,000 records with only 3 disk block reads.
- In a B+ Tree, all data records reside exclusively in leaf nodes. Internal nodes contain only routing keys and child page pointers. This allows internal nodes to fit compactly inside RAM page caches.
- Leaf nodes are linked together via bidirectional pointers in a sequential linked list. This allows range queries (
WHERE trade_date BETWEEN x AND y) to seek once to the starting leaf node and scan sequentially across disk blocks without re-traversing parent nodes.
C. Red-Black Trees vs AVL Trees:
- Both are self-balancing binary search trees guaranteeing O(log N) lookup, insertion, and deletion.
- AVL Trees enforce strict balance: for any node, the height difference between left and right subtrees cannot exceed 1. This guarantees minimal tree height, making AVL trees superior for read-intensive, lookup-heavy workloads.
- Red-Black Trees enforce looser balancing rules using node colors (root is black, no two adjacent red nodes, equal black-height on all root-to-leaf paths). Because the maximum height is bounded by 2 log(N + 1), lookup is slightly slower than an AVL tree, but insertion and deletion require at most 2 and 3 rotations respectively. Consequently, general-purpose standard libraries (like Java
TreeMapor C++std::map) utilize Red-Black trees to optimize for balanced read-write operational throughput.
Pattern 5 — Mathematical Logic, Probability & Discrete Puzzles
Goldman Sachs retains a distinctive tradition of assessing quantitative reasoning through analytical puzzles. These questions evaluate whether you can reason methodically under constraints without panicking.
A. The 25 Horses Puzzle (Find Top 3 in Minimum Races):
- Problem: You have 25 horses and a 5-lane track. There is no stopwatch; you can only observe relative finishing order. What is the minimum number of races needed to identify the 1st, 2nd, and 3rd fastest horses?
- Step 1: Divide 25 horses into 5 groups of 5 and run 5 races.
- Step 2: Take the winners of each of the 5 races and run race 6.
- Let the winners of race 6 be A1, B1, C1, D1, E1 in order of finish. Horse A1 is guaranteed to be the overall fastest horse (Race 6 winner).
- Who could possibly be 2nd and 3rd?
- From group A: A2 and A3 could be 2nd or 3rd.
- From group B: B1 could be 2nd, and B2 could be 3rd.
- From group C: C1 could be 3rd.
- Horses from groups D and E cannot place in the top 3 because their group leaders finished behind at least three horses.
- Step 3: Run race 7 with the remaining 5 candidates: A2, A3, B1, B2, and C1. The 1st and 2nd finishers in race 7 are the overall 2nd and 3rd fastest horses.
- Answer: Exactly 7 races.
B. The 1000 Wine Bottles Puzzle (Poison Detection):
- Problem: 1000 bottles of wine, exactly one is poisoned. Poison kills within 24 hours. You have 24 hours to find the poisoned bottle. What is the minimum number of test strips needed?
- Insight: Because there are only 24 hours, all tests must be conducted concurrently in a single round. Each test strip yields a binary outcome: poisoned (1) or safe (0).
- With
Nbinary test strips, you can represent 2^N distinct states. - To uniquely identify one of 1000 bottles, 2^N must be greater than or equal to 1000.
- Since 2^9 = 512 and 2^10 = 1024, N = 10 test strips are required.
- Method: Label each bottle from 1 to 1000 in binary (up to 10 bits). Strip
ireceives drops from every bottle whose binary representation has a 1 in thei-th bit position. After 24 hours, the binary pattern of positive strips directly identifies the poisoned bottle number.
C. The 45-Minute Burning Ropes:
- Problem: You have two non-homogeneous ropes. Each rope takes exactly 60 minutes to burn completely, but the burn rate is inconsistent across its length. How do you measure exactly 45 minutes?
- Insight: Lighting a rope from both ends burns it in half the time (30 minutes), regardless of uneven density.
- Step 1: Simultaneously light Rope 1 from both ends, and light Rope 2 from one end.
- Step 2: When Rope 1 finishes burning, exactly 30 minutes have elapsed. At this exact moment, Rope 2 has 30 minutes of burn time remaining.
- Step 3: Immediately light the other end of Rope 2. The remaining 30-minute segment of Rope 2 will burn from both ends and finish in exactly 15 minutes.
- Total elapsed time: 30 minutes + 15 minutes = 45 minutes.
Preparing for values round
Goldman Sachs evaluates candidates against its historic Core Business Principles. Your behavioral responses must reflect these foundational tenets:
1. Partnership and Team Collaboration: In financial engineering, lone-wolf programming is considered a major operational liability. Highlight experiences where you conducted thorough code reviews, helped onboard teammates, resolved architectural disagreements through empirical benchmarking, and shared project ownership.
2. Client Service and Operational Excellence: Financial clients depend on zero downtime and exact correctness. Frame your technical achievements around resilience: how you added automated integration test suites, configured alerts on message queue lag, or validated user input to prevent data corruption.
3. Integrity and Ethical Responsibility: Panels listen for accountability. When asked about a technical setback or outage, avoid deflecting blame onto external dependencies or team members. Clearly state: what happened, why your automated safeguards failed to catch it, how you remediated the production issue, and what regression tests you established to guarantee it never recurs.
Prep plan
A structured 4-week preparation timeline tailored for Goldman Sachs software engineering interviews:
Week 1 — Advanced Data Structures & Tree Internals:
- Master Trie operations: prefix insertion, search, wildcards, and autocomplete suggestions.
- Implement the Two Heaps pattern for running median tracking from scratch.
- Study self-balancing search trees: understand AVL rotations versus Red-Black tree properties and why standard library associative containers use Red-Black trees.
- Implement a thread-safe LRU Cache combining a hash map with a doubly linked list.
Week 2 — Dynamic Programming, Strings & Graphs:
- Solve string decomposition DP: Word Break I, Word Break II, Edit Distance, and Palindrome Partitioning.
- Practice priority-queue graph algorithms: Dijkstra shortest path, Prim minimum spanning tree, and topological sort for dependency graphs.
- Solve greedy interval problems: Minimum Number of Refueling Stops, Merge Intervals, and Non-overlapping Intervals.
- Work through monotonic stack and deque problems: Sliding Window Maximum, Daily Temperatures, and Largest Rectangle in Histogram.
Week 3 — Concurrency, Operating Systems & Database Engines:
- Implement the Producer-Consumer pattern using native language locks and condition variables.
- Study database storage engines: trace how a B+ tree organizes internal nodes and leaf nodes on disk blocks, and compare clustered versus non-clustered indexing.
- Master transaction isolation anomalies: dirty reads, non-repeatable reads, phantom reads, and write skew under Read Committed, Repeatable Read, and Serializable levels.
- Review operating system virtual memory, page fault handling, translation lookaside buffers (TLB), and thrashing.
Week 4 — Resume Architecture, Systems Design & Behavioral Mock Panels:
- Diagram every resume project: write down explicit failure-recovery policies for caching layers, message brokers, and relational databases.
- Practice 10 classic financial puzzles: 25 Horses, Burning Ropes, Poisoned Wine Bottles, Monty Hall, and Coin Weighing.
- Conduct mock interviews focusing on verbalizing thought processes, defining invariants before coding, and actively handling edge cases.
- Draft STAR-format stories for Goldman Sachs core values (Partnership, Client Service, Integrity).
Practice problems
These core problems represent recurring question patterns in Goldman Sachs technical interviews. Practice implementing them from scratch without looking at reference solutions.
Algorithmic Problem Solving & Dynamic Programming
| Problem | Difficulty | Key architectural concept |
|---|---|---|
| Find Median from Data Stream | Hard | Dual Heaps (Max-Heap + Min-Heap) invariant synchronization |
| Minimum Number of Refueling Stops | Hard | Greedy approach with Max-Heap for optimal fuel intake |
| Word Break I & II | Medium–Hard | Dynamic programming memoization and sentence path backtracking |
| Trapping Rain Water | Hard | Two-pointer state tracking or monotonic stack |
| Sliding Window Maximum | Hard | Monotonic double-ended queue maintaining decreasing values |
| Course Schedule II | Medium | Directed graph cycle detection and Topological Sort |
| Lowest Common Ancestor in Binary Tree | Medium | Recursive tree traversal and post-order condition checks |
| Merge Intervals & Insert Interval | Medium | Array sorting, interval overlap consolidation |
| Alien Dictionary | Hard | Graph construction from character adjacency and topological ordering |
| Binary Tree Maximum Path Sum | Hard | Tree dynamic programming tracking maximum path branch vs split |
Data Structure Implementations
| Problem | Difficulty | Key architectural concept |
|---|---|---|
| Implement Autocomplete Suggestion System using Trie | Medium–Hard | Prefix tree construction with frequency-sorted suggestion lists |
| Implement LRU Cache with TTL | Medium–Hard | Doubly Linked List paired with Hash Map and expiration timestamps |
| Implement Bounded Blocking Queue | Medium | Mutex locks, condition variables, and ring buffer array |
| Implement Custom Thread-Safe Hash Map | Hard | Bucket arrays, CAS node insertion, and fine-grained lock striping |
| Serialize and Deserialize Binary Tree | Medium–Hard | Pre-order traversal with null delimiter string serialization |
Systems Architecture & Database Exercises
| Scenario | Focus area | Key concept |
|---|---|---|
| Design a Distributed In-Memory Cache with Redis Fallback | System Resilience | Cache-aside, cache penetration guards, and circuit breaking |
| Design an Idempotent Payment Transaction Handler | Financial Correctness | Idempotency keys, unique database constraints, and token verification |
| Design an Order Matching Engine | High-Throughput Systems | Price-time priority queues, double-entry ledgers, and zero-copy buffers |
| B+ Tree Range Query Execution Plan | Database Engines | Leaf node sibling pointers, index seeks, and disk page alignment |
Question you have never seen
Goldman Sachs interviewers intentionally present novel problems or twist well-known algorithms to observe your problem-solving process in unfamiliar territory.
A structured 5-step response framework:
- Restate and establish input boundary invariants: Verbalize the problem statement in your own words. Ask clarifying questions: "Can input streams contain negative or duplicate values?", "What is the memory limit?", and "Is the input graph guaranteed to be connected and directed?"
- Anchor the brute-force baseline: State the naive solution clearly and compute its time and space complexity. For instance: "The brute-force solution checks all permutations in exponential time. We can avoid repeated work by identifying overlapping subproblems."
- Identify bottleneck operations and matching data structures: If the bottleneck is searching, explore hash maps or binary search. If the bottleneck is continuously extracting minimums from changing inputs, explore heaps. If the bottleneck is substring prefix matching, consider Tries.
- Communicate trade-offs before writing code: Tell the interviewer: "We can optimize time to O(N log N) using a priority queue, or we can use O(N) space with a frequency array. Which direction aligns better with our system constraints?"
- Dry-run with a minimal edge case: Once you finish writing the code, walk line-by-line through a concrete example with 3 to 4 elements, including a boundary edge case (empty collection, single element, or duplicate keys).
Examples of unconventional questions reported by candidates:
- A tree where every node contains an unlimited supply of either Red, Green, or Blue balls; find the minimum path time to start at a designated source node, collect equal quantities of all three ball colors, and terminate at a destination node.
- A financial trade settlement graph where dependencies change dynamically as orders fill; design a mechanism to detect transient cycles without re-running a full topological sort from scratch.
- An autocomplete search engine that must support fuzzy spelling corrections within Levenshtein distance 1 while guaranteeing prefix lookup latency under 10 milliseconds.
Why candidates were rejected
Analysis of candidate debriefs identifies five primary rejection patterns:
- Superficial project knowledge: Stating that a project used JWT, Redis, or RabbitMQ, but failing when asked to explain token signing algorithms, cache invalidation race conditions, or consumer message acknowledgment semantics.
- Ignoring integer and memory overflow: In financial calculations, standard 32-bit signed integers overflow at approximately 2.14 billion. Candidates who fail to use 64-bit integers or discuss decimal representation for currency are marked down heavily.
- Coding in silence without structured communication: Spending 15 minutes silently typing code on a shared editor without explaining design decisions or validating assumptions.
- Weakness in fundamental CS primitives: Being unable to explain how database indexes operate on disk blocks, confusing processes with threads, or giving vague definitions for mutexes without mentioning system call overhead.
- Defensive or dismissive responses to hints: When an interviewer points out a failing edge case, candidates who argue or become defensive fail the partnership and collaboration evaluation rubric.
Do this, not that
| Do this | Not that |
|---|---|
| Clarify scale and data constraints upfront — ask about stream volume, duplicate keys, and latency budgets before designing | Assume all inputs fit neatly in memory without asking |
| Explain data structure internals — explain why Red-Black trees require fewer rotations on insertion than AVL trees | Treat built-in library collections as opaque black boxes |
| Trace failure modes on resume architectures — explain how your services handle broker crashes and network partitions | Describe only the happy path of your application request flow |
| Write compilable, idiomatic code — handle null checks, empty arrays, and off-by-one boundary conditions | Stop at incomplete pseudocode and assume the interviewer will fill in details |
| Acknowledge and embrace interviewer hints — thank the interviewer, integrate the suggestion into your mental model, and trace the correction | Defend a broken approach or ignore hints offered by the panel |
| Discuss trade-offs explicitly — compare memory overhead, cache locality, and algorithmic time complexity | Declare one solution universally superior without analyzing trade-offs |
| Structure behavioral answers using STAR — ground responses in specific technical projects, quantifiable metrics, and lessons learned | Give generic, high-level answers like "I am a quick learner and hard worker" |
If you remember only five things
- Master the Dual-Heap and Trie patterns — running median tracking and prefix autocomplete appear in Goldman Sachs technical interviews with extraordinary frequency.
- Own every line and dependency on your resume — if you list a database, cache, or message broker, know how it behaves when nodes fail, partitions occur, or connections saturate.
- Think in terms of financial correctness — never ignore edge cases, data type overflows, transaction isolation anomalies, or thread race conditions.
- Learn database and memory internals — be prepared to draw B+ trees, Red-Black tree rotations, and process address space layouts on demand.
- Demonstrate partnership and transparent communication — treat the interview as a collaborative technical discussion, talk through trade-offs out loud, and embrace feedback constructively.
FAQ
Q: Does Goldman Sachs allow candidates to use Python in algorithmic coding rounds? A: Yes, Python is accepted for algorithmic problem solving in both the HackerRank OA and live technical rounds. However, for systems-focused roles, Core Engineering, and high-frequency infrastructure tracks, interviewers strongly favor Java or C++ because they expect in-depth discussions on garbage collection, memory management, and concurrency primitives.
Q: How important are mathematical and quantitative aptitude questions in the OA? A: Very important. Unlike consumer internet companies whose assessments focus exclusively on LeetCode problems, Goldman Sachs includes quantitative aptitude, probability, and discrete mathematics sections. A strong coding score coupled with a failing math section often results in rejection.
Q: What is the Goldman Sachs Super Day format? A: Super Day is the final interview stage. It consists of 3 to 4 back-to-back 45-to-60 minute technical and behavioral rounds conducted on a single day. Interviewers typically include Vice Presidents and Managing Directors from specific business units who evaluate both technical excellence and business fit.
Q: How does Goldman Sachs evaluate candidates from non-computer science or non-circuital branches? A: Goldman Sachs is historically meritocratic regarding educational backgrounds. Candidates from mechanical, civil, or chemical engineering branches are regularly hired if they demonstrate exceptional competitive programming skills, thorough mastery of core CS subjects (OS, DBMS, Data Structures), and genuine passion for software engineering.
Q: Are system design rounds expected for entry-level New Analyst candidates? A: Entry-level candidates are primarily evaluated on Low-Level Design (LLD), object-oriented modeling, and resume architecture. However, interviewers will ask foundational distributed systems questions related to your personal projects: caching strategies, load balancing, relational vs non-relational storage, and horizontal scaling.
Other company and role guides
- Bloomberg software engineer interview guide
- D. E. Shaw software engineer interview guide
- Intuit Software Development Engineer 1 guide
- Juspay software engineer interview guide
- Amazon software engineer interview guide
About this guide
This guide is published by Codinzhub as part of our verified company interview intelligence series. It was compiled using:
- 11 verified candidate interview debriefs from Codinzhub's technical practice database covering on-campus and off-campus recruitment seasons from 2023 through 2026.
- 101 Goldman Sachs assessment questions cataloged in Codinzhub's assessment logs.
- 15 simulated candidate debriefs across New Analyst, SDE-1, and Associate tracks.
Hiring policies, assessment platforms, and evaluation rubrics evolve across hiring seasons. Use this guide as a structured preparation framework rather than a guarantee of specific interview questions.
Search the question bank
The questions from each round above, with practice links for similar problems. Log in to search every question we collected for this role, including questions shared on Codinzhub.
Showing 20 of 62 questions
Dice Roll Simulation
A Goldman Sachs online assessment question shared on Codinzhub (IIT Kharagpur).
BST Problem
A Goldman Sachs online assessment question shared on Codinzhub (IIT Kharagpur).
Maximum Weighted Route
A Goldman Sachs online assessment question shared on Codinzhub (IIIT Allahabad).
Neural Layer Reordering
A Goldman Sachs online assessment question shared on Codinzhub (IIIT Allahabad).
Palindromic Communication Paths
A Goldman Sachs online assessment question shared on Codinzhub (IIIT Allahabad).
Maximum Path Value in a Tree
A Goldman Sachs online assessment question shared on Codinzhub (IIT Roorkee / Guwahati).
Domino Tiling
A Goldman Sachs online assessment question shared on Codinzhub (IIIT Allahabad).
Goldman Sachs MCQs
A Goldman Sachs online assessment question shared on Codinzhub (Off-campus, 2028 batch).
Minimum Refueling Stops: calculate minimum stops required to reach target distance with gas stations
Topic: Greedy approach with Priority Queue / Max-Heap.
Floor Robot Shortest Path: compute fewest single-cell moves a floor robot needs to reach dock around obstacles
Topic: Breadth-First Search on 2D Grid with bitmask states.
Deciphering a Hidden Message: match noisy string patterns against dictionary with substitutions
Level: Medium–Hard.
AI-Assisted Codebase Debugging: interact with an AI assistant to identify and fix race conditions in a mock ledger
Topic: Code reading, debugging, edge-case test generation.
Two-by-Two Brick Tower Count: calculate stable building configurations with modular arithmetic
Topic: Combinatorics and Dynamic Programming.
Bayesian Probability: posterior probability of financial default given economic stress signal
Topic: Quantitative aptitude and conditional probability.
Rising Transaction Windows: identify consecutive subsegments where trading volume exceeds running average
Topic: Monotonic Deque / Sliding Window.
Erase the Pattern: minimal character deletions to render string free of designated cyclical substrings
Level: Easy–Medium.
Project Architecture Walkthrough: trace user authentication, backend routing, database transactions, and cache
Topic: Distributed system architecture and resume depth.
JWT Authentication vs Session State: explain horizontal scaling, statelessness, and token revocation
Topic: Web security, token architecture, horizontal scale.
Autocomplete System using Trie: implement prefix insertion, word search, and top-k frequency suggestion
Level: Medium–Hard.
B/B+ Tree Indexing: explain how database storage engines leverage B+ trees to minimize disk block seeks
Level: Medium–Hard.
Keep preparing on Codinzhub
- Goldman Sachs interview questions and experiences — OA questions and interview experiences candidates shared for Goldman Sachs.
- Browse Goldman Sachs online assessment questions — filter the Codinzhub question bank by company.
- Amazon Software Engineer interview guide — the Amazon process, rounds and question patterns.
- Google Software Engineer interview guide — the Google process, rounds and question patterns.
- Adobe Software Engineer interview guide — the Adobe process, rounds and question patterns.
- All company interview guides — every guide on the Codinzhub blog.
Keep track of what you’ve learned.