Capital One OA 四題一次過|題庫重疊+思路超熟悉,全程半小時速通

10 月 8 號剛測完 Capital One OA ,四題一次全過! 這次的題庫跟 TikTok、Uber 的 codesignal 題幾乎完全一致,難度適中、邏輯清晰,半小時左右就能全部 AC。 整體體驗非常絲滑,題目熟悉度高,細節處理上稍有變化但核心思路不變。

Q1. Bus Missions Between Alpha and Beta

Description:
You have multiple missions. Each mission requires you to travel from Alpha → Beta → Alpha.
There are bus schedules for both directions.
Each time, you must take the earliest bus you can catch based on your current time.
Return the time when all missions are completed.

思路:
就是一個模擬題。 每次來回一趟:

  1. 從當前時間找出 Alpha → Beta 的最早班車;
  2. 到達 Beta 後,找 Beta → Alpha 的最早班車;
  3. 重複上述步驟 missions 次,最後輸出最終返回時間。

用兩個指標分別掃兩份時程表即可,細節是要處理“>= 當前時間”的條件。

Q2. Count Substrings with Exactly Two Vowels

Description:
Given a string s, count how many substrings of length 3 contain exactly two vowels (a, e, i, o, u).

思路:
这题很快:

  • 滑動視窗長度為 3;
  • 每次檢查其中元音個數是否等於 2;
  • 若滿足則計數加一。

複雜度 O(n),實現不到 5 行,非常直接。

Q3. Minimum Height Difference Between Peaks

Description:
You are given an array heights and an integer viewingGap.
Find all pairs (a, b) where |a - b| ≥ viewingGap, and return the minimum absolute difference of their heights.

思路:
暴力也能過:

  • 雙層迴圈,枚舉所有滿足距離條件的 pair;
  • 计算高度差的绝对值;
  • 更新最小值。

如果輸入特別大,也可以考慮雙指標或預處理,但一般 brute force 就能 AC。

Q4. Placing Figures on a Grid

Description:
You are given an empty grid of size x × y (initially all zeros) and a list figures of five shapes.
You need to place them sequentially on the grid.
For each figure:

  • Scan from top to bottom, left to right;
  • Find the first position where the figure can fit;
  • Fill those cells with the figure’s index (starting from 1);
  • If it doesn’t fit anywhere, skip it.

思路:
經典類比+實現題。 對每個形狀逐格掃描,檢查能否放下。
注意邊界檢查、重疊判斷和更新 grid。 實現比較繁瑣,但邏輯清晰。

OA 總結

這次 Capital One OA 可以說是 “codesignal 熱門題精選集”。
四題都偏向類比與邏輯思考,考查細節實現而非複雜演算法。

難度排序大致是:

Q2(簡單) < Q3(中等) < Q1(中等偏上) < Q4(實現細節多)

如果你之前刷過 TikTok 或 Uber OA,這套題幾乎可以閉眼寫。
我這次 27 分鐘全過,全部 test case 100%。

一次通過的背後,其實有點“黑科技”

這次能半小時全 AC,說實話,不全靠運氣。
這次面試我找到 Programhelp 進行”無痕聯機助攻“,能即時看代碼運行、同步節奏、語音提示關鍵點,但完全不留痕跡。
這對 codesignal、hackerrank 這類環境特別有用——
你只管思路和寫法,剩下的調試、邊界、test case 都能在後台幫你穩住。
正式測的時候心態穩得離譜。

author avatar
jor jor
END
 1