LLM Foundations
Explain tokens, context windows, sampling, and hallucinations.
Build an accurate model of how a large language model reads input and produces output. Covers tokens, context limits, sampling, and why fluent answers can still be wrong.
4 questions
Questions
Easy
1.5 h
Explain why a context window is not a word count, why a model does not remember earlier chats on its own, and why temperature zero does not make an answer true.
Medium
3 h
Work out why a model's answer looks cut off or incomplete by reading termination metadata, token budgets, and stream evidence before changing any setting.
3 h
Compare sending whole documents in a large context window with retrieving a few passages for two features of one product, using window fit, cost with prefix caching, latency, access, and a sliced pilot, and say what would change each choice.
Hard
4 h
Recommend a model or routing policy from measured quality, cost, and latency, say what evidence is still missing, and revise the decision when the traffic mix changes.
What you will be able to do
- Explain how a model generates text one token at a time
- Explain why token counts differ from word counts and between tokenizers
- Budget a request's context, including the output reserve
- Distinguish pretraining, inference, in-context learning, and fine-tuning
- Explain why low temperature does not make an answer correct, and how to verify one
- Build a token budget that includes message overhead and the output reserve
- Separate model termination (output limit, stop sequence, tool call) from transport and rendering failures
- Name the evidence that confirms each hypothesis before changing configuration
- Explain why changing temperature does not fix truncated output
Before you start
Suggested, not required.
No prerequisites: a good place to start.
Interview rounds that use this topic
Related on CodeSnatch
AI Engineering
Follows a request past the prompt into prefill and decoding, the reason long inputs delay the first token.
Community article
A practitioner's primer on counting tokens, resending chat history, and pricing a call in both directions.
System Design
Quick arithmetic habits for scaling a per-request cost to a day or a month and checking it against a budget.
AI Engineering
Uses a trace to separate missing evidence from a misread answer, the next step after learning why fluent output can be wrong.
Practice problem
Score success, coverage, and answered accuracy per slice, the measures used to compare models and designs here.
Practice problem
Compute p95 latency and time to first token from raw request records instead of trusting averages.
Behavioral Interview
Name the axes, options, and weighted criteria before choosing, as the model and context comparisons here require.
System Design
Shows how server-sent events deliver a response in pieces, the transport behind most streamed model answers.
System Design
A requirements, estimation, and trade-off structure for the design-style questions in this topic.
