Review cards · 21 cards
Estimation
Back-of-envelope numbers: requests per second, storage, bandwidth and the constants behind them.
Cards
- Network links are quoted in _____ per second, while file sizes are in bytes, so a 1 Gbit/s link moves at most about 125 MB/s: divide by _____.
- Users publish 5,000 posts a second, and an author has 200 followers on average. With fan-out on write, how many feed-cache inserts per second does that cause?
- In a storage estimate, what sizes do you assume for a numeric id, a timestamp, a UUID and a short text field?
- A photo app serves 50,000 image views a second at peak, and an image averages 200 KB. What outbound bandwidth does that need?
- 1,000 servers each write 50 log lines a second, and a line averages 200 bytes. How much log data is produced per day?
- 100,000 hosts each report 200 metrics every 10 seconds. How many data points per second does the ingestion tier receive?
- An app has 10 million daily active users, and each makes 20 requests a day. What is the average load in requests per second?
- A URL shortener creates 100 million new links a month, and each link is read 100 times for every time one is created. What is the average read load?
- Why work out the read-to-write ratio early in a design, and what does each answer point to?
- What is the quick rule for turning "per day" into "per second"?
- A 30-day month has about _____ seconds, so 100 million requests a month average about _____ requests a second.
- Peak load is 60,000 requests/s. One server handles 2,000 requests/s at most, and you want each to run at no more than 60% of that. How many servers?
- About how much slower is a random 4 KB read from an SSD than a read from main memory?
- Users upload 500 hours of video every minute. After transcoding, all the resolutions of one hour take about 1 GB in total. How much new storage is needed per day?
- A URL shortener uses 7-character codes made of a–z, A–Z and 0–9. How many distinct codes are there?
- A service stores 500 million short links. You want to cache the hottest 20% of them, and each cache entry (key, URL and overhead) takes about 500 bytes. How much cache memory is that?
- A network round trip inside one data center takes about _____, while a round trip from California to Europe takes about _____.
- Which of these takes the longest?
- Users write 100 million posts a day, 300 bytes each (text and metadata, no media). How much storage do five years of posts need, before replication?
- Why do large tables use 64-bit ids instead of a 32-bit integer column?
- A service receives 5,000 requests/s, and each request takes 200 ms to answer. On average, how many requests are in progress at any moment?
More topics
- Networking 16 cards
- API design 17 cards
- Caching 21 cards
- Databases 22 cards
- Replication 15 cards
- Sharding 18 cards
- Consistency 19 cards
- Queues 18 cards
- Streaming 18 cards
- Availability 14 cards
- Resilience 16 cards
- Storage 14 cards
- Realtime 15 cards
- Data structures 16 cards
- Security 17 cards
- Observability 18 cards
- Coordination 16 cards