Robinhood VO – 最新 – 面經真題复盤含 – Coding -系統設計 – 項目追問

Robinhood VO - 最新 - 面经真题复盘含 - Coding -系统设计 - 项目追问

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” orders
orders = ["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。別一個人硬扛,大廠面試其實沒那麼可怕!

author avatar
ProgramHelp
END
 0
Comment(尚無留言)