Design a Crypto Asset Explore Page
Serve a public, read-heavy page that lists thousands of crypto assets with live prices, sortable rankings and small charts to millions of concurrent viewers, without ever showing a wrong price as current.
Problem statement
For this exercise, assume a crypto exchange has a public page where visitors browse the assets it lists. Signed-out and signed-in visitors see the same market data on this page; watchlists, holdings and trading are not part of it.
Assume the page covers about 5,000 assets. Each row shows the asset's name, ticker and icon, its current price in US dollars, its change over the last 24 hours, its market cap, its 24-hour trading volume, and a small chart of its price over the last 24 hours.
Visitors can sort the list by market cap, 24-hour change or 24-hour volume, open a few curated lists (top gainers, top losers and newly listed assets), page through any list 50 rows at a time, and search by name or ticker.
While the page is open, the price, 24-hour change and market cap of the rows on screen update live without a reload.
Assume about 500 of the assets trade on the exchange's own markets; the rest are priced only from external reference feeds. Market cap uses a circulating-supply figure from a reference data provider that changes at most once a day.
A price shown as current must not be wrong: when an asset's sources stop updating or report an implausible value, the page shows the price as delayed or hides it instead of presenting it as live. The price, 24-hour change and market cap in one row must be computed from the same price.
Design the services that turn market data into this page and keep it live for millions of viewers. The asset detail page, the buy flow, news, and the exchange's matching engine are out of scope.
What to build
- A visitor can open the page and page through any sorted or curated list, 50 rows at a time, seeing each row's price, 24-hour change, market cap, 24-hour volume and 24-hour chart.
- A visitor can search by asset name or ticker and get the matching rows with the same fields.
- While the page is open, the price, 24-hour change and market cap of the rows on screen update live without a reload.
- Every price shown comes from an accepted update with a known source and time, is labeled live or delayed, and is marked delayed or withheld when its sources are stale or report an implausible value.
At scale
- For this exercise, assume about 1 million viewers have the page open at a normal peak and up to 5 million during sharp market moves, when page loads reach about 50,000 per second.
- For this exercise, assume the exchange's own markets produce up to 200,000 trade and quote updates per second at peak, mostly on a few popular assets, and external feeds update each other asset every 1 to 10 seconds.
- For this exercise, assume a live price on screen should be at most about 2 seconds behind the latest accepted price, and the first page should load within 1 second at p95.
- For this exercise, assume the order of a sorted or curated list may lag prices by up to 30 seconds when a visitor opens it, and the 24-hour charts may lag by up to 5 minutes.