DEV Community

Cover image for Goldman Sachs OA 2026 Interview Experience | HackerRank Questions + Solutions + Prep Guide
net programhelp
net programhelp

Posted on

Goldman Sachs OA 2026 Interview Experience | HackerRank Questions + Solutions + Prep Guide

Hi everyone — I recently completed the Goldman Sachs Online Assessment and wanted to share a detailed breakdown of the experience. As one of the top investment banks on Wall Street, Goldman Sachs has a fairly structured and competitive OA process for tech roles. The assessment focuses on a combination of coding, logical reasoning, and time management under pressure.

This post covers the OA format, real question types, detailed solution approaches, and preparation tips to help you get through it more efficiently.


OA Overview (2026 Updated)

  • Platform: HackerRank
  • Duration: ~90–120 minutes (varies by role)
  • Questions: 2–3 coding + 2 math/logic questions
  • Languages: Python, Java, C++, JavaScript, etc.
  • Focus: Arrays, strings, simulation, BFS variations, edge cases, time management

One key characteristic of the Goldman Sachs OA is the mix of question types. You are expected to quickly switch between coding and logical reasoning, which makes pacing extremely important.

Coding difficulty is typically around LeetCode Medium, while math questions lean toward probability, logic, and basic modeling.


High-Frequency Coding Questions & Solutions

Find the Damaged Toy (Circular Distribution Simulation)

You are given N children sitting in a circle. Starting from position D, toys are distributed one by one clockwise for T times. Return the index (1-based) of the child who receives the last toy.

Example:
Input: N = 5, T = 2, D = 1
Output: 2

This is a classic modular arithmetic problem. The result can be computed using:

(D + T - 2) % N + 1

Make sure to handle edge cases such as T = 1 or N = 1.


Encode or Decode Message (String + Key Pattern)

Given an operation (1 = encode, 2 = decode), a message string, and a numeric key:

  • Encoding: Each digit in the key represents how many times a character should repeat
  • Decoding: Reverse the process, ensuring strict matching

Example:
operation = 1, message = "Open", key = 123 → "Oppeen"
operation = 2, message = "Oppeen", key = 123 → "Open"

The key should be treated as a cyclic pattern. For encoding, iterate through the message and repeat characters based on the key digits. For decoding, use a pointer or counter to validate whether the repetitions match exactly. If not, return -1.

Common pitfalls include incorrect key cycling, mismatch in repetition counts, and handling empty strings.


Minimum Moves in a Maze (BFS with Jumping)

Given an n×m grid with 0s (free) and 1s (blocked), find the minimum number of moves from (0,0) to (n-1,m-1). Each move can travel 1 to k steps in four directions, but all intermediate cells must be valid.

This is a variation of BFS:

  • Use a queue to track positions
  • From each cell, try moving 1 to k steps in all four directions
  • Validate all intermediate cells
  • Track visited states carefully

Time complexity is roughly O(n * m * k), which is acceptable for typical constraints.


Math & Logical Reasoning Section

The OA usually includes 2 math or logic questions, often in multiple-choice format. Topics may include probability, pattern recognition, and simple quantitative reasoning.

Resources like Heard on the Street can be helpful for preparation. Make sure to allocate time properly so you don’t miss these questions.


Preparation Tips & Strategy

Focus on Medium-Level Problems

Prioritize commonly tested patterns like arrays, string manipulation, and BFS/DFS variations. Speed and correctness matter more than solving extremely hard problems.

Practice Reading in English

HackerRank problem statements can be lengthy. Improving reading speed can save valuable time during the test.

Pay Attention to Edge Cases

Goldman Sachs questions often include tricky boundary conditions such as empty inputs, cyclic patterns, or blocked paths.

Simulate Real Test Conditions

Practice solving 2–3 questions within 60–90 minutes to build timing awareness and avoid panic during the actual OA.


Final Thoughts

The Goldman Sachs OA is not about solving the hardest problems, but about demonstrating consistency, attention to detail, and time management. Strong fundamentals and disciplined execution are the key to passing.


Additional Note (For Those Preparing Seriously)

One challenge many candidates face is not the difficulty of the problems, but getting stuck on implementation details or running out of time. In high-pressure environments like this, even small delays can impact your overall performance.

If you're looking for structured preparation, including real OA questions, optimized solutions, and mock testing environments, you might find this helpful:

ProgramHelp Goldman Sachs OA Preparation

They provide curated 2026 question sets, multiple language implementations, and targeted guidance for tricky problems like Encode/Decode and BFS maze variations. For many candidates, having structured practice and feedback can significantly improve performance.

Top comments (0)