← 返回博客列表 Google 2026 New Grad OA 完整攻略|Software Engineer Early Career US 三大题型真题精选
Google

Google 2026 New Grad OA 完整攻略|Software Engineer Early Career US 三大题型真题精选

2026-05-15

Google Software Engineer, Early Career (United States) 是 2026 招聘季最受关注的岗位之一——这个岗位针对大四在读或毕业 ≤ 1 年的 candidate,全程不要 referral 也能进 OA 池(系统按 timestamp 排队)。但要从 35,000+ 简历里活下来,第一关 OA 几乎决定了 70% 的命运

本文基于 2026-04 到 2026-05 期间一亩三分地、Reddit 与 Glassdoor 的最新数据,把 Google New Grad OA 的题型、平台、评分逻辑、变体讲清楚,并给出三道真实候选人回忆的题目完整 Python 解法。

Google New Grad OA 概览

维度 详情
平台 Hackerrank(已从 2023 的 ChromeOS Codejam 切换)
时长 90 分钟
题量 2 道(少数 candidate 报告 3 道,多为 batch 差异)
难度 1 道 LC Medium + 1 道 LC Medium-Hard
通过线 经验线:2 题全过 + 至少 1 题 100% hidden test
反馈周期 7-21 天
二面 通过后进入 Onsite Loop(4 轮 coding + 1 轮 Googleyness)

重要变化:2026 cycle 起,Google 在 OA 阶段新增了一个 "Behavior Insight" 短问卷(10 分钟,30 题 Likert 量表),用于初筛 culture fit。这部分不算分,但回答与你简历明显矛盾会被人工 review。

真题一:Set Difference Group(集合分组求差)

题目描述

给定一个长度为 n 的字符串数组 words 与一个整数 k。把所有字符串按"字符集相同"分组(如 "aabbc""abc" 同组)。要求:

解题思路

经典 hashmap by character set。两个细节坑:

  1. 字符集要排序去重"".join(sorted(set(w)))
  2. 同组里要选字典序最小的"原字符串"——不是排序后的字符集

Python 解法

from collections import defaultdict

def find_set_diff_group(words, k):
    groups = defaultdict(list)
    for w in words:
        key = "".join(sorted(set(w)))
        groups[key].append(w)
    candidates = []
    for key, members in groups.items():
        if len(members) == k:
            candidates.append(min(members))
    return min(candidates) if candidates else ""

# Example
# words = ["aab", "ba", "abc", "ba", "bac"], k = 2
# Group "ab": ["aab", "ba", "ba"]  size 3
# Group "abc": ["abc", "bac"]      size 2  ← match
# Return: "abc"

时间复杂度:O(n · L log L),L = 最长字符串长度 空间复杂度:O(n · L)

真题二:Currency Conversion Best Rate(货币兑换最优路径)

题目描述

给定汇率列表 [(from, to, rate)](双向不一定相等,可有多条同对 pair),以及起点货币 src、终点货币 dst

允许最多 m 次中间兑换,问从 1 单位 src 最多能换到多少 dst?若 src 与 dst 不连通,返回 -1

解题思路

类似 LC 399 Evaluate Division,但加了 "最多 m 次" 约束 + "找最大乘积"。

Python 解法

import heapq
from math import log
from collections import defaultdict

def best_conversion(rates, src, dst, m):
    g = defaultdict(list)
    for a, b, r in rates:
        g[a].append((b, r))
    # 最大堆 → 用负值入 heapq
    best = {(src, 0): 1.0}
    pq = [(-1.0, src, 0)]
    ans = 0.0
    while pq:
        neg_amt, u, hops = heapq.heappop(pq)
        amt = -neg_amt
        if amt < best.get((u, hops), 0):
            continue
        if u == dst:
            ans = max(ans, amt)
            continue
        if hops == m:
            continue
        for v, rate in g[u]:
            new_amt = amt * rate
            if new_amt > best.get((v, hops + 1), 0):
                best[(v, hops + 1)] = new_amt
                heapq.heappush(pq, (-new_amt, v, hops + 1))
    return ans if ans > 0 else -1

时间复杂度:O(E · m · log(V·m)) 陷阱:用 math.log 转成最短路径在 Python 里有浮点误差,会让 hidden test 1-2 个 case 错位;直接维护原数值 + 最大堆更稳。

真题三:Tree Diameter with Edge Cost(带权树的直径变体)

题目描述

给定 n 个节点的无向树,每条边有正权重。每个节点上还挂着一个 node_cost

定义一条路径的"effective cost" 为:

sum(edge weights on path) + max(node_cost over path nodes)

最大 effective cost。

解题思路

这是经典 Tree Diameter 的变种——纯直径用两次 BFS,但加了 "max node cost" 这一项后,两次 BFS 不再适用,必须用 DFS + 维护两个最佳子树

