Snapchat 其实在国内讨论不算多,但在美国互联网圈地位不低,尤其是它背后的技术栈和推荐系统在业内挺有名。岗位是 SDE New Grad,走的是标准的 OA + VO 流程。我投简历后一周左右收到 OA 邀请,平台是 HackerRank,时间是 90 分钟,三道题,全英文界面。
我自己平时刷题不算特别系统,所以这次还是决定找 ProgramHelp 辅助一下,采用的是他们的「远程无痕联机 + 实时语音提醒」服务。整个过程相当流畅,答题质量和效率都高了不少,也帮我避开了不少不必要的 debug 卡点。

Snapchat OA 真题还原
Message Propagation in a Social Network
Problem Description:
You are given a list of users in a social network, represented as an adjacency list. Each user has a list of friends (bi-directional connections). One user (the “starter”) begins spreading a message to all of their friends at minute 0. In each subsequent minute, newlyinformed users pass the message on to their own friends (excluding the person they heard it from).
Your task is to determine the minimum number of minutes it takes for all users to receive the message. If some users can never receive the message (i.e., thenetwork is disconnected), return the list of unreachable users.
Function Signature:
def messageSpreadTime(graph: Dict[str, List[str]], starter: str) -> Union[int, List[str]]:
Example Input:
graph = {
"A": ["B", "C"],
"B": ["A", "D"],
"C": ["A"],
"D": ["B"],
"E": ["F"],
"F": ["E"]
}
starter = "A"
Example Output:
3 # A -> B/C (1) -> D (2); E/F unreachable
# OR
["E", "F"]
Follow-up Variation:
How would you design this if the graph is huge (millions of nodes) and distributed?
2. Event Compression
Problem Description:
You are given a list of user activity logs in the format [(timestamp1, userId1), (timestamp2, userId2), ...]
sorted by timestamp. Users may appear multiple times.
Your task is to compress the log so that for each user, only their first and last appearance are kept.
Function Signature:
def compressLogs(logs: List[Tuple[int, str]]) -> List[Tuple[int, str]]:
Example Input:
logs = [
(1, "u1"),
(2, "u2"),
(3, "u1"),
(4, "u3"),
(5, "u2"),
(6, "u1")
]
Example Output:
[(1, "u1"), (6, "u1"), (2, "u2"), (5, "u2"), (4, "u3")]
Explanation:
u1 first at 1, last at 6 → keep 1 and 6
u2 first at 2, last at 5 → keep 2 and 5
u3 only appears once → keep 4
3. Longest Balanced Substring
Problem Description:
You are given a string consisting of only lowercase letters. A balanced substring is defined as one where the number of vowels and consonants are equal.
Your task is to return the length of the longest balanced substring.
Function Signature:
def longestBalancedSubstring(s: str) -> int:
Example Input:
s = "abcdeiou"
Example Output:
6 # "cdeiou"
Interview FAQ:关于 Snapchat OA,你可能也有这些疑问!
Q1:Snapchat 的 OA 都是什么形式?是 LeetCode 原题吗?
A:Snapchat OA 是在 Karat 平台上完成的,没有摄像头监控,但后台有代码行为记录。题目大多是“改编版”的 LeetCode 类型,强调实际业务背景,比如 log 压缩、事件处理、平衡判断等,不是纯算法套路刷题。和 TikTok、DoorDash 的风格有点类似,属于偏场景化+算法结合的类型。
Q2:题目难度怎么样?需要很强的算法功底吗?
A:整体难度中等偏下,关键是你对hash map、prefix sum、sliding window、dict 操作这些要非常熟练,能很快在陌生业务背景下看出题目的本质。不是特别需要高深的 DP、图论之类的高阶算法,但代码结构、鲁棒性要写得干净。
Q3:时间够用吗?能用 Python 吗?
A:时间是 70 分钟做 3 道题,基本是够的,尤其用 Python 会更快。Snapchat 的评测平台支持 Python3/Java/CPP,Python 是绝对推荐的,尤其是处理字符串、dict、list 操作时非常高效。
Q4:Snapchat 更看重算法能力,还是代码工程化?
A:**Snap 的重点不是考你能不能写出最优算法,而是能不能写出 robust 的业务逻辑代码。**你写的代码结构清晰、变量命名合理、能 cover edge case、解释性强,远比写一个 obscure 的 one-liner 更有价值。
Q5:能重复提交吗?会有 test case feedback 吗?
A:Karat 平台支持本地 test case 测试,但不会显示 hidden case 是否通过。每题一般允许多次提交(10次以内),但要避免花太多时间 Debug 一题导致时间不够。
Q6:ProgramHelp 能提供什么样的辅助?
A:我们这边可以提供 OA 联机远程协助,包括:
全程无痕代码编写支持(你在页面写,我们实时协同在本地写并语音提醒)
提前讲解出题逻辑、题型套路,提高你 5 分钟内识题 +拆题的能力
解题过程中,实时语音提示 bug 位置和修复建议,避免卡死
事后复盘你的代码 + 补交简洁解法,帮助你二轮面试更 smooth
最后一点建议 + ProgramHelp 助力上岸小tips
Snapchat 的 OA 属于典型的「题干看着复杂,其实考的是基本功」类型。只要你平时刷题基础扎实,再加上对题意的快速拆解能力,其实通过并不难。关键在于:第一时间能识题、理清逻辑、避免卡壳。
如果你时间紧,或者希望最大程度提升稳定性,我们 ProgramHelp 可以帮你做到:
真题还原 + 高频题型讲解,提前熟悉出题套路
无痕远程协助,手把手带你写,关键时刻语音提示避坑
面后代码复盘 + follow-up 高效解法补充,一次过关不留遗憾
我们已经帮助无数同学顺利上岸包括 Snapchat、Pinterest、TikTok、Databricks 在内的 top tech 公司,不想错过机会的你,也可以来找我们聊聊你的情况。