Layer 3 · Go deeper · 9 min
Go deeper
Size it, build it, then make the calls an interviewer will push you on.
Back of the envelope
Size it up
Tap through each step of the arithmetic.
How fast must a scrubber read to cover 16 TB every three weeks?
What does checking a 25 Gbit/s stream cost in CPU cores?
Build-up · 6 steps
Follow one upload’s checksum end to end
From the uploader’s SDK to three replicas and a scrubber: compute early, verify everywhere, and never hand back bad bytes.
Step 1 of 6
Compute at the source
The client SDK computes CRC-32C before the bytes leave. A checksum computed after a bug has damaged the buffer just certifies garbage.
4 interview moments
You’re the candidate
The interviewer pushes on the hard parts. Pick an approach and see how it holds up.
Deep dive 1 of 4
Interviewer
“Phones upload files over HTTPS through your load balancer to an API that writes them to disk. Do you add your own checksum?”
Your move. Pick an approach:
Deep dive 2 of 4
Interviewer
“A Dropbox-style store keeps each chunk once, keyed by its checksum. Which checksum do you key chunks by?”
A marksheet PDF uploaded by a thousand students to a DigiLocker-style service should be stored once.
Your move. Pick an approach:
Deep dive 3 of 4
Interviewer
“Your API sends webhooks to partners over the internet. How does a partner know a payload is genuine and unaltered?”
Your move. Pick an approach:
Deep dive 4 of 4
Interviewer
“A 50 GB file arrives in S3 as 500 parts of 100 MB. How do you verify the whole object?”
Your move. Pick an approach:
Build-up · 6 steps
Compute TCP’s checksum by hand
Three 16-bit words, the RFC 1071 recipe used by IPv4, TCP and UDP, and the blind spot that comes with adding.
Step 1 of 6
Split into 16-bit words
Split the bytes into 16-bit words, padding an odd final byte with zero. IPv4 headers, TCP and UDP all use this check, chosen for speed, not strength.