Python 解法

from collections import defaultdict

def tree_max_effective_cost(n, edges, node_cost):
    g = defaultdict(list)
    for u, v, w in edges:
        g[u].append((v, w))
        g[v].append((u, w))
    ans = [max(node_cost)]  # 单点路径

    def dfs(u, parent):
        # 返回 list of (edge_sum, max_node_on_path) — 仅保留 top2
        best = [(0, node_cost[u])]
        for v, w in g[u]:
            if v == parent:
                continue
            child_options = dfs(v, u)
            for e_sum, mx in child_options:
                best.append((e_sum + w, max(mx, node_cost[u])))
        # 合并任意两条:枚举 top2
        best.sort(key=lambda x: x[0], reverse=True)
        if len(best) >= 2:
            # 取前两条不同子树的合并
            e1, mx1 = best[0]
            e2, mx2 = best[1]
            ans[0] = max(ans[0], e1 + e2 + max(mx1, mx2))
        # 返回单条最佳(截断到 top2,避免指数爆炸)
        return best[:2]

    dfs(0, -1)
    return ans[0]

时间复杂度:O(n)(每节点常数次合并) :必须确保"两条 path 来自不同子树"。简单做法:DFS 时一次性收集所有 child 返回值,最后才合并,不要在 child 遍历过程中就更新答案。

备考建议

优先级 重点 推荐题号
⭐⭐⭐ 图 BFS/DFS/Dijkstra LC 399、LC 787、LC 743、LC 1631
⭐⭐⭐ 树 DP / 直径 LC 543、LC 124、LC 968、LC 1372
⭐⭐ 字符串 / 字符集 LC 49、LC 438、LC 76
⭐⭐ 复合数据结构 LC 146、LC 460、LC 1146
实现题 LC 271、LC 535

时间分配:90 分钟 = 简单题 30 min + 难题 50 min + 复查 10 min。不要先全部读完再写——Hackerrank 的 IDE 有 30 秒延迟,浪费时间。


FAQ

Q1:Google New Grad OA 和 Intern OA 一样吗?

题型一致,但 New Grad 的题目难度普遍高 0.5-1 个等级。Intern 是 2 题 90 分钟 LC Medium 为主,New Grad 第二题经常出现 LC Medium-Hard / 简单 Hard。评分线也更严格:Intern 一般 1 题全过 + 1 题部分就能过,New Grad 需要 2 题全过

Q2:Google 没有 Referral 也能拿到 OA 吗?

可以。Google 2026 Early Career 程序按"提交时间"排队,referral 只是提速,并不保证直接进 OA 池。关键是早投——一亩三分地 2026-04 数据显示,9 月开放后前 2 周提交的 candidate 进入 OA 的比例约 30%,9 月底降到 10%。

Q3:OA 通过后多久 Onsite?

历年平均 2-4 周进入 Recruiter call,6-10 周完成全部 5 轮 onsite注意 2026 cycle 整体延后:4 月通过 OA 的 candidate 普遍报告 5-6 月才约 onsite。

Q4:Hackerrank 平台和其他公司用的 CodeSignal 有什么区别?

Hackerrank 的 IDE 更朴素,没有 code completion,编译运行有 5-10 秒延迟。两个适配技巧

  1. 在本地 VS Code 写好再粘贴
  2. print 调试时尽量减少调用次数

Q5:题目用什么语言写最稳?

Python 仍是首选。Java / C++ 在 Google 内部更受欢迎,但 OA 阶段没有任何加分——评分纯看 hidden test 通过率。Go / Rust 慎用:Hackerrank 的部分 helper 函数不全。

Q6:Google New Grad Onsite 流程是什么样?

通过 OA 后:

  1. Recruiter Call(30 min):聊背景 + 时间安排
  2. Onsite × 5 轮:4 轮 coding + 1 轮 Googleyness(行为面)
  3. Hiring Committee(HC)评分:committee 不见 candidate,纯看面试官打分
  4. Team Match(2-6 周):HC 通过后才进 team match
  5. Offer Letter(2025-2026 cycle 平均 L3 SWE base salary $148K + sign-on)

整个流程从 OA 到 offer 通常 3-5 个月


正在准备 Google New Grad / Intern OA?

Google OA 看起来"不难",但评分线高 + hidden test 严苛,纯刷题的命中率有限。我们整理了 2025-2026 cycle Google New Grad 20+ 真题题库(含变体),并按"图 / 树 / 字符串 / 设计"四个方向输出体系化备考路径,欢迎联系。

立即添加微信 Coding0201获取 Google OA 真题题库

联系方式

Email: [email protected] Telegram: @OAVOProxy