我的 Apple OA 经历分享 | Apple SWE New Grad 从收到邀请到拿到结果

最近投递了 Apple SWE New Grad 岗位,大概两周后收到了 recruiter 发来的 OA 邀请邮件。邮件里附的是 HackerRank 测试链接,比较友好的一点是:有 7 天时间窗口可以自由选择开始时间。但需要注意,一旦点击 start,计时就会立刻开始,中途不能暂停。

我当时特意选了周末上午做题——脑子最清醒的时候确实更容易进入状态。开始前我还简单热身了几道题,把 IDE、草稿纸都准备好,避免正式开始后手忙脚乱。

My Apple OA Experience: From Receiving the Invitation to Receiving the Result

Apple OA 题目回顾

两道题按顺序解锁,做完第一题才能看到第二题。整体节奏很重要,建议每题不超过 40 分钟,留 10 分钟检查边界情况。

Maximum Profit in Job Scheduling

Easy-Medium

We have n jobs, where every job is scheduled to be done from startTime[i] to endTime[i], obtaining a profit of profit[i].

You’re given the startTimeendTime and profit arrays, return the maximum profit you can take such that there are no two jobs in the subset with overlapping time range.

If you choose a job that ends at time X you will be able to start another job that starts at time X.

Example 1:

我的 Apple OA 经历分享 | Apple SWE New Grad 从收到邀请到拿到结果
Input: startTime = [1,2,3,3], endTime = [3,4,5,6], profit = [50,10,40,70]
Output: 120
Explanation: The subset chosen is the first and fourth job.
Time range [1-3]+[3-6] , we get profit of 120 = 50 + 70.

Example 2:

我的 Apple OA 经历分享 | Apple SWE New Grad 从收到邀请到拿到结果
Input: startTime = [1,2,3,4,6], endTime = [3,5,10,6,9], profit = [20,20,100,70,60]
Output: 150
Explanation: The subset chosen is the first, fourth and fifth job.
Profit obtained 150 = 20 + 70 + 60.

Example 3:

我的 Apple OA 经历分享 | Apple SWE New Grad 从收到邀请到拿到结果
Input: startTime = [1,1,1], endTime = [2,3,4], profit = [5,6,4]
Output: 6

Constraints:

  • 1 <= startTime.length == endTime.length == profit.length <= 5 * 104
  • 1 <= startTime[i] < endTime[i] <= 109
  • 1 <= profit[i] <= 104

Sum Root to Leaf Numbers

Medium

You are given the root of a binary tree containing digits from 0 to 9 only.

Each root-to-leaf path in the tree represents a number.

  • For example, the root-to-leaf path 1 -> 2 -> 3 represents the number 123.

Return the total sum of all root-to-leaf numbers. Test cases are generated so that the answer will fit in a 32-bit integer.

A leaf node is a node with no children.

Example 1:

我的 Apple OA 经历分享 | Apple SWE New Grad 从收到邀请到拿到结果
Input: root = [1,2,3]
Output: 25
Explanation:
The root-to-leaf path 1->2 represents the number 12.
The root-to-leaf path 1->3 represents the number 13.
Therefore, sum = 12 + 13 = 25.

Example 2:

我的 Apple OA 经历分享 | Apple SWE New Grad 从收到邀请到拿到结果
Input: root = [4,9,0,5,1]
Output: 1026
Explanation:
The root-to-leaf path 4->9->5 represents the number 495.
The root-to-leaf path 4->9->1 represents the number 491.
The root-to-leaf path 4->0 represents the number 40.
Therefore, sum = 495 + 491 + 40 = 1026.

Constraints:
  • The number of nodes in the tree is in the range [1, 1000].
  • 0 <= Node.val <= 9
  • The depth of the tree will not exceed 10.

90 分钟时间分配建议

0 – 5 min:仔细阅读题目,确认输入输出格式和边界条件,不要急着写代码。

5 – 35 min:完成第一题,先写暴力解确保通过,再考虑优化。提交前跑一遍自己设计的边界 case。

35 – 75 min:完成第二题,同样先求 AC 再优化。注意不要被某个 bug 卡死太久,超过 10 分钟没思路可先跳回审题。

75 – 90 min:整体复查:检查边界(空数组、负数、全相同元素),确保所有可见 case 全通过后提交。

OA 之后的流程

提交 OA 后大约等了 10 天收到了 Phone Screen 的邀请。后续使用的是 CoderPad 平台,和 OA 的 HackerRank 风格略有不同,可以实时看到代码运行结果并与面试官互动。

推荐刷题资源

LeetCode Apple Tag

最直接的方式,按照 Apple 高频题刷即可,数组、DP、二分、图论出现频率都不低。

NeetCode 150

适合系统性补基础,视频讲解比较友好。

CodeTop

国内整理的大厂高频题库,更新速度很快。

一亩三分地

很多最新 OA 面经和 timeline 分享。

ProgramHelp

如果你最近同时在准备 Apple、Meta、Amazon、Google 等多家公司的 OA,时间比较紧,自己刷题效率不高,也可以找 ProgramHelp 做针对性的 實時OA助攻

author avatar
Jory Wang Amazon資深軟體開發工程師
Amazon 資深工程師,專注 基礎設施核心系統研發,在系統可擴充套件性、可靠性及成本最佳化方面具備豐富實戰經驗。 目前聚焦 FAANG SDE 面試輔導,一年內助力 30+ 位候選人成功斬獲 L5 / L6 Offer。
END
 0