Skip to main content
All Questions

Build a stock broker application with an order-matching exchange.

Unlock detailed company stats for this questionUpgrade

Requirements:

  1. Add/register users to the stock exchange system.
  2. Add stocks to the system.
  3. Each user has a stock holding list (stock, price, qty) and a balance.
  4. Users can add balance to their account.
  5. Users can buy and sell multiple stocks.
  6. Users can check their past successful trades. Features: traders place buy and sell orders for a stock with a price and quantity. Each order enters the exchange's order book and remains there until matched; matching is attempted whenever a new order is added. The exchange uses FIFO price-time priority: the first order at a price level is matched first, and orders at the same price level are filled by time. Lower selling prices and higher buying prices get priority. A trade executes when a buy price is greater than or equal to a sell price, and is recorded at the sell order's price regardless of the buy price.

Community answers

No answers contributed by the community yet.

Related courses

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.

Course

System Design Interviews

Learn how to answer the latest system design questions across product, infrastructure, and AI domains. Features in-depth video examples, written breakdowns, and helpful reference patterns. Watch senior engineers and managers answer these questions in mock interview videos.