Problem 1 — CICD Pipeline Dependency Ordering
CICD Pipeline:
- Different environments.
- If nothing is in prod the
Datamine the order in which we should deploy our resources.
Questions:
1. What are the inputs? [A,B] where A and B are resources. A depends on B
- list of lists where each inner list is a dependency pair and let's say we want to output w
这题本质是 拓扑排序(Topological Sort)。输入为依赖关系对 [A,B],表示 A 依赖于 B,需要输出资源正确的部署顺序。考察对有向无环图、入度、队列等概念的理解。
Problem 2 — Design an Extensible LRU Cache
Design class structure and implement an LRU cache.
Keep extensibility in mind, as we will follow up to add more eviction policies, like LFU.
要求设计可扩展的 LRU Cache,重点不是代码,而是 类结构设计、接口抽象、支持未来扩展 LFU 等策略。考察 O(1) 双向链表 + 哈希表,以及面向对象设计能力。
Problem 3 — Print Frequency of Numbers from 1 to
Given an array of N integers containing integers from 1 to N only.
Some numbers may appear multiple times, some numbers may not appear.
Write code to print out the count of times each number from 1 to N appears in the array. For example:
PrintFrequency(new int[] {3, 1, 2});
1 : 1
2 : 1
3 : 1
PrintFrequency(new int[] {2, 4, 4, 6, 6, 6});
1 : 0
2 : 1
3 : 0
4 : 2
5 : 0
6 : 3
这题考察 统计频率,要求在范围已知的情况下高效输出 1 到 N 的出现次数。核心是遍历数组并用计数数组记录次数,也可在 O(1) 空间下用“原地标记法”进阶解。
VOprep 团队长期陪同学员实战各类大厂 OA 与 VO,包括 Google、Amazon、Citadel、SIG 等,提供实时答案助攻、远程陪练与面试节奏提醒,帮助大家在关键时刻不卡壳。
如果你也在准备公司,可以了解一下我们的定制助攻方案——从编程面到系统设计,全程护航上岸。
正文完