Goldman Sachs Coding Interview Questions
39 coding questions reported by candidates who interviewed at Goldman Sachs, out of 44 Goldman Sachs questions we track. They average 2.7/5 difficulty (medium). Most common topics: Array, Hashmap, String, Simulation. 3 were reported asked within the last year, most recently in July 2026.
Practice Goldman Sachs questions →Difficulty
- 1/5 — warm-up2
- 2/5 — easy14
- 3/5 — medium19
- 4/5 — hard3
- 5/5 — very hard1
Asked for SWE (38), MLE (3), RS (1), Quant (1)
Reported Goldman Sachs coding questions
Highest Average Score Per Person
2/5In this Goldman Sachs interview question, you are given a collection of identity and score pairs to determine the highest average performance achieved by any single individual. The challenge requires careful data aggregation, handling potential edge cases, and considering a streaming follow-up where metrics update dynamically. It assesses your data manipulation and algorithmic efficiency. Access to the full problem text, follow-up variations, and model implementation requires a subscription.
asked July 2026ArrayHashmapAggregationTransaction Authorizer With Fraud Rules
3/5In this reported interview question from Goldman Sachs, you are tasked with building an in-memory credit card transaction authorizer that evaluates incoming purchases against multiple security and fraud policies. The system must efficiently handle global restrictions, user-specific merchant category blocks, and velocity spending limits over sliding time windows. This challenge examines your aptitude for designing robust data structures and enforcing complex business rules in real time. To view the complete problem statement and optimal solution, a subscription is required.
asked February 2026HashmapObject DesignPaymentMaximize the Minimized Three-Server Difficulty Split
4/5Faced during interviews at Goldman Sachs, this algorithmic puzzle requires you to distribute a collection of workload values across a trio of destinations, then select specific items from each group to maximize a particular absolute difference metric. You will need to apply advanced search and grouping strategies to explore optimal configurations under strict constraints. Access to the full problem breakdown, edge-case scenarios, and the complete reference solution requires a subscription.
asked November 2025ArrayGreedySortingProcess Starvation Time
3/5Reported as a Goldman Sachs coding challenge, this problem asks you to calculate the waiting periods for elements processed in reverse order based on their priority levels. It tests your ability to efficiently identify relative dominance and compute duration metrics using stack-based or monotonic algorithmic patterns. This exercise evaluates your knack for handling reverse chronological dependencies and queue dynamics under strict constraints. Gain immediate access to the full problem statement and expert solution by subscribing.
asked September 2025ArrayMonotonic StackSimulationCount Square Subgrids For Each Query
2/5This Goldman Sachs interview question presents a combinatorial challenge involving grid geometry. For each given set of grid dimensions (rows and columns), your task is to determine the total number of square subgrids that can be formed within it, considering all possible side lengths. This problem requires a systematic approach to counting and an understanding of how the number of possible squares changes with increasing side length relative to the grid dimensions. It's a good test of your mathematical reasoning and ability to derive a general formula. The full problem and model solution require a subscription.
asked September 2025MathGridCombinatoricsEqualize Letter Frequencies With Add / Remove
3/5Find the fewest single-letter additions or deletions that leave every letter still present in a word appearing the same number of times. This Goldman Sachs question is a counting problem with a search over targets: each candidate common frequency implies a cost, and the minimum across candidates is the answer. You will tabulate letter frequencies, evaluate each target frequency, and remember that deleting a letter entirely is allowed. Subscribers can read the complete problem and the model solution.
asked September 2025StringHashmapGreedyMinimum Selections To Clear Author Grid
4/5This challenging Goldman Sachs problem presents a grid representing a library shelf, where each cell contains an author ID. The task is to clear the entire grid by performing a special operation: selecting a cell removes all books by that specific author found in the selected cell's row or column. The core objective is to determine the minimum number of cell selections required to eliminate every book from the shelf. This question delves into advanced combinatorial optimization and potentially graph-based modeling, requiring careful strategic thinking to find an optimal solution. The full problem and model solution require a subscription.
asked September 2025GridGraphBipartite MatchingDecode Ways
3/5This classic combinatorial problem, frequently asked at Goldman Sachs, requires you to calculate the total number of valid alphabetical decodings for a given numeric string based on standard letter-to-number mappings. It tests your dynamic programming intuition and edge-case management, particularly regarding zero-handling and single- versus double-digit conversions. The complete problem statement, underlying logic, and optimal code solution are available exclusively to subscribers.
asked July 2025CountingDynamic ProgrammingStringMerge K Sorted Lists (including K=3)
3/5Master a classic sequence combination challenge frequently featured in technical screens at Goldman Sachs, where you must consolidate multiple ordered collections into a single sorted stream. This scenario tests your proficiency with data structure optimization, comparing heap-based priority queues against manual merging techniques depending on the collection count. Success requires balancing time and space efficiency while handling edge cases smoothly. Unlock the comprehensive problem breakdown and optimal code solution with a paid subscription.
asked June 2025HeapLinked ListMergeFirst Missing Positive
4/5This classic coding assessment, frequently encountered in Goldman Sachs interviews, challenges you to identify the smallest missing positive integer in an unsorted collection of numbers. The problem tests your mastery of in-place array manipulation, constant auxiliary space complexity, and clever index-mapping techniques to achieve linear time performance. To view the full problem statement, algorithmic analysis, and thoroughly commented model code, a paid subscription is required.
asked June 2025ArrayCyclic SortIn PlaceExtend Queue: Min-Size And Min-Sum Selectors
3/5In this Goldman Sachs coding challenge, you are asked to manage a collection of FIFO queues while efficiently tracking specific aggregate properties across them. The core objective is to design auxiliary tracking mechanisms that allow you to query the minimum length and minimum sum among all managed queues in optimal time. This question tests advanced data structure design and amortized complexity management. Unlock the complete problem statement and expert solution by securing a subscription today.
asked June 2025Data StructureDesignHeapIn-Place String Compression (Run-Length)
3/5Solve a popular array manipulation challenge reported at Goldman Sachs that requires compressing sequential character runs directly within memory without allocating auxiliary data structures. This exercise tests your ability to handle pointer manipulation, multi-digit numeric conversions, and boundary conditions efficiently while modifying mutable collections in place. Honing this skill significantly improves your memory management and algorithmic efficiency. Unlock the comprehensive problem description and optimal coding solution with a paid subscription.
asked December 2024Two PointerStringCompressionTrapping Rain Water
3/5As a classic interview question frequently featured by Goldman Sachs, this problem asks you to calculate the total volume of rainwater that can be captured between elevation bars of varying heights. It serves as a fundamental test of spatial reasoning and tests your ability to optimize linear scans using two-pointer or monotonic stack approaches. The full problem statement, test cases, and optimal model solution are available exclusively to subscribers.
asked December 2024Two PointerArrayMonotonic StackHash Collisions: Causes, Resolution, Complexity
2/5Core computer science fundamentals are frequently tested in technical loops, mirroring this conceptual Goldman Sachs interview question. You will be expected to articulate the underlying mechanics of hash tables, including the root causes of collisions and the trade-offs of various resolution strategies. This discussion measures your grasp of fundamental data structures and asymptotic time complexities. Unlock the complete overview and expert guide with a subscription.
asked November 2024HashmapComplexity AnalysisCs FundamentalsMaximum-Sum Path in a Matrix Without Revisiting Cells
5/5This Goldman Sachs interview challenge asks you to discover an optimal trajectory through a grid containing positive and negative numbers without stepping on any coordinate more than once. It heavily tests advanced dynamic programming, backtracking, and state management strategies for matrix navigation. To access the complete problem description and optimal algorithmic solution, a subscription is required.
asked November 2024DFSBacktrackingMatrixSpiral Matrix Traversal
2/5Practice a classic matrix traversal problem frequently featured in Goldman Sachs coding rounds. The objective is to extract and sequence all elements of a two-dimensional grid by moving along the outer boundaries in a concentric, inward path. This task evaluates your spatial reasoning, index management, and boundary control under various dimensions. Reviewing the comprehensive problem breakdown and optimal code requires an active subscription.
asked November 2024ArrayBoundary PointersMatrixSecond-Smallest Unique Element
2/5Return the second smallest value among the entries that appear exactly once in an array. This Goldman Sachs warm-up has an underspecified corner that the interviewer expects you to raise: what to do when fewer than two values are unique. You will count occurrences first, filter to the singletons, and pick the second smallest without a full sort if you prefer. The complete problem and the reference solution are available to subscribers.
asked November 2024ArrayHashmapCount Unique Pairs With Difference K
2/5Explore this classic array processing puzzle frequently featured in technical evaluations at Goldman Sachs. The challenge revolves around analyzing a sequence of integers to discover how many distinct value combinations yield a specified arithmetic discrepancy. It tests your proficiency with hash tables, sorting strategies, and efficient linear-time search methodologies to optimize performance. Unlock the full problem breakdown and verified code solution by upgrading to a paid subscription.
asked October 2024HashmapSetArrayCount Palindromic Substrings
3/5This frequently asked Goldman Sachs interview problem challenges candidates to efficiently determine how many symmetrical text fragments exist within a given character sequence. Participants must master string traversal and dynamic programming techniques to identify all valid inner matches, including overlapping segments. This exercise evaluates your ability to optimize nested loops and handle character comparisons cleanly under strict time limits. Access to the full problem description, edge-case analysis, and optimized model solution requires a subscription.
asked October 2024StringPalindromeExpand Around CenterValidate Triangle and Classify Point Inclusion
3/5This frequently asked Goldman Sachs interview challenge evaluates your proficiency with computational geometry and coordinate math. You are tasked with checking whether a given set of vertices forms a valid non-degenerate geometric shape, and then determining the spatial relationship between that boundary and multiple target coordinates. This problem tests your ability to implement precise mathematical formulas and handle conditional logic cleanly. Unlock the complete breakdown, edge case handling, and optimal model solution by acquiring a subscription.
asked October 2024GeometryMathAreaAlternating Plus/Multiply on Even and Odd Index Streams
3/5This Goldman Sachs interview puzzle involves separating an array into distinct streams based on index parity and applying alternating arithmetic operations to each stream sequentially. You will need to compare the final arithmetic outcomes using specific modular criteria to determine the correct result string. The full problem description, constraints, and verified model solution require a subscription.
asked October 2024ArraySimulationParityLongest Subarray With Sum At Most K
2/5Sharpen your sliding window technique with this Goldman Sachs interview question, which challenges you to find the longest contiguous subarray whose sum stays within a given limit. Utilizing the non-negative nature of the input array, you will apply a two-pointer approach to efficiently track window boundaries and maximize length without brute-force scanning. This classic problem evaluates your mastery of linear-time array processing and constraint management. Upgrade to a paid subscription to view the full problem statement and optimal solution.
asked October 2024Two PointerSliding WindowArrayAnagram Queries on Word List
2/5For each query word, return every word from a list that uses exactly the same letters, in alphabetical order. This Goldman Sachs question is a fingerprinting exercise: computing a canonical form once per word turns every query into a single lookup instead of a scan. You will choose between a sorted-letter key and a letter-count signature, keep the results ordered, and handle a query with no matches. A subscription unlocks the complete problem and the reference solution.
asked October 2024StringHashmapSortingSimulate Chairs Required for Customer Events
2/5Reported as a Goldman Sachs technical question, this problem requires you to track resource allocation and reuse based on a chronological stream of events. You will simulate seating availability where arrivals utilize open spots or trigger new inventory acquisitions, and departures replenish the available pool. This exercise tests your capability to manage state changes and maintain running totals efficiently through sequential character processing. The complete problem statement and verified code solution require a subscription.
asked October 2024SimulationStringCountersCompliance Alerts From Trailing-Average Sliding Window
2/5This Goldman Sachs interview question focuses on building an automated monitoring mechanism that evaluates sliding windows of numerical activity against predefined limits. You are required to compute trailing averages over specific temporal frames and count every instance where metrics exceed strict compliance thresholds. The task measures your proficiency with rolling window algorithms, prefix sums, and efficient time-series data handling. Access the full problem details and verify your approach with the provided model solution by subscribing.
asked October 2024Sliding WindowArrayRunning SumImplement a Deque From Scratch
2/5Building fundamental data structures from scratch is a classic systems interview task often featured at companies like Goldman Sachs. This problem requires you to construct a double-ended queue for string elements without utilizing any built-in library collections, ensuring that every insertion, deletion, and inspection runs in constant time. Interviewers will closely scrutinize your memory management and pointer logic, particularly pointing out the performance pitfalls of standard dynamic arrays. Reviewing the complete source code and rigorous test suite requires an active subscription.
Data StructureLinked ListQueueFirst Unique Character in a String
1/5String manipulation and frequency counting are foundational skills tested in early-round technical screenings, including this reported Goldman Sachs interview question. The objective is to scan a text sequence and pinpoint the very first character that appears without any duplicates, returning either its position or value. This challenge evaluates your capability to utilize hash maps for optimal linear-time data processing. Upgrade your plan to view the full problem statement and a clean, production-ready solution.
HashmapStringCountingZigzag Iterator for Two 1D Vectors
3/5Build an iterator that alternates between two sequences, continuing with whichever still has elements once the other runs out. This Goldman Sachs question is a design exercise with an obvious follow-up: the clean answer generalises from two sequences to any number by holding the live cursors in a queue. You will keep the alternation correct when the lengths differ, report exhaustion accurately, and avoid copying the inputs. The full problem and the model implementation require a subscription.
IteratorArrayQueueCount Strictly Increasing Subarrays of Length K
2/5Featured in recent Goldman Sachs technical assessments, this problem challenges you to scan an integer array and count every contiguous subsegment of a specific size that maintains a strictly ascending order. It serves as a fantastic test of sliding window techniques, sequence tracking, and efficient array iteration. Mastering this pattern helps build confidence for similar subsegment query tasks. Unlock the full problem statement, algorithmic breakdown, and optimal source code with a paid subscription.
ArraySliding WindowRun LengthFind the Damaged Toy
2/5Work out which child in a circle receives the final item when handing them out one at a time from a chosen starting position. This Goldman Sachs question is modular arithmetic in disguise, and a loop over every item is unnecessary: the destination is a single expression. You will get the one-based labelling right, handle a count larger than the circle, and avoid an off-by-one at the wrap point. A subscription unlocks the full problem and the reference solution.
MathSimulationModuloBitwise XOR Subsequences
3/5Find the longest subsequence whose every neighbouring pair combines under bitwise exclusive-or to a fixed value. This Goldman Sachs question hides a neat structural fact: the constraint forces the chosen values to alternate between exactly two numbers, so the search collapses to counting alternations rather than exploring subsequences. You will recognise that a single element is always acceptable, handle the special case where the target is zero, and keep the scan linear. The complete problem and the reference solution are available to subscribers.
ArrayBitwiseXOREffective Manager
3/5Order a set of meetings whose outcomes raise or lower a running score so that the score stays above zero for as many meetings as possible. This Goldman Sachs question is a greedy arrangement problem: take the gains first, then spend the losses in the order that survives longest. You will sort the negative contributions carefully, stop counting at the first meeting that drops the score to zero, and handle an all-negative set. The complete problem and the reference solution are available with a subscription.
ArrayPrefix SumGreedyImplement Queue using Two Stacks
3/5Build a first-in-first-out structure from two stacks, starting with the obvious linear-cost version and then improving it. This Goldman Sachs question is explicitly staged: the second version keeps an inbound and an outbound stack and only moves elements when the outbound side empties, which makes the average cost constant. You will explain the amortised argument rather than claiming every operation is cheap, and handle removal from an empty queue. The complete problem and the reference implementation are available to subscribers.
StackQueueData StructuresIs Possible
2/5Decide whether one pair of numbers can become another when the only move replaces one of them with the sum of both. This Goldman Sachs question is best attacked in reverse: from the target, the larger value has a single possible predecessor, so the backward walk is forced and remainders let you skip many steps at once. You will handle the cases where one coordinate stops changing, and return the required string verdict rather than a boolean. The full problem and the reference solution require a subscription.
MathGreedySearchEncircular
3/5Simulate a machine on an endless plane that repeats a command sequence forever, and decide whether it stays near its starting point. This Goldman Sachs question has a compact proof behind it: after one pass, the net displacement and the final heading together determine whether four passes bring the machine home. You will track heading changes in place, accumulate displacement, and explain why one pass is enough to decide. The full problem and the model solution require a subscription.
SimulationGeometryStrings25 Horses, 5 Lanes: Find Top 3 Fastest
3/5Challenge your logical deduction with this legendary interview puzzle frequently utilized by Goldman Sachs to evaluate analytical reasoning. Given a large group of animals and a track with limited capacity where timing devices are absent, you must determine the absolute minimum number of competitive heats required to accurately isolate the top performers. This task tests advanced elimination strategies, logical grouping, and optimization under strict constraints. Unlock the full problem details, step-by-step logical breakdown, and the model solution with a paid subscription.
PuzzleSortingTournamentBitwise XOR Subsequences
3/5Find the longest contiguous stretch of an array whose combination under bitwise exclusive-or equals a target. This Goldman Sachs question is the prefix-xor-and-hash-map pattern: because the operation is its own inverse, the first occurrence of each prefix value is what gives the longest span. You will store first occurrences only, seed the map for the empty prefix, and handle a target of zero. A subscription unlocks the complete problem and the model solution.
ArrayBitwiseXORProduct of Min and Max Under Push/Pop Stream
3/5This data structure challenge, featured in Goldman Sachs interviews, requires you to dynamically track numerical extremes while processing a mixed stream of insertions and removals. After each state-changing action, you must calculate the product of the current smallest and largest values in the collection. The problem thoroughly assesses your ability to maintain balanced structures or priority queues efficiently under continuous updates. Reviewing the complete problem statement and optimal model solution requires a subscription.
Data StructureHeapMultisetMovement Command Controller
1/5Practice string parsing and state management with this introductory coding prompt from Goldman Sachs interviews. The challenge requires processing a sequence of directional instructions to update coordinates on a grid using a dispatch table, with follow-ups addressing case insensitivity and robust input validation. It is an excellent drill for beginners focusing on control flow and clean code structure. The complete problem statement and model implementation are available exclusively to subscribers.
SimulationStringHashmap
Goldman Sachs coding interview FAQ
- What coding questions does Goldman Sachs ask?
- 39 reported coding questions, most often on Array, Hashmap, String, Simulation, Sliding Window.
- How hard is the Goldman Sachs coding interview?
- The reported coding questions average 2.7 out of 5: 2 at 1/5, 14 at 2/5, 19 at 3/5, 3 at 4/5, 1 at 5/5.
- Are these Goldman Sachs coding questions recent?
- The most recent report is from July 2026, and 3 were reported within the last twelve months. Dates come from the interview reports themselves.