HackTheRounds Interview Experiences
Goldman Sachs OA HackerRank Questions 2026: Coding Problems, Math Logic & Solutions
Goldman Sachs 2026 Online Assessment breakdown: circular toy distribution, message encoding/decoding, and maze navigation with variable jumps.
By HackTheRounds Team · 2026-03-22
Overview
Goldman Sachs' 2026 SDE Online Assessment uses HackerRank with 90 minutes for 2-3 coding problems plus 2 math/logic questions . The coding problems tend to be medium difficulty with a math or simulation flavor — fitting for a finance company.
Problem 1: Find the Damaged Toy (Circular Distribution)
Difficulty: Medium | Topics: Modular Arithmetic, Simulation
N kids sit in a circle (numbered 1 to N). A host has T toys and distributes them one at a time starting from kid D, going clockwise. One toy is damaged. Given the damaged toy's position in the distribution order, find which kid receives it.
Approach: Pure modular arithmetic. The k-th toy goes to kid ((D - 1 + k - 1) % N) + 1 . No simulation needed — just compute the answer directly.
Key Insight: Don't iterate through all T toys. The answer is a single modulo operation.
Problem 2: Encode or Decode Message
Difficulty: Medium | Topics: String Manipulation, Pattern Matching
Transform messages using a numeric key. Operation 1 repeats characters cyclically based on the key. Operation 2 reverses the process (decompression) with validation that the encoded message is well-formed.
Approach: For encoding, iterate through the message and repeat each character according to the corresponding key digit (cycling the key). For decoding, validate that consecutive identical characters match the key pattern, then extract one character per group.
Key Insight: Edge cases around mismatched key lengths and invalid encoded messages are the main traps.
Problem 3: Minimum Moves in a Maze
Difficulty: Medium-Hard | Topics: BFS, Grid Pathfinding
Navigate an n×m grid from (0,0) to (n-1, m-1). You can jump 1 to k steps in any cardinal direction, but only if ALL cells you jump over are 0 (no obstacles in the path).
Approach: Modified BFS where each state is a (row, col) position. For each position, try all 4 directions and all jump distances 1 to k, stopping early in each direction when hitting an obstacle.
Key Insight: The variable jump length makes this harder than standard BFS. You need to break out of the inner loop (increasing jump distance) as soon as you hit a wall — you can't jump over obstacles.
Math/Logic Questions
Goldman also includes 2 quantitative reasoning questions — these are more like brain teasers or probability problems. Common topics: expected value, combinatorics, basic statistics. These aren't coding problems — they test mathematical thinking.
Goldman Sachs OA Prep Tips
- Modular arithmetic is a must — circular problems, remainder calculations, and cyclic patterns come up frequently
- BFS with modifications — standard BFS won't cut it. Practice BFS variants (variable step sizes, weighted grids)
- Don't skip the math section — it's separately scored and matters for the overall evaluation
- 90 minutes is generous — take time to handle edge cases properly
- Finance-flavored problems — expect simulations involving distributions, transactions, or resource allocation
Practice Goldman Sachs interview questions on HackTheRounds.