AI Infra Interviews logo
Practice tests · 30 questions

Napkin Math, Cost & Capacity: the practice test

Memory footprints, 6ND, arithmetic intensity and the ridge point, bandwidth-bound decode, communication volume, GPU counts and time to train, cost per million tokens, TCO and buy versus rent. The estimation round almost every AI infra loop includes, with every assumption stated. This test drills exactly that: 12 easy, 11 medium and 7 hard questions, every one explained, every explanation linking into the worked material.

Set up your test
Topic
How confident are you feeling?
Questions
12 in this pool · about 7 min
Reveal answers
Sign in to startFree account · your questions rotate between takes

Sample questions, answered

easy · sample
Weights of a 70B-parameter dense model in bf16: how many bytes, and does it fit on one 80 GB H100?
About 70 GB, so it fits on one H100 with room left for the KV cache and activations
About 280 GB, so it needs four H100s for the weights alone before any KV cache
About 140 GB, so it needs at least two H100s before any KV cache
About 35 GB, because bf16 halves the parameter count relative to fp16 storage

Weights = parameters × bytes per parameter = 70 × 10⁹ × 2 B = 140 GB. One H100 has 80 GB, so the weights alone need two cards, and the KV cache and activations need space on top. The 70 GB answer uses one byte per parameter, which is fp8, not bf16; the 280 GB answer uses fp32. Bytes per parameter is the first number in every memory chain, and 2 for bf16 is the one to know cold.

easy · sample
KV cache per token for a model with 80 layers, 8 KV heads, head dimension 128, stored in bf16: which number is right?
About 160 KB, from layers × KV heads × head dim × 2 bytes
About 320 KB, from 2 × layers × KV heads × head dim × bytes
About 2.6 MB, because all 64 attention heads store keys and values
About 40 KB, because only the current layer's keys are kept

KV per token = 2 (keys and values) × layers × KV heads × head dim × bytes = 2 × 80 × 8 × 128 × 2 B = 327,680 B, about 320 KB. Forgetting the factor of 2 for K and V gives 160 KB; using the 64 query heads instead of the 8 KV heads ignores grouped-query attention and gives 2.6 MB, which is what an MHA model would need. Every layer keeps its own K and V for every past token, so the per-layer answer is wrong too.

Go deeper than the quiz

A practice test measures recall. The material it draws from teaches the reasoning: