这几天又辅助了一位同学完成 Bloomberg 的线上 Coding 面试。不得不说,Bloomberg 的题型依旧“稳狠准”,既考代码基础,又暗藏系统设计味道。今天就把遇到的两道真题整理一下,希望能给正在准备 BB 的同学一点方向。
📌 第一题:Flatten a Linked List(链表扁平化)
Imagine a linked list with not just a next node, but a down node as well.
We want to write a function that would flatten that linked list by taking all the downward segments and merging them up between their parent and their parent’s next.
题目给了一个类似“多层楼叠起来的链表结构”:
1 -> 2 -> 3 -> 8 -> 10
| |
4->5->6->7
|
9
目标是把所有 down-link 的链条按 DFS 顺序“拍扁”,得到:
1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 -> 9 -> 10
🧩 考点非常明确:
- 链表结构操作熟练度
- 递归 / 栈模拟 DFS
- 处理 next 与 down 两条指针的边界情况
我们在辅助时重点是:
如何避免破坏 next 链条、如何正确接回扁平后的尾节点。
Bloomberg 对 clean code 要求极高,所以我们也帮同学做了结构化整理 + 代码 refactor。
📌 第二题:Interactive Map – Dynamic Average Grid(动态平均值网格系统)
An interactive map displays some live metric (e.g., GDP, infection rate…).
Squares must be recolored based on the average value of visible squares when user zooms.
Implement two methods:
updateValue(x, y, newValue)
getAverage(x1, y1, x2, y2) (rectangle average)
题目很像简化版 OLAP + prefix sum(前缀和矩阵)。
核心需求:
- 网格数据 要支持频繁更新
- 大矩形区域要能 快速求平均值
这题非常考察:
✔ 二维前缀和
✔ difference matrix(差分矩阵)
✔ 如何在 O(1) 或 O(logN) 完成区域查询
✔ 如何保持 update 与 getAverage 平衡
我们带学生一步步从:
朴素版 → 前缀和版 → 可更新前缀和(Fenwick Tree)版
Bloomberg 非常喜欢看“从低到高的思考过程”,而不是一上来写最终解。
🎯 最后送给准备 Bloomberg 的同学几句建议
- Bloomberg 更看重 coding clarity 和 thought process
- 解释你的设计决定比写对代码更重要
- 带着“如何让别人维护你的代码”的思路回答,分数会更高
🔧 想要全程真实辅助?我们可以帮你
如果你也想像文中的同学一样,在 Bloomberg / Meta / Amazon 的 Coding 环节里拿到稳稳的高分,我们提供:
🟢 真实面试中的实时代码讲解与思路辅助
🟢 完整代码框架 + 边界情况分析
🟢 题目翻译、思路结构化、代码优化
🟢 模拟面试 & 过往真题库
不灌水、不模板,都是你真实面试过程中用得上的内容。
需要的话随时私聊我。
➡️ 可以联系 CSOAHelp(我们提供高质量 OA/VO 面试辅助与全流程解析)。

