Robinhood | Phone Screen
Question Details
A trade is defined as a fixed-width string containing the 4 properties given below separated by commas: Symbol (4 alphabetical characters, left-padded by spaces) Type (either "B" or "S" for...
Full Details
A trade is defined as a fixed-width string containing the 4 properties given below separated by commas:
Symbol (4 alphabetical characters, left-padded by spaces)
Type (either "B" or "S" for buy or sell)
Quantity (4 digits, left-padded by zeros)
ID (6 alphanumeric characters)
e.g.
"AAPL,B,0100,ABC123"
which represents a trade of a buy of 100 shares of AAPL with ID "ABC123"
Given two lists of trades - called "house" and "street" trades, write code to filter out groups of matches between trades and return a list of unmatched house and street trades sorted alphabetically. There are many ways to match trades, the first and most important way is an exact match (Tests 1-5):
An exact match is a house_trade+street_trade pair with identical symbol, type, quantity, and ID
Note: Trades are distinct but not unique
For example, given the following input:
// house_trades:
[
"AAPL,B,0100,ABC123",
"AAPL,B,0100,ABC123",
"GOOG,S,0050,CDC333"
]
// street_trades:
[
" FB,B,0100,GBGGGG",
"AAPL,B,0100,ABC123"
]
We would expect the following output:
[
" FB,B,0100,GBGGGG",
"AAPL,B,0100,ABC123",
"GOOG,S,0050,CDC333"
]
Because the first (or second) house trade and second street trade form an exact match, leaving behind three unmatched trades.
Follow-up 1 (Test 6,7,8,9): A "fuzzy" match is a house_trade+street_trade pair with identical symbol, type, and quantity ignoring ID. Prioritize exact matches over fuzzy matches. Prioritize matching the earliest alphabetical house trade with the earliest alphabetical street trade in case of ties.
Follow-up 2: (Test 10) An offsetting match is a house_trade+house_trade or street_trade+street_trade pair where the symbol and quantity of both trades are the same, but the type is different (one is a buy and one is a sell). Prioritize exact and fuzzy matches over offsetting matches. Prioritize matching the earliest alphabetical buy with the earliest alphabetical sell.
[execution time limit] 4 seconds (py3)
[input] array.string house_trades
[input] array.string street_trades
[output] array.string
A list of unmatched trades both house and street, ordered alphabetically
\t
Some Testcases:
TEST1
Input:
house_trades:
["AAPL,B,0100,ABC123",
"GOOG,S,0050,CDC333"]
street_trades:
[" FB,B,0100,GBGGGG",
"AAPL,B,0100,ABC123"]
Expected Output:
[" FB,B,0100,GBGGGG",
"GOOG,S,0050,CDC333"]
TEST2
Input:
house_trades:
["AAPL,S,0010,ZYX444",
"AAPL,S,0010,ZYX444",
"AAPL,B,0010,ABC123",
"GOOG,S,0050,GHG545"]
street_trades:
["GOOG,S,0050,GHG545",
"AAPL,S,0010,ZYX444",
"AAPL,B,0010,TTT222"]
Expected Output:
["AAPL,S,0010,ZYX444"]
TESTS2
Input:
house_trades:
["AAPL,B,0010,ABC123",
"AAPL,S,0015,ZYX444",
"AAPL,S,0015,ZYX444",
"GOOG,S,0050,GHG545"]
street_trades:
["GOOG,S,0050,GHG545",
"AAPL,S,0015,ZYX444",
"AAPL,B,0500,TTT222"]
Expected Output:
["AAPL,B,0010,ABC123",
"AAPL,B,0500,TTT222",
"AAPL,S,0015,ZYX444"]
TEST3
Input:
house_trades:
["AAPL,B,0100,ABC123",
"AAPL,B,0100,ABC123",
"AAPL,B,0100,ABC123",
"GOOG,S,0050,CDC333"]
street_trades:
[" FB,B,0100,GBGGGG",
"AAPL,B,0100,ABC123"]
Expected Output:
[" FB,B,0100,GBGGGG",
"AAPL,B,0100,ABC123",
"AAPL,B,0100,ABC123",
"GOOG,S,0050,CDC333"]
Topics
More from Robinhood
About Robinhood Interview Reports
This question was reported by a candidate who interviewed at Robinhood. LeakCode aggregates interview reports from 10+ sources, including 1Point3Acres, Glassdoor, LeetCode Discuss, Blind, Reddit, Indeed, and Nowcoder. Each report is translated where necessary, deduplicated against existing entries, and tagged by company, role, round type, and reporting date.
Use this question as one calibration data point, not a memorization target. Companies typically rotate their question pools every 2-4 months; the exact wording of a 2024 question may differ from what you encounter today. The underlying pattern, difficulty level, and follow-up depth at Robinhood are the higher-signal extractions to take from this report.
For broader preparation context, the Robinhood interview process typically includes a recruiter screen, one or two technical phone screens, and a 4-5 round on-site loop covering coding, system design (at L4+ levels), and behavioral. Reports tagged on LeakCode show the round-by-round distribution and typical difficulty calibration. To browse questions filtered by round type and seniority, use the company hub linked above.
How To Practice This Type of Question
Solve similar problems on LeetCode under timed conditions (25-35 minutes per medium difficulty). The goal is pattern recognition: recognize the underlying technique (sliding window, two-pointer, BFS, memoized recursion, etc.) within 60-90 seconds of reading. Strong candidates verbalize their hypothesis out loud before coding, then iterate based on feedback. Weak candidates dive into implementation immediately, lose time on the wrong approach, and run out of time for follow-ups.
Companies update their question pools every 2-4 months. The exact wording of any given question may have been retired by the time you interview. Focus your prep on the pattern, not the specific problem. The patterns that appear in Robinhood reports consistently are the ones worth investing in; one-off niche problems are not.
During Your Robinhood Round
Apply the standard interview round template: clarify requirements (2-3 minutes), state your approach out loud and confirm direction with the interviewer (3-5 minutes), code with narration (15-25 minutes), test with concrete examples including edge cases (5 minutes), discuss optimization or trade-offs if time permits (5 minutes). This template is universally accepted across FAANG and adjacent companies; deviating from it produces weaker interviewer feedback signal.
The single most predictive failure mode in Robinhood reports tagged "no hire": not asking clarifying questions. Interviewers are explicitly trained to weight this. Strong candidates ask 3-5 clarifying questions even on problems that look obvious; weak candidates dive into code immediately. The clarifying-question check is often the first signal recorded in the interviewer's written notes.