JPMorgan 的 OA 一直是許多準備金融科技職位(FinTech / Quant / Data / SDE)的同學關注的重點環節。它不像純演算法公司只看程式碼能力,也不像傳統投行那樣偏向行為題,而是兩者結合:題目簡短卻邏輯性極強,往往要在限定時間內迅速讀懂場景、抽像出數學模型,再落地成可執行的程式碼。
我這次做的是 JPMorgan 的最新一版 OA,整體題量 2 道,時間相對充裕,但對思維轉換速度要求挺高。第一題是典型的前綴和+差值分析問題,看似簡單但需要精確計算每個切割點的最優方案;第二題則是偏動態規劃(DP) 思路的路徑求和題,重點在狀態轉移和邊界處理。兩題都屬於那種「一旦想通就很好寫,但想通之前極容易卡」的類型。
這類題其實非常能體現 JPMorgan 的出題風格──考察邏輯推理能力、計算思維,還有對程式碼可讀性的把控。對新畢業生或實習生來說,它不單純是演算法題,而更像是小型邏輯建模測驗。

JPMorgan OA 面經概覽
整個 OA 一共兩題,時間不特別緊,但題意略繞,要仔細閱讀。
我這次順利 AC,主要靠前期對類似題型(前綴和+ DP)的熟悉度。
Problem 1: Balance Two Parts of an Array
Description:
Given a list of items with quantities, you need to split the list into two consecutive parts. You can increase or decrease the number of items in each part.The goal is to make the total quantity of both parts equal using the minimum number of operations. Each operation can increase or decrease one unit from any item.
Example:
Input: [1, 2, 5, 4]
Output: 1
Explanation:
Split between 2 and 5 gives [1,2] and [5,4].
Sum(left) = 3, Sum(right) = 9 → Difference = 6 → Need 3 operations per side → Minimum total = 3.
Approach:
Use prefix sum to compute the sum of the left and right parts efficiently.
For every split point, calculate the difference between the two sums.
The minimum number of operations equals abs(sum_left - sum_right) / 2.
Code Idea (Python):
def min_operations(nums):
prefix = [0]
for x in nums:
prefix.append(prefix[-1] + x)
total = prefix[-1]
res = float('inf')
for i in range(1, len(nums)):
left = prefix[i]
right = total - left
res = min(res, abs(left - right) // 2)
return res
Problem 2: Maximum Security Value After Hacker Jumps
Description:
There are n servers in a line, each with a certain security value.
A hacker starts from any server and jumps k servers forward each time (i → i+k).
The process stops when the hacker jumps out of the network.
You need to find the maximum total security value the hacker can collect from any starting position.
Example:
Input: security = [5, 7, 3, 4, 6], k = 2
Output: 13
Explanation:
Start at index 0 → nodes 0, 2, 4 → sum = 5 + 3 + 6 = 14
Start at index 1 → nodes 1, 3 → sum = 7 + 4 = 11
Maximum = 14
Approach:
Use bottom-up dynamic programming.
Let dp[i] represent the maximum total value starting from node i.
Then:
dp[i] = security[i] + dp[i+k] if i+k < n else security[i]
Finally, return max(dp) as the answer.
Code Idea (Python):
def max_security(security, k):
n = len(security)
dp = [0] * n
for i in range(n - 1, -1, -1):
dp[i] = security[i]
if i + k < n:
dp[i] += dp[i + k]
return max(dp)
總結
JPMorgan 的這套 OA 整體偏算法邏輯題,重點在於:
- 思維清晰:題意不長但容易讀混;
- 實作細節:前綴和與 DP 的索引邊界要特別小心;
- 程式碼可讀性:不要一味追求 one-liner。
OA 代寫/面試助攻,JPMorgan 直通 Offer!
兄弟,刷題累?中介黑?別糾結了,ProgramHelp,專攻 JPMorgan/FAANG OA 代寫,24-48 小時交付,100%全 TC 通過,不過全退費!
- 全鏈條服務:從 OA 代刷(DP/前綴和專攻)到 HireVue 腳本、VO 即時提示,直到你簽 Offer。 JPMorgan 批次我已幫 50+人過,近千份案例,金融題型手到擒來。
- 零風險承諾:先模擬/交付,滿意再付尾款,無中介費(比市面便宜 30%),絕對原創、保密,Wechat 一對一指導無限期。
- 真實反應:上週幫一 CS 學員刷 JPM DP 題,隔天 Passed,Offer 到手! 「學長,值了!」——她這麼說。