Robinhood software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.
n nodes labeled 0 through n - 1. Each directed edge connects node u to node v and carries an integer...Input: Graph (nodes and edges)house) and one from the street-side...Input: Graph (nodes and edges)System Design Questions - Robinhood Robinhood has a fairly fixed System Design Bank and usually asks one of these 2 questions
Input: Given inputid, type, referrer, and referee; type is referral.referrer != referee and the referee is not already on the platform. A rejected record has no effects, including not registering its referrer.referral_leaderboard(records: list[dict[str, str]]) -> candidate_definedThe return type is up to you; the examples use a leaderboard object containing {user, score} entries.Example 1:[
{"id":"r1","type":"referral","referrer":"Ava","referee":"Ben"},
{"id":"r2","type":"referral","referrer":"Ben","referee":"Cara"},
{"id":"r3","type":"referral","referrer":"Ava","referee":"Drew"},
{"id":"r4","type":"referral","referrer":"Cara","referee":"Ava"},
{"id":"r5","type":"referral","referrer":"Drew","referee":"Eli"}
]{"leaderboard":[{"user":"Ava","score":4},{"user":"Ben","score":1},{"user":"Drew","score":1}]}r4 is rejected because Ava already exists; Ben wins the score-1 tie over Drew.Part 2 — Qualification corrections and an auditable timelinequalification records with string fields id, type, user, and state, where state is exactly included or excluded.excluded user contributes zero credit to every ancestor; an included user contributes one. This changes only that user's contribution: descendants remain attached and contribute according to their own states.included, and qualification changes never allow a user to be referred again.id, a status of applied or ignored, and the leaderboard immediately after that record. Accepted referrals and genuine qualification changes are applied; all other records are ignored.referral_timeline(records: list[dict[str, str]]) -> candidate_definedExample 2:[
{"id":"a","type":"referral","referrer":"Ava","referee":"Ben"},
{"id":"b","type":"referral","referrer":"Ben","referee":"Cara"},
{"id":"c","type":"referral","referrer":"Cara","referee":"Dana"},
{"id":"d","type":"qualification","user":"Ben","state":"excluded"},
{"id":"e","type":"qualification","user":"Cara","state":"excluded"}
]{
"leaderboard":[{"user":"Ava","score":1},{"user":"Ben","score":1},{"user":"Cara","score":1}],
"timeline":[
{"id":"a","status":"applied","leaderboard":[{"user":"Ava","score":1}]},
{"id":"b","status":"applied","leaderboard":[{"user":"Ava","score":2},{"user":"Ben","score":1}]},
{"id":"c","status":"applied","leaderboard":[{"user":"Ava","score":3},{"user":"Ben","score":2},{"user":"Cara","score":1}]},
{"id":"d","status":"applied","leaderboard":[{"user":"Ava","score":2},{"user":"Ben","score":2},{"user":"Cara","score":1}]},
{"id":"e","status":"applied","leaderboard":[{"user":"Ava","score":1},{"user":"Ben","score":1},{"user":"Cara","score":1}]}
]
}c, the chain has scores 3, 2, and 1. Excluding Ben subtracts 1 only from Ava: her score becomes 0 + 1 + 1 = 2, while Ben still counts Cara and Dana. Excluding Cara subtracts 1 from Ava and Ben; Dana is then the sole qualifying descendant credited to each of Ava, Ben, and Cara. The final three-way tie is resolved alphabetically.Example 3:[
{"id":"p","type":"referral","referrer":"Mia","referee":"Noah"},
{"id":"q","type":"referral","referrer":"Noah","referee":"Owen"},
{"id":"r","type":"qualification","user":"Noah","state":"excluded"},
{"id":"s","type":"qualification","user":"Noah","state":"excluded"},
{"id":"t","type":"referral","referrer":"Owen","referee":"Mia"}
]{
"leaderboard":[{"user":"Mia","score":1},{"user":"Noah","score":1}],
"timeline":[
{"id":"p","status":"applied","leaderboard":[{"user":"Mia","score":1}]},
{"id":"q","status":"applied","leaderboard":[{"user":"Mia","score":2},{"user":"Noah","score":1}]},
{"id":"r","status":"applied","leaderboard":[{"user":"Mia","score":1},{"user":"Noah","score":1}]},
{"id":"s","status":"ignored","leaderboard":[{"user":"Mia","score":1},{"user":"Noah","score":1}]},
{"id":"t","status":"ignored","leaderboard":[{"user":"Mia","score":1},{"user":"Noah","score":1}]}
]
}r, Mia's score is 0 for Noah + 1 for Owen = 1; Noah still has score 1 for Owen. The repeated exclusion changes nothing. The last referral would close a cycle, but is already rejected by the existing-user rule because Mia registered at p; neither score changes.Notes:O(m log²(m + 2)) total time or better and O(m) space, including the timeline.Sign up for free to access walkthroughs, AI-generated questions, and more.
Get Started Free