System Design From Zero: An En... Note

System Design From Zero: An Engineering Head Teaches His Nephew

Engineers often struggle with system design questions not due to a lack of technical knowledge but a missing framework. Jumping straight to technology choices before understanding the problem and scale leads to unstructured answers. A systematic approach, starting with understanding the problem and requirements, is crucial. This structured thinking allows for data-driven decisions rather than guesswork.The master framework consists of three phases: Understand, Design, and Robustify, encompassing twelve steps. Phase 1, Understand, covers defining the problem, gathering functional and non-functional requirements, and estimating scale. Non-functional requirements like scalability, availability, and latency are key differentiators. Step 3, understanding these non-functional requirements and their implications, shows seniority.Scale estimation, the most skipped step, involves calculating metrics like Daily Active Users and requests per day. These numbers dictate subsequent architectural choices. Back-of-the-envelope calculations are essential, using formulas for QPS, storage, bandwidth, and cache memory. Memorizing key figures like seconds in a day and units of data is vital for quick calculations.Designing for peak traffic, not average, is a core principle to ensure system stability. Understanding yearly storage needs helps anticipate future scaling challenges like sharding. Bandwidth calculations inform network infrastructure requirements. Cache memory calculations determine the necessary resources for caching hot data.Consistently calculating seven key numbers—DAU, total requests, read/write requests, read QPS, peak QPS, and yearly storage—builds essential muscle memory. This disciplined approach, grounded in quantitative analysis, transforms a candidate's ability to confidently tackle any system design question. The framework ensures a logical flow from initial requirements to a robust and scalable system.