MB
Common mistakes
- Mixing 1,000 and 1,024 between client and server checks, so a file passes one and fails the other.
- Confusing Mbps (megabits per second) with MB/s.
Key points
- Size limits in code are written as exact byte counts, like
5 * 1000 * 1000or5 * 1024 * 1024, matching the stated unit. - Client-side and server-side size checks use the same limit and the same divisor.
Interview questions
MB vs MiB: what is the difference?
An MB is 1,000,000 bytes. An MiB (mebibyte) is 1,048,576 bytes, which is 1,024 KiB.
How long does a 100 MB download take on a 100 Mbps connection?
About 8 seconds at full speed, because 100 MB is 800 megabits. Real downloads take longer due to overhead.
How many MB is a typical web page?
Commonly a few MB in total, with images and JavaScript taking the largest share.