2 min read
TIL: Napkin Math for Engineers

Quick notes from the napkin math tutorial by Ben Dicken.

The entities that we are dealing with include

  • CPU (4 Ghz = 4 billion instructions/s)
  • CPU Cache
  • RAM (volatile memory)
  • Disk (permanent memory)
  • Networking
EntityLatency
cpu instruction1ns
l1 cpu cache1ns
l2 cpu cache3ns
l3 cpu cache10ns
RAM100ns
NVME SSD50 micro-s
HDD1-10ms
storage (same region)1ms
east-west US70ms
east-US to EU150ms
east-US to APAC200ms
east-US to APAC200ms

Keeping the above table in mind can help in interviews.

A complete resource for this is here - github repo.

There is no need to memorize every single number from the README of the repo. This primarily comes in handy when you are looking for sites of optimization and you start checking latency scores to find the gap.