Quick reference for estimation math, latency numbers, powers of two, CAP/PACELC, consistency models, and availability nines.
EstimationLatencyCAPNines
Estimation Numbers
Powers of Two
| Power | Approx | Bytes |
| 2^10 | 1 thousand | 1 KB |
| 2^20 | 1 million | 1 MB |
| 2^30 | 1 billion | 1 GB |
| 2^40 | 1 trillion | 1 TB |
| 2^50 | 1 quadrillion | 1 PB |
Time Constants
seconds/day ~= 86,400 (~10^5)
seconds/month ~= 2.5 million
QPS = daily_requests / 86,400
peak = average x 2 to 3 (higher for spikes)
Char / Object Sizes
ASCII char = 1 byte UTF-8 char = 1-4 bytes
UUID = 16 bytes timestamp = 8 bytes
short tweet ~= 300 bytes thumbnail ~= 20 KB
photo ~= 200 KB-2 MB 1 min 1080p video ~= 50 MB
Latency Numbers
| Operation | Latency |
| L1 cache | ~1 ns |
| L2 cache | ~4 ns |
| RAM reference | ~100 ns |
| Read 1 MB from RAM | ~3 µs |
| SSD random read | ~16 µs |
| Read 1 MB from SSD | ~50 µs |
| Datacenter round trip | ~0.5 ms |
| HDD seek | ~5 ms |
| Cross-continent RTT | ~150 ms |
Rule of thumb: RAM >> SSD >> network >> disk. Batch network calls; cache in memory; never seek disk on the hot path.
CAP & PACELC
CAP: pick 2 of 3 (P is mandatory in practice)
CP -> consistent, may reject during partition (etcd, HBase)
AP -> available, may serve stale (Cassandra, DynamoDB)
PACELC: if Partition -> A or C; Else -> Latency or C
Cassandra/Dynamo = PA/EL
MongoDB = PA/EC
Spanner/etcd = PC/EC
Consistency Models
| Model | Guarantee |
| Strong | Read always sees latest write |
| Causal | Causally ordered ops preserved |
| Read-your-writes | You always see your own updates |
| Eventual | Replicas converge if writes stop |
Availability Nines
| Uptime | Down / year | Down / month |
| 99% | 3.65 days | 7.2 hrs |
| 99.9% | 8.76 hrs | 43 min |
| 99.99% | 52.6 min | 4.3 min |
| 99.999% | 5.26 min | 26 sec |
Series (dependency chain): multiply availabilities
0.999 x 0.999 x 0.999 = 99.7%
Parallel (redundant): multiply failure rates
1 - (0.01 x 0.01) = 99.99%
SLA / SLO / SLI & Framework
| Term | Meaning |
| SLI | Measured metric (latency, success rate) |
| SLO | Internal target for an SLI |
| SLA | Contractual promise + penalty |
| Error budget | 100% - SLO; spend on releases |
RESHADED (interview flow)
R Requirements (functional + non-functional)
E Estimation (QPS, storage, bandwidth)
S Storage schema (data model, access patterns)
H High-level (components + request flow)
A API design (endpoints / contracts)
D Detailed (sharding, caching, queues)
E Evaluation (check vs requirements)
D Distinctive (SPOFs, hotspots, bottlenecks)