Robinhood VO - Latest - Interview Questions Review Including - Coding - System Design - Project Tracking

938 Views
Robinhood VO - Latest - Interview Questions Review Including - Coding - System Design - Project Tracking

Robinhood is a California-based financial technology company founded in 2013 . As an innovative stock brokerage firm, the company has attracted a lot of attention in the FinTech industry with its business model and product features.

ProgramHelp has helped a lot of people get into this company and said that the engineering culture is very good. I submitted my resume in June, and the next day the recruiter replied and told me about the situation, and then I started to ask for a VO interview.

Robinhood VO Interview

First round of Coding

Robinhood has a referral system: old users recommend new users to join, each referral relationship can only happen once, there is no circular referral. We want to know which users have the most powerful "referral chain": count the total number of new users each user eventually brings in (including those who are directly referred and those who are indirectly referred on through them), and then list the top three influencers.

Sorting rules:

Each user will only be referred once: that is, a newly registered user may only be referred by an existing user, and will not be referred repeatedly by more than one person.
There are no loops in the recommendation chain: there is no looping of recommendations among users to each other.
Sort by number of referrals: the total number of referrals for each user is counted and sorted from largest to smallest based on the number. If there are users with the same total number of referrals, they are sorted alphabetically by username from smallest to largest.
Output recommendation list: only the top three users with the highest number of recommendations are listed, and the output format of each user is "username number of recommendations".

An example:

Given a list of existing users rh_users = ["A", "B", "C"]
List of newly added users new_users = ["B", "C", "D"]
Where "A" recommended "B", "B" recommended "C", and "C" recommended "D ".

With this data, we can get:

A ultimately affects three users B, C and D (A→B→C→D)
B ultimately affects two users C and D (B→C→D)
C ultimately affects one user D (C→D)

Hence the leaderboard for:

A 3
B 2
C 1

The output result i.e:["a 3", "b 2", "c 1"]

Round 2: Design a Leaderboard

Description: Design a leaderboard that supports the following operations: addScore (playerId, score): update/add a player's score top(K): return the total score of the top K players.

Solution idea: Hash table + minimal heap / balanced binary search tree - use hash table to store the mapping from playerId to score, implement O(1) lookup for addScore and reset. top(K) is efficiently obtained by using either the minimal heap (which maintains the top K scores) or the balanced binary search tree, the time complexity of the former is O(N log K) and the latter is O(N log N). The time complexity is O(N log K) for the former and O(N log N) for the latter.

Round 3 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 of $0.00. 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 Interview Tips

Robinhood is a company with a mission to lower the barriers to investing and make financial information and investment opportunities more accessible to more people. Therefore, interviewers are looking for new hires who share the company's mission and are passionate about it.

When answering behavioral questions in an interview, try to show that you care about the issue through your own real-life experiences and explain how you can bring this passion to Robinhood to help more clients.

If you want Robinhood interview assistance, you can find Programhelp. We have a full set of services such as remote no-opener interview assistance, voice reminders, interviews on behalf of the interview, etc. We have accompanied a lot of students to successfully get Netflix, Amazon, Capital One and other big company offers!

author avatar
Alex Ma Staff Software Engineer
Currently working at Google, with more than 10 years of development experience, currently serving as Senior Solution Architect. He has a bachelor's degree in computer science from Peking University and is good at various algorithms, Java, C++ and other programming languages. While in school, he participated in many competitions such as ACM and Tianchi Big Data, and owned a number of top papers and patents.
END