Cloudflare 的 OA 一直都不是“刷题”风格能轻松应对的,更多考察的是工程理解、异常处理能力和底层网络知识。这次我拿到的 OA 一共包含三道 coding 题、一道 debug 和几道 networking 选择题,强度适中但考点很实战,适合有项目/实习经验的同学挑战。

一、Coding 题目
1. Minimal Unique Prefix
You’re given a list of non-empty words. For each word, return the shortest unique prefix that distinguishes it from all other words.
Input: ["dog", "cat", "apple", "apricot", "fish"]
Output: ["d", "c", "app", "apr", "f"]
Constraints:
- All words are lowercase.
- 1 <= len(word) <= 20
- 1 <= len(words) <= 1000
2. Reverse DNS Mapping
Given a list of hostnames and their IP addresses, build a reverse DNS mapping that shows for each IP address, the list of hostnames mapped to it.
Input: [
("mail.google.com", "8.8.8.8"),
("dns.google.com", "8.8.8.8"),
("cloudflare.com", "1.1.1.1")
]
Output: {
"8.8.8.8": ["mail.google.com", "dns.google.com"],
"1.1.1.1": ["cloudflare.com"]
}
Notes:
- Hostnames are unique.
- IPs may repeat.
3. Rate Limiter
Implement a basic API rate limiter that restricts how many times a user can make a request within a given time window.
Function Signature:
class RateLimiter:
def __init__(self, limit: int, window: int):
...
def allow_request(self, user_id: str, timestamp: int) -> bool:
...
Example:
rl = RateLimiter(limit=2, window=10)
rl.allow_request("alice", 1) # True
rl.allow_request("alice", 2) # True
rl.allow_request("alice", 3) # False (limit reached)
rl.allow_request("alice", 12) # True (outside window)
二、常见 FAQ 整理
Q1: OA 总共几道题?分别考什么?
3 道 coding(逻辑 + 数据结构 + 设计)
1 道 debug(log 定位 + Python 错误分析)
Networking 单选题 2 道(TCP/HTTP 基础)
Q2: coding题难度如何?时间够吗?
难度中等偏实用。题目本身不复杂,核心是你能不能用干净的代码表达清晰的逻辑。时间刚好,建议按 20min-20min-25min 控制节奏。
Q3: debug题型是怎样的?
会给你一段 Python 程序输出的日志文件,要求你指出程序为什么崩溃(比如 null reference、文件路径出错、循环边界问题等)。实际偏后端日志排查题型。
Q4: Networking 选择题考什么?
比如:
What layer of the OSI model does DNS belong to?
Which HTTP status code indicates a permanent redirect?
建议提前复习 TCP/IP 五层模型 + HTTP 状态码 + 常见请求头字段。
Q5: 是否需要提前准备特殊环境?
平台是自研的,界面清爽、支持 Python3,运行速度快,不支持第三方库。
Programhelp 助你远程稳过 OA
Cloudflare 这种实战型 OA,考的不是 Leetcode 套路题,而是你有没有真实编码经验、能不能理解系统底层原理。很多同学卡在 debug 和 networking 题目时,明明差一点就对了,可惜最后 timeout。
Programhelp 的远程语音助攻服务,专为这类工程型 OA 设计:
Coding 时提供逻辑梳理、边界判断提醒
Debug 时定位核心错误行,快速分析日志
Networking 提供实时术语解释和选择建议
全程语音陪跑,保证“无痕 + 高效 + 准确”
想了解我们如何助力你拿下 Cloudflare / Datadog / Snowflake 等工程岗
立即联系我们!