# Campus recruitment large model written test: fundamentals secure the lower bound, engineering estimation determines the upper bound

Date: 2026-02-17
Category: Technology
Tags: Campus Recruitment, Large Models, Written Tests
Summary: Break down the four types of questions in large-model written exams and a four-week preparation rhythm, focusing on how to practice engineering estimations like VRAM and KV cache, and why they best differentiate candidates.

Last month I helped two junior labmates review their written test post-mortems. One had the attention formula memorized cold and could derive it by hand without issue, yet got stuck on "estimate the inference memory of a 7B model"; the other passed almost all the coding questions but wrote "just add more GPUs" for the short-answer question. Their weak spots looked different, but they point to the same thing: too few people can actually move a formula onto a machine.

My read is that LLM written tests don't check who understands the papers better; they check who has actually run models and actually done the cost accounting for them. Basic questions set the floor; engineering questions set the ceiling.

## What the test roughly looks like

The campus-recruiting LLM written tests I've seen basically have four sections: ML and DL fundamentals (multiple choice, fill-in-the-blank, short answer), hand-written code (implement operators with numpy or torch), engineering estimation (memory, FLOPs, parallelism, inference latency), plus a small number of open questions (long context, RAG, alignment). Weighting differs by company; the common thread is that pure-derivation questions stay fairly mainstream, while engineering questions always lean toward "have you actually run a model."

High-frequency fundamentals include: QKV dimensions and computational complexity in attention, softmax numerical stability, the difference between LayerNorm and BatchNorm, residuals and gradients, cross entropy and KL, the Adam update rule, the intuition behind positional encoding. You can't just memorize conclusions; you need to be able to walk through them with a small matrix on paper. For example, why attention divides by sqrt(d_k): I'd start from the variance of the dot product growing with dimension, softmax saturating easily, and then land on gradients getting small.

The coding section often asks you to hand-write multi-head attention, layernorm, softmax, cross entropy, top-k/top-p sampling, beam search, and decode with KV cache. Some companies pose LeetCode-style problems but wrap them in a tensor operation, e.g. "given a [B, L, H] tensor, do a masked softmax along the last dimension."

Engineering estimation usually covers three types: given model size, ask how much the weights, gradients, optimizer states, and activations each take; given batch and sequence length, ask how big the KV cache is; ask what TP/PP/DP each shard. These are the easiest to fudge as short answers, and also the easiest place to separate candidates.

## Basic questions: one hand derivation beats ten memorizations

Concretely: take an A4 sheet and draw a transformer block from input to output, labeling the shape of every tensor, without looking at anything. Then check against the reference. I did this about three times; it was more useful than watching videos.

A few things you must be able to write on the spot: numerically stable softmax and cross entropy. Many people know to subtract the max, but get stuck when asked "why doesn't subtracting it change the result, and when does it overflow."

```python
def log_softmax(x, axis=-1):
    x_max = x.max(axis=axis, keepdims=True)
    shifted = x - x_max
    return shifted - np.log(np.exp(shifted).sum(axis=axis, keepdims=True))

def cross_entropy(logits, labels):
    log_probs = log_softmax(logits, axis=-1)
    return -log_probs[np.arange(len(labels)), labels].mean()
```

For cross entropy, don't softmax first and then take the log; compute directly from the logits, otherwise intermediate results overflow when the logits are large.

A few more points where the examiner can change the phrasing and tell whether you've actually written code or just looked at diagrams: at which step the attention scaling is applied, whether the mask goes before or after softmax, where the eps goes in LayerNorm, and where the residual connection sits (the difference in training stability between pre-LN and post-LN). These are small details, but failing them stands out.

Don't skip the probability questions either: Bayes, expectation and variance, the relationship between maximum likelihood and cross entropy, and what temperature and top-p each change in sampling. In a mock test I once got "when does top-p sampling degenerate to greedy," answered poorly, and only later figured it out: when p is small enough, the candidate set contains only the single highest-probability token.

## Engineering questions: work out the byte counts

This is the part I think campus candidates most need to shore up and most easily overlook. In school projects, you run an existing script and you're done; few people have ever calculated how large a batch fits on one card.

Start with the weights. A 7B model in fp16 inference has about 14GB of weights. You should be able to say this without thinking, because every later estimate starts from it. Training also adds gradients (14GB at the same precision), plus Adam's fp32 first and second moments and master weights; weights, gradients, and optimizer states together exceed 100GB, which is why ZeRO and various sharding schemes exist. Numbers differ across implementations, but you need to know the order of magnitude.

For KV cache I'd rather you remember the formula than specific numbers. Each token stores one K and one V per layer per KV head:

```text
2 * num_layers * num_kv_heads * head_dim * seq_len * batch * dtype_bytes
```

Take a 32-layer model with 32 KV heads, head_dim 128, fp16, batch=8, seq=4096: the KV for one token in one layer is 2*32*128*2 bytes ≈ 16KB, times 32 layers is 512KB, times 4096 and times 8 is roughly 16GB. This order of magnitude is exactly why long-context inference runs out of memory first, not compute. Why MQA/GQA save cache then needs no further explanation.

A few commonly tested engineering points: you don't need paper details, but you should be able to say "what it saves and what it costs." What memory does flash attention save (it doesn't materialize the full attention matrix); does PagedAttention solve fragmentation or redundant computation (fragmentation, with page-based management on the side); does continuous batching improve throughput or single-request latency (throughput, at the cost of latency jitter); which dimensions TP shards, and where communication happens.

My own practice method: take the config of a small open-source model (1B class), copy down hidden_size, num_layers, num_heads, hand-calculate the weights, KV cache, and FLOPs per token, then verify with code. Forward FLOPs per token are roughly 2x the parameter count, about 14 GFLOPs for a 7B model; training multiplies that by roughly another 2x for the backward pass. Getting it wrong once sticks better than reading ten articles.

## How to plan four weeks

The first two weeks: fundamentals and hand-written operators, one hand-written problem plus one concept derivation per day. Week three: focus on engineering estimation and past exams, sorting recent papers by question type. The last week: timed mock tests, focusing on how to write short answers: conclusion first, then the formula, then the boundary conditions.

You don't need a large volume of problems. Keep your hand in with medium-difficulty LeetCode; put the focus on tensor programming. It took me about five or six tries to write attention closed-book without shape errors. Keep an error log in three categories—"don't know," "calculated wrong," "too slow"—and don't just copy the answers; problems you were slow on are mostly due to unfamiliarity, so rewrite them two days later.

This plan has one premise: the target role leans toward application and inference deployment. If the test is clearly research-oriented, derivation questions carry much more weight, and that time has to move earlier.

Don't leave open-ended questions blank. When asked about long text, clearly explain the respective costs of extended positional encoding, sparse attention, and retrieval; when asked about RAG, first ask back, "Is this a knowledge update problem or a context-too-long problem?" As a new graduate, you don't need to give a perfect solution, but you need to show the interviewer that you can break down problems.

Tonight, find a piece of paper and calculate the weights, KV cache (batch=1, seq=2048), and approximate FLOPs per token for fp16 inference of a 7B model, until you can explain the source of every number. The next day, write stable softmax and cross entropy again with the book closed. Whichever one gets stuck, fill that gap first.
