刚带学员顺利拿了 Meta OA 四题全AC!这次题量就是四题,整体难度中等偏上,主要考察逻辑、数组与各种模拟处理,没有复杂的算法,细节却是非常多的部分。Meta 本身就很注重代码的严谨性和思路的清晰度,看似简单的字符串题或者循环题,边界和某些状态的判断就会出错。学员用 Python 完成,语法简洁容错率高。总体体验是——不难,但必须“细”,想拿高分就得写得干净利落。下面整理了完整的题目与我的部分思路供参考。

Meta OA 面试概览
OA 通常是 4 道编程题,自动评分系统,simulation、string、math、greedy 这些题型会比较常见。
语言不限(Python/C++/Java都可以),Python 在上述所有操作上都有明显优势。
完成 OA 后会进入一轮或多轮 VO(视频面),题型可能延续 OA,解释思路会成为重点。
目前国内外小厂到大厂(Meta, Amazon, TikTok 等)都在同步发 OA,趁热打铁做一次是值得的。
真题回顾(我记忆中的)
Question 1: Count Key Changes
Description:
Given a list of characters representing keys pressed on a keyboard, count the total number of key changes.
If consecutive keys are the same, they don’t count as a change.
A change happens only when the current key is different from the previous one.
Example:
Input: ['a', 'a', 'b', 'b', 'a']
Output: 3
Idea:
Just iterate through the list, compare each character with the previous one, and increment the counter when different.
This is a pure simulation problem, O(n) time.
Question 2: Dominant Single Digit in IP Address
Description:
Given an IP address string like "192.168.1.1", split it by "." into four integers.
For each integer, repeatedly sum its digits until it becomes a single digit.
Then, among these four final digits, find which digit appears most frequently and return it.
Example:
Input: "192.168.1.1"
Processing: [1+9+2=12 → 1+2=3], [1+6+8=15 → 1+5=6], [1], [1]
Final digits: [3,6,1,1]
Output: 1
Idea:
Digit root trick — repeatedly take digit sum or use formula n % 9 (except 0 → 9).
Then use Counter to get the most frequent one.
Question 3: Battery Usage Simulation
Description:
You need to use a phone for t minutes.
There are several batteries; battery i can last capacity[i] minutes,
then needs recharge[i] minutes to recharge (during which it’s unavailable).
You always use the next available battery in order; skip any currently charging.
If all batteries are charging at some point, return -1.
Otherwise, return the number of fully used batteries (each full discharge counts once).
Example:
Input: t = 10, capacity = [5,3], recharge = [4,5]
Output: 3
Explanation:
Use battery0(5min), battery1(3min), battery0(2min) -> total 10min, full discharges=3
Idea:
模拟循环使用,用一个数组跟踪每块电池下一次可用时间。
每用完一块 battery 就更新它的 next_available_time = current_time + recharge[i]。
时间推进直到达到 t 分钟或所有电池都在充电。
Question 4: Minimum Increments to Make Array ±1 Sequence
Description:
Given an integer array, you can only increase elements (not decrease).
You need to make the array either:
- strictly increasing with difference 1 between neighbors, or
- strictly decreasing with difference 1 between neighbors.
Return the minimum total increment operations needed.
Each increment (+1) counts as one operation.
Example:
Input: [3, 2, 4]
Option1 → Increasing: [3,4,5], cost= (0+2+1)=3
Option2 → Decreasing: [5,4,3], cost=(2+2+0)=4
Output: 3
Idea:
分别以 “递增” 与 “递减” 为目标,模拟两种情况。
对每个元素计算目标值并取差的累加最小值。
总结
这次 Meta OA 难度不算高,但题目非常“细”,容易因为 off-by-one 或充电逻辑卡分。
重点是写得稳、覆盖 edge cases。
如果你之后还要冲 Meta VO / Amazon LP / TikTok Tech Interview,这些都是共通题型。
FAQ | Meta OA 常见问题汇总
Q1:Meta OA 一共有几题?难度怎么样?
A:通常是 4 道题,题型多为字符串处理、模拟、数组逻辑类,偏基础但容易在细节上丢分。整体难度中等,比起LeetCode Hard更像是Medium偏上。
Q2:可以用 Python 吗?评分会有差异吗?
A:完全可以。Meta 的自动判题系统支持 Python / Java / C++ 等语言,语言间不会有分差。
不过 Python 在字符串、列表、哈希计数上更省时间,适合快速 AC。
Q3:每道题是否有时间限制?提交格式是什么?
A:通常整场 OA 限时 70-90 分钟,四题一次性提交。
提交时只需输出返回值,不需要 print 过程。测试用例覆盖很全,要特别注意 edge cases。
Q4:OA 全部 AC 就一定能进 VO 吗?
A:大概率能。Meta 会根据 OA 成绩筛选进入下一轮 VO(Virtual Onsite),不过也会参考简历匹配度和岗位需求。
一般 全AC + 简历匹配度高 的情况,会很快收到 VO 邀请。
Q5:VO 面试会考 OA 里的题吗?
A:会有延伸。VO 会基于 OA 的题型(字符串处理 / 模拟逻辑)考 deeper reasoning,比如“如果扩展到更大规模怎么办”“能否优化复杂度”等。
有时还会混入 behavioral questions(如 team conflict / ownership)。
想拿下OA+VO?我们能帮你一站到底
Programhelp 已经帮上百位同学在 Meta、Amazon、Google、Shopee 等拿到 offer。
我们提供:
- 实时远程联机助攻(语音提醒 + 快速debug)
- 个性化模拟题强化(还原真实OA环境)
- VO一对一陪练与思路讲解
目前国内外大厂秋招仍在进行中,有OA/VO可直接找我们PM获取助攻位,
Python / C++ / Java 全支持,难题不过我们直接带飞。