Software Engineering Cheat Sheet: Time, Data Size & Complexity
Posted on Oct 28, 2026 in Computers
Software Engineering Reference Cheat Sheet
Time Conversion
| Unit | Days | Hours | Minutes | Seconds (s) | Milliseconds (ms) | Microseconds (μs) | Nanoseconds (ns) |
|---|
| 1 Day | 1 | 24 | 1,440 | 86,400 | 86,400,000 | 86,400,000,000 | 86,400,000,000,000 |
| 1 Hour | 1/24 | 1 | 60 | 3,600 | 3,600,000 | 3,600,000,000 | 3,600,000,000,000 |
| 1 Minute | 1/1,440 | 1/60 | 1 | 60 | 60,000 | 60,000,000 | 60,000,000,000 |
| 1 Second | 1/86,400 | 1/3,600 | 1/60 | 1 | 1,000 | 1,000,000 | 1,000,000,000 |
| 1 Millisecond | 1/86,400,000 | 1/3,600,000 | 1/60,000 | 0.001 | 1 | 1,000 | 1,000,000 |
| 1 Microsecond | 1/86,400,000,000 | 1/3,600,000,000 | 1/60,000,000 | 0.000001 | 0.001 | 1 | 1,000 |
| 1 Nanosecond | 1/86,400,000,000,000 | 1/3,600,000,000,000 | 1/60,000,000,000 | 0.000000001 | 0.000001 | 0.001 | 1 |
Data Size Conversion
| Unit | Bits (b) | Bytes (B) | Kilobytes (KB) | Megabytes (MB) | Gigabytes (GB) | Terabytes (TB) | Petabytes (PB) |
|---|
| 1 Bit | 1 | 1/8 | 1 / (8 × 1,024) | 1 / (8 × 1,0242) | 1 / (8 × 1,0243) | 1 / (8 × 1,0244) | 1 / (8 × 1,0245) |
| 1 Byte | 8 | 1 | 1/1,024 | 1/1,0242 | 1/1,0243 | 1/1,0244 | 1/1,0245 |
| 1 Kilobyte | 8,192 | 1,024 | 1 | 1/1,024 | 1/1,0242 | 1/1,0243 | 1/1,0244 |
| 1 Megabyte | 8,388,608 | 1,048,576 | 1,024 | 1 | 1/1,024 | 1/1,0242 | 1/1,0243 |
| 1 Gigabyte | 8,589,934,592 | 1,073,741,824 | 1,048,576 | 1,024 | 1 | 1/1,024 | 1/1,0242 |
| 1 Terabyte | 8.796… × 1012 | 1,099,511,627,776 | 1,073,741,824 | 1,048,576 | 1,024 | 1 | 1/1,024 |
| 1 Petabyte | 9.007… × 1015 | 1,125,899,906,842,624 | 1,073,741,824,000 | 1,073,741,824 | 1,048,576 | 1,024 | 1 |
System Latency Numbers Every Programmer Should Know
| Operation | Approximate Time | Human Scale Equivalent (if 1 CPU cycle = 1s) |
|---|
| L1 Cache reference | 0.5 – 1 ns | 1 second |
| Branch mispredict | 3 – 5 ns | 3 – 5 seconds |
| L2 Cache reference | 3 – 7 ns | 7 seconds |
| RAM / Main Memory reference | 50 – 100 ns | 1 – 2 minutes |
| SSD Random Read | 16 – 100 µs | 1.5 – 2.5 days |
| Read 1 MB sequentially from Memory | 250 µs | 3 days |
| Read 1 MB sequentially from SSD | 1,000 µs (1 ms) | 12 days |
| Network round trip within same Data Center | 500 µs | 6 days |
| Read 1 MB sequentially from Disk (HDD) | 20,000 µs (20 ms) | 8 months |
| Packet round trip (CA to NY) | 40 ms | 1.2 years |
Powers of 2 / Binary Memory Reference
| Power (2x) | Exact Value / Approx Value | Binary Representation | Common CS Meaning |
|---|
| 28 | 256 | 00000000 10000000 | 1 Byte max value (uint8) |
| 210 | 1,024 (1 KiB ≈ 103) | 00000100 00000000 | 1 KiB |
| 216 | 65,536 | 00000000 00000000 10000000 00000000 | Port numbers / uint16 max |
| 220 | 1,048,576 (1 MiB ≈ 106) | — | 1 MiB |
| 230 | 1,073,741,824 (1 GiB ≈ 109) | — | 1 GiB |
| 231−1 | 2,147,483,647 | 01111111 11111111 11111111 11111111 | Signed 32-bit int max (INT_MAX) |
| 232 | 4,294,967,296 (≈ 4.3 B) | — | IPv4 address space / 4 GB RAM limit |
| 240 | 1.099… × 1012 (1 TiB ≈ 1012) | — | 1 TiB |
| 264−1 | ≈ 1.84 × 1019 | — | Unsigned 64-bit int max (uint64) |
Common Big-O Time & Space Complexity
| Algorithm / Operation | Average Time | Worst Time | Space Complexity |
|---|
| Array Lookup / Append | O(1) | O(1) / O(n) | O(n) |
| Hash Table Search / Insert | O(1) | O(n) | O(n) |
| Binary Search Tree | O(log n) | O(n) | O(n) |
| Binary Search (Sorted Array) | O(log n) | O(log n) | O(1) |
| Quicksort | O(n log n) | O(n2) | O(log n) |
| Mergesort | O(n log n) | O(n log n) | O(n) |
| Matrix Multiplication | O(n3) | O(n3) | O(n2) |
Common Network & Throughput Bitrates
| Connection / Interface | Speed (Bits per sec) | Max Transfer Rate (Bytes per sec) |
|---|
| 1 Gbps Ethernet | 1 Gbps | 125 MB/s |
| PCIe 4.0 (x16) | 256 Gbps | 31.5 GB/s |
| USB 3.2 Gen 2 | 10 Gbps | 1.25 GB/s |
| USB4 / Thunderbolt 4 | 40 Gbps | 5 GB/s |
| DDR4 RAM (Single Channel) | ~200–300 Gbps | ~25–38 GB/s |