Back of Envelope Calculations
September 24, 2024In system design interviews, back of envelope calculation is a task to estimate required comuputing resources based on the given requirement.
Commonly asked back-of-the-envelope estimations are QPS, peak QPS, storage, cache, and the number of servers. As far as I know, most of system design interview preparation books and websites introduce Numbers Everyone Should Know as a foundation of back of envelope calculations. Since back of envelope calulation is a rough estimation and the exact values depend on hardwares where the computation executes, the values varies among books and websites. Additionaly, it was difficult for me to remember all of the items at once, and I selected following items that looks important to remember:
Operation name | Time |
---|---|
Compress 1kb with snappy | 10µs |
Read 1MB sequentially from memory | 250µs |
Round trip within the same data center | 500µs |
Read 1MB sequentially from SSD | 1ms |
Round trip of a packet between California and the Netherlands | 150ms |
An easy one to remember is reading 1MB of data from an SSD — it’s 1ms. If I remember it and how many times longer or shorter the operation times of other items are compared to the SSD’s read time, I’ll be able to calculate the processing times of those other items.