02Derive the FLOPs per token for a dense transformer from its config. Where does the 2N rule stop being accurate?▼easyNewOpenAIAnthropicGoogle DeepMindunlockedTwo FLOPs per parameter is the number everyone quotes. The answer interviewers want rebuilds it from the config, finds the parameters that do no arithmetic, and names the context length where the rule breaks.Open full answer →
02Why does a paged KV cache waste at most one block per sequence, and how would you pick the block size?▼easyNewOpenAIAnthropicTogether AIunlockedThe bound is a one-line argument about where a sequence can be partly full. The block size is a three-way trade between that waste, kernel efficiency and how finely the prefix cache can match.Open full answer →
02What is goodput for an LLM server, and how can pushing throughput higher make it worse?▼easyNewAnthropicOpenAIFireworks AIunlockedDoubling the batch raised tokens per second by a third and sent goodput to zero. The answer shows why every sequence in a batch shares one step time, and how to find the batch size that maximizes the number users feel.Open full answer →
03Use Little's law on an LLM server: how many requests are in flight at 10 per second, and does the KV cache hold them?▼easyNewOpenAIAnthropicModalunlockedOne multiplication gives the number of sequences resident on the GPU, and from it the KV bytes and the batch the step runs at. The trap is that the duration in that multiplication depends on the answer.Open full answer →
02Write the causal mask for a decode step with a KV cache, where the query is shorter than the keys. Which corner does it align to?▼easyNewNVIDIAMetaTogether AIunlockedWith T new queries over S cached keys, the obvious lower-triangular mask is wrong and still runs without an error. The answer derives the right one from absolute positions and names the library default that gets it wrong.Open full answer →
02In a decode GEMV over a row-major weight matrix, which thread-to-element mapping coalesces, and why does the transposed one not?▼easyNewNVIDIAOpenAIMetaunlockedTwo GEMV kernels do the same arithmetic on the same matrix and differ only in which thread reads which element. One streams at HBM speed; the other turns every warp load into 32 separate transactions.Open full answer →
02FP8 comes in E4M3 and E5M2. Give the range and precision of each, and say which tensors use which in inference.▼easyNewNVIDIAAMDOpenAIunlockedBoth formats spend the same eight bits. The answer derives where each one's largest and smallest values come from, then explains why inference almost always picks the narrower of the two.Open full answer →
02What do temperature, top-k and top-p each do to the next-token distribution, and in what order does a serving engine apply them?▼easyNewOpenAIAnthropicGoogle DeepMindunlockedThree knobs, one distribution, and an ordering question that most candidates have never thought about. The answer works one six-token example through every knob and shows the order changing which tokens can be sampled.Open full answer →
03Implement speculative-decoding verification for temperature zero. How do you handle the bonus token and the rejected drafts' KV?▼easyNewOpenAIAnthropicNVIDIAunlockedAt temperature zero, verification is a prefix match, and the whole implementation fits in a dozen vectorized lines. Interviewers grade the three details around it: the bonus token, the KV slots to roll back, and why the output can still differ from plain greedy.Open full answer →
02In Megatron tensor parallelism, where do the column and row splits go in attention and the MLP, and why two all-reduces per layer?▼easyNewNVIDIAMetaOpenAIunlockedTwo matrix multiplies in a row, and the order of the splits decides whether you communicate once or twice per block. The answer places every split for a 70B layer and prices what the remaining all-reduces send per token.Open full answer →
02What do gpu_memory_utilization, max_model_len and max_num_seqs each control in vLLM, and how do they interact at startup?▼easyNewAnyscaleRed HatDatabricksunlockedThree flags, three different budgets, and one startup check that fails a 70B deployment on two H100s with a message most people misread. The answer walks the memory profile in the order vLLM runs it.Open full answer →
02Design the request path for an LLM API: gateway, router, engines, streaming. Where is each SLO measured, and what does each hop cost?▼easyNewOpenAIAnthropicTogether AIunlockedFour boxes are easy to draw. The answer that passes sizes them first, then says exactly which clock starts where, because a TTFT measured inside the engine and a TTFT measured by the client can disagree by a factor of five.Open full answer →
02TTFT is fine but inter-token latency is bad. Decompose the decode step and rank the causes.▼easyNewFireworks AITogether AIBasetenunlockedUsers see the first token quickly and then the stream stutters. The answer builds the decode step from bytes, shows which cause produces a bimodal latency histogram, and names the one metric that tells the top two apart.Open full answer →
02Implement grouped-query attention over a preallocated KV cache, with no torch.cat, for both prefill chunks and decode.▼easyNewOpenAIAnthropicMetaunlockedThe attention math is ten lines. The grade comes from where the new keys land, which query head reads which KV head, and the causal mask when a chunk of queries sits at the end of a longer cache.Open full answer →
03Implement batched top-p sampling with temperature. It must handle ties at the cutoff, p = 1, temperature 0 and masked tokens.▼easyNewOpenAIAnthropicCohereunlockedEveryone can sort and cumsum. The grader feeds you tied logits, p = 1 on a 128K vocabulary and a temperature of zero, and checks whether your kept set depends on the order of the sort.Open full answer →