Building blocks
Fourteen boxes cover almost every design you will draw in a round. For each one, the pressure that calls for it, the number it buys or costs, and the failure the interviewer asks about once it is on the board.
Which building blocks do I need to know for a system design interview?
Fourteen cover almost every prompt: a load balancer, a cache, a CDN, a relational store, a key-value store, a wide-column store, an object store, a search index, a message queue, a stream processor, a scheduler, a WebSocket tier, a rate limiter and an ID generator. For each, know the pressure that calls for it, one number, and the failure an interviewer will probe. Knowing the internals of one product matters less than knowing when each block earns its place.
When should I add a cache to a design?
When reads far outnumber writes, the same keys are read again and again, and a read may be a little stale. Then say the hit rate, because the store sees only the misses. On a path of 3 thousand reads a second with a store that does 1.2 thousand, a 90 percent hit rate sends it 300 a second and a 50 percent hit rate sends it 1.5 thousand, more than it can serve. Below a 60 percent hit rate that store falls behind, so there the cache is capacity, not an optimisation.
How do I choose between a relational store, a key-value store and a wide-column store?
By what arrives with the read. If the data has relations and invariants and the writes fit one primary, about 5 thousand synced commits a second, start relational. If every read arrives with its key and the data outgrows one box, use a key-value store. If rows are written fast and read back by one key in order, like messages in a chat, use a wide-column store. Say the reason in one sentence, tied to a number.
When do I need a message queue?
When the response does not have to wait for the work, when producers burst faster than consumers, or when one event feeds several consumers. The queue buys a fast response and a buffer, and costs a hop and at-least-once delivery. So the next sentence is always how the consumer stays correct when a message arrives twice: it is idempotent, keyed by the message id.
Is it bad to add too many components?
Yes. Every block you draw is one the interviewer can kill in the failure phase, and a block with no pressure behind it reads as poor judgment rather than depth. Draw the fewest blocks that meet the numbers you stated, and say the threshold at which you would add the next one.