Layer 3 · Go deeper · 8 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.
When do long exports exhaust a 200-thread pool?
How much memory do in-flight 400 MB exports hold?
How many worker vCPUs for 20 uploads a second?
Build-up · 6 steps
Move the photo work off the request path
One upload endpoint from busy to fixed. Each step moves a piece of work away from the pods that serve login, and says what it costs.
Step 1 of 6
Resize in the handler
The handler decodes a 12-megapixel photo and writes three sizes, 400 ms of CPU on the pods that serve login. Twenty a second need 138% of them.
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
“Login p99 triples during the 11 am menu-photo rush. Ops proposes doubling the web pods. What do you do?”
Your move. Pick an approach:
Deep dive 2 of 4
Interviewer
“A GST report takes 90 seconds to build. The team moves it into a function behind API Gateway. Done?”
Your move. Pick an approach:
Deep dive 3 of 4
Interviewer
“Sellers post 50 MB catalogues to a Node.js import endpoint, and p99 jumps on every route at once. What do you change?”
Your move. Pick an approach:
Deep dive 4 of 4
Interviewer
“Login hashes passwords with scrypt, slow on purpose. Should that move to a queue too?”
Your move. Pick an approach: