之前刷到有人说 Verisk OA 偏应用场景题,这次我自己做下来,确实感受到题目更注重“实用性”,没有很变态的算法,但对细节和边界要求很高。整套下来包括选择题、SQL 报表题和一道编程题,给大家还原一下。
题目 1: Big-O Notation
Question:
Big (O) notation… Pick ONE option
- identifies the best algorithm to solve a problem.
- determines maximum size of problem that can be solved on a system
- is the lower bound of growth rate of an algorithm.
- is the upper bound of the growth rate of an algorithm.
- None of the above.
👉 正确答案是第四个:Big-O notation 是描述算法增长率的上界(worst case)。
题目 2: SQL 报表
Question:
A marketing company maintains a database to track its advertising campaigns and engagements. The task is to generate a report that includes the name of each active campaign, the total number of engagements, and the sum of views and clicks for engagements.
- Only active campaigns should be included (
is_active = 1) - Columns:
campaign_name | total_engagements | total_views_and_clicks - Sorted by
campaign_name ASC
Schema:
campaigns (id, name, is_active)
engagements (campaign_id, views, clicks)
SQL 解法:
SELECT
c.name AS campaign_name,
COUNT(e.campaign_id) AS total_engagements,
COALESCE(SUM(e.views + e.clicks), 0) AS total_views_and_clicks
FROM campaigns c
JOIN engagements e
ON c.id = e.campaign_id
WHERE c.is_active = 1
GROUP BY c.name
ORDER BY c.name ASC;
👉 这里注意要用 COALESCE 处理可能没有 engagement 的情况,避免出现 NULL。
题目 3: Minimal Operations
Question:
For each word in a list, determine the minimum number of character replacements needed so that no two adjacent characters are the same.
Example:
words = ['add', 'book', 'break']
Output = [1, 1, 0]
Output = [1, 1, 0]
思路:
遍历字符串,遇到相邻相同的字符就记一次替换操作。
因为替换掉一个字符就能解决这一对重复,所以统计所有相邻相同对的数量即可。
Python 解法:
python
def minimalOperations(words):
res = []
for word in words:
count = 0
for i in range(1, len(word)):
if word[i] == word[i-1]:
count += 1
res.append(count)
return res
# 测试
print(minimalOperations(['add', 'book', 'break'])) # [1, 1, 0]
我的体验
- Verisk OA 更像是对 基础知识+实用技能 的考察:复杂度、SQL 报表、字符串处理。
- 时间安排上建议选择题 2 分钟搞定,SQL/编程题要留更多时间测试边界。
- 边界条件很重要:空字符串、单个字符、没有 engagement 的 campaign 等情况都要考虑。
Programhelp 助你拿下 OA
Programhelp 团队由 7 位来自顶尖 IT 院校(Oxford、Princeton、北大等)的学长学姐组成,均有 Amazon、Google、阿里等一线大厂背景。我们提供:
- OA 真题还原与讲解
- 无痕远程联机助攻
- 实时语音提醒 + Debug 指导
无论是 Verisk 还是其他大厂 OA/VO,我们都有成熟的全流程助攻方案,帮你在计时压力下依然稳住发挥。