Skip to the guide

Design a stock trading app (like Robinhood)

AdvancedCase study12 pages

People open an app, watch prices move, and buy or sell shares with a tap. The app checks they can afford it and sends the order to a firm that executes it. When it fills, the app records the shares and the cash, and every night it matches its books against the clearing firm's. It's a travel agent for shares: it never runs the market, but it books your seat on it and keeps your receipts.

It's also asked as "design Robinhood", "design a brokerage" or "design an online trading platform". This page is the broker, not the exchange: orders go out to market makers and exchanges, which match them. A follow-up covers being the exchange. The closest case study is Payment system, another ledger fed by an outside party's messages. Interviewers like it because the load arrives at one known second each morning and prices go to millions of phones at once. Cash and shares must also match to the cent and the share.

Below is a full mock interview following the seven steps of the framework. You're the candidate: at each Guess before you read on, stop and answer first.

Step 1 · Clarify the features and cut the scope

Minutes 0–5 · How this step works

Interviewer: Design a stock trading app like Robinhood.

You: Are we the broker, sending orders to market makers and exchanges, or the exchange that matches them?

Interviewer: The broker.

You: US stocks during market hours, with market and limit orders?

Interviewer: Yes. Options, crypto, margin and extended hours are out.

You: Live prices on the watchlist and charts?

Interviewer: Live, yes.

You: And cash in and out from a bank account?

Interviewer: Yes, standard transfers. Instant deposits are out.

You: Then I'll cover accounts with cash and positions, live quotes, placing and cancelling orders, routing them out, fills, the ledger and reconciliation with the clearing firm. Out: the exchange itself, options, fractional shares and tax forms. OK?

Interviewer: OK.

Each answer shapes the design: as the broker, orders leave our system and fills come back as messages we don't control. Market hours put the peak at 9:30 Eastern, live prices mean fan-out to phones, and cash and shares mean a ledger.