
Robinhood是一家总部位于美国加利福尼亚州的金融科技公司,成立于 2013 年。作为一家创新型的证券经纪公司,公司以其业务模式和产品特点在金融科技行业引起了广泛关注。
ProgramHelp 帮助不少人入职了这家,说engineering文化很好。六月份投了简历,第二天recruiter replied,说了一下情况,就开始约VO面试。
Robinhood VO 面经
第一轮 Coding
Robinhood有个推荐系统:老用户推荐新用户加入,每条推荐关系只能发生一次,不会有循环推荐。我们想知道哪些用户的“推荐链”最厉害:统计每位用户最终带来的新用户总数(包括被直接推荐的和间接通过他们继续推荐的新用户),然后列出影响力前三名。
排序规则:
每个用户只会被推荐一次:也就是说,一个新注册的用户,只可能是由一名现有用户推荐而来,不会被多个人重复推荐。
推荐链没有环:不存在在用户间相互循环推荐的情况。
根据推荐数量进行排序:统计每一位用户的总推荐人数,并根据数字从大到小排序。如果有用户的推荐总数相同,则按用户名的字母顺序从小到大排序。
输出推荐榜单:只列出推荐数最多的前三名用户,每个用户的输出格式为“用户名 推荐数量”。
举个例子:
给定已有用户列表 rh_users = ["A", "B", "C"]
新加入的用户列表 new_users = ["B", "C", "D"]
其中,”A”推荐了”B”,”B”推荐了”C”,”C”推荐了”D”。
通过这些数据,我们可以得到:
A 最终影响了 B、C、D 三个用户(A→B→C→D)
B 最终影响了 C、D 两个用户(B→C→D)
C 最终影响了 D 一个用户(C→D)
因此,排行榜为:
A 3
B 2
C 1
输出结果即:["A 3", "B 2", "C 1"]
第二轮:Design a Leaderboard
题目描述:设计支持以下操作的排行榜: addScore (playerId, score):更新 / 添加玩家分数 top(K):返回前 K 名玩家的总分。
解题思路: 哈希表 + 最小堆 / 平衡二叉搜索树 – 用哈希表存 playerId 到 score 的映射,实现 addScore 和 reset 的 O(1) 查找。top(K) 用最小堆(维护前 K 大分数)或平衡二叉搜索树高效获取,前者时间复杂度 O(N log K),后者 O(N log N)。
第三轮 Coding
Given a stream of incoming “buy” and “sell” ordersorders = ["155", "3", "buy"], determine the total quantity.
A “buy” order can be executed if there is a corresponding “sell” order with a price equal to the price of the “buy” order.
Similarly, a “sell” order can be executed if there is a corresponding “buy” order with a price greater than or equal to the price of the “sell” order.
It is possible that an order does not execute immediately. In such case, you should keep track of that order and execute it when it is processed, if possible.
Note: Orders can be partially executed.
Sample Input
orders = [
['150', '5', 'buy'], # Order A
['190', '1', 'sell'], # Order B
['200', '1', 'sell'], # Order C
['100', '9', 'buy'], # Order D
['140', '8', 'sell'], # Order E
['210', '4', 'buy'], # Order F
]
Sample Output
9
Execution time limit: 3 seconds (Java)
[Input]
array.array.string orders
[Output]
integer
[Java] Syntax Tips
// Prints help message to the console
// Returns a string
// Globals declared here will cause a compilation error, declare variables inside the function instead!
Order Book
Buys: ['100', '9', 'buy']
Sells: ['200', '1', 'sell']
Total Shares: 5 + 3 + 1 = 9
Robinhood 面试Tips
Robinhood 是一家有使命感的公司,致力于降低投资门槛,让更多人能接触到金融信息和投资机会。所以,面试官希望找到那些和公司使命一样有激情的新员工。
在回答面试中的行为问题时,尽量通过自己的真实经历来展现你对这个问题的关注,并说明你如何把这份热情带到 Robinhood,帮助更多的客户。
如果大家想要Robinhood的面试辅助,可以找 Programhelp 聊聊~我们有远程无痕面试助攻、语音提醒、代面试等这些全套服务,已经陪跑过不少学员顺利拿下 Netflix、Amazon、Capital One 等大厂 offer。别一个人硬扛,大厂面试其实没那么可怕!