11.26 Goldman Sachs 26NG SDE OA |Difficulty is not low, but you can pass with a steady mindset

1,981 Views

I've actually done Goldman Sachs OA quite a few times, and each time it's been a bit of a "quieter side".
这次 11.26 的 Goldman Sachs 26NG SDE OA ,整体还是那种:题目不吓人,但写得不够干净就真的会翻车。

The whole set was: 2 programming, 8 multiple choice questions, the multiple choice questions were a bit tricky but manageable; it was the two coding questions that really opened up the gap.

11.26 Goldman Sachs 26NG SDE OA |Difficulty is not low, but you can pass with a steady mindset

Coding Question 1

Q1: Sliding Window Log Transmission Counter

Given a stream of log events, each event has a timestamp and a tag.
You need to calculate for each new log event how many previous events with the same tag fall within a fixed sliding time window.
The window size is W.
Return the total accumulated transmission count across all logs.
Old events falling out of the window should be removed efficiently.

Analyze the ideas

This question is all about how quickly you can build the structure of **"sliding window + multi-tabbed queue "**.
如果你写成暴力扫描数组,高盛直接让你 TLE。

The most stable architecture is:

  1. 一个全局队列(global queue)
    • 用来记录所有日志的时间顺序
    • Convenience O(1) Remove Timeout Event
  2. A dictionary:tag → deque
    • 只维护相同标签的 timestamp
    • 避免扫描整个历史列表
  3. 对每条日志 (t, tag):
    • Remove this tag from the queue t - W Previous timestamps
    • The remaining length of the queue is the "number of times the same label is used in the window".
    • 加到最终结果
    • 把当前 timestamp 放进去

This structure is a "very engineered" solution and is the optimal answer for the Goldman Sachs style.

Coding Question 2

Q2: Maximize Lock Value Based on GCD Rules

You are given an integer array A And an integer m.
Find an integer T (within a valid range related to m) that maximizes a custom lock value defined by the following rules:
For each element ai in the array, compute gcd(t, ai).
If gcd(t, ai) != 1, it contributes to the score.
Special conditions apply when all gcd values equal 1, or when T already appears in A.
Return the maximum achievable lock value.

Analyze the ideas

虽然看起来像“伪系统设计题”,但本质就是:
数学模拟 + 合理枚举 + gcd 判断 + 处理边界条件。

The safe writing style is as follows:

✓ Enumeration range

T The effective range is:

t ∈ [max(1, m - n), m]

This is to avoid meaningless t affecting the complexity.

✓ 对每个 t:

  1. Iterate over the array A
    • gcd(t, ai) != 1 → 计入贡献
  2. If all gcd = 1 → processed according to topic rules (usually lock value cleared to zero or base value given)
  3. 如果 t 在 a 中 → 要额外加/减 score(按原题要求)
  4. Update Maximum Lock Value

✓ What's the difficulty?

  • gcd 全为 1 的特殊情况容易漏
  • t 在数组里怎么处理不容易记
  • Enumeration intervals that are written incorrectly will simply TLE or WA

But the overall difficulty:
Simple in structure, but dense in detail.

Overall experience: This Goldman Sachs OA is a "war of details".

My biggest feeling from doing it:

① It doesn't test fancy work, but places great emphasis on code structure.

第一题写得乱的人基本稳挂。
滑动窗口、队列、字典这几个元素必须在心里组合好。

② Unexpectedly high demand for mathematical intuition

The second question can actually be written to explode, but as soon as you gcd and enumeration ranges are figured out, the difficulty drops off a notch immediately.

③ The multiple choice questions are a little harder than most banks

它不是送分型,会有概率、逻辑、数组复杂度推断这种混合题。

The overall difficulty is not so hard as to discourage, but it is certainly "the kind of thing you can easily fall into without preparation".

Want to stabilize an OA like Goldman Sachs / JPMorgan / Linen?

This time, I took the students through the Goldman Sachs OA, and the biggest feeling is still - being able to write, writing fast, and writing steadily is the winning point.
But what most students get stuck on is not the knowledge, but the rhythm of the scene, a sudden brain freeze, or an explosion of boundary condition patches.

这也是 Programhelp most commonly solved problem.

我们提供的不是那种“暴力上机”,而是:

  • 全程无痕联机协助(ToDesk/语音提示双路线)
  • 现场帮你把解题思路拉直,不用慌、不用乱补逻辑
  • 代码结构当场优化,减少低级 bug
  • 复杂题给“关键一眼提示”,保证你不在分支里迷路
  • 所有测试用例跑不通 = 不收费

If you are preparing for bank/quant/big factory OA recently, and don't want to waste your time on stepping on the pit again and again, please feel free to ask. We've run thousands of OA's with you, and we'll tell you where to rush, where to stabilize, and where to just skip for an efficient strategy.

author avatar
Jory Wang Amazon Senior Software Development Engineer
Amazon senior engineer, focusing on the research and development of infrastructure core systems, with rich practical experience in system scalability, reliability and cost optimization. Currently focusing on FAANG SDE interview coaching, helping 30+ candidates successfully obtain L5/L6 Offers within one year.
END
 0