LearnThatStack Ace your next interview
AI Engineering
LLM Fundamentals.
Change topic Change
Practice · Questions

All questions

Showing of 55
Beginner 12
01

What is a large language model, and how does it actually generate text?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A large language model (LLM) is a neural network trained to predict the next token in a sequence. A token is a small piece of text. During generation, the model reads the prompt, assigns a probability to each possible next token, chooses one, and repeats the process.

The model does not look up a complete answer stored in a database. Its training has encoded patterns about language, facts, code, and common reasoning into its weights. This lets it produce useful text, but it can also produce a fluent answer that is wrong. Chat models receive extra training after basic text prediction so they can follow instructions, use tools, and respond like assistants.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

02

What is a token, and why do models work with tokens instead of whole words or characters?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A token is a unit of text that a language model reads or writes. It may be a whole word, part of a word, punctuation, or whitespace. A tokenizer converts text into token IDs before the model processes it.

Tokens balance vocabulary size and sequence length. Character-based input would create very long sequences. Whole-word input would need a huge vocabulary and handle new words, typos, code, and many languages poorly. Subword tokens can represent any text while keeping sequences manageable.

Tokenization matters because context limits, cost, latency, and rate limits are usually measured in tokens. The exact count depends on the model's tokenizer, so estimates based only on characters can be inaccurate.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

03

Why do token counts matter so much in practice?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Token counts affect whether an LLM feature is affordable, fast, and reliable. Providers usually charge separately for input and output tokens. More input increases prompt-processing work, while more output increases generation time and often costs more per token.

Tokens also determine whether a request fits inside the model's context window. The prompt, conversation history, retrieved documents, tool descriptions, and expected response must all fit. Large requests can fail or lose important content through truncation.

Measure tokens on realistic traffic instead of using one average. Track input, output, cached, and reasoning tokens when the provider exposes them. Common savings include removing repeated instructions, retrieving fewer documents, limiting output length, and routing simple tasks to smaller models.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

04

What is a context window?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A context window is the maximum amount of information a model can process in one request. It normally includes system instructions, messages, tool definitions, documents, images represented as tokens, and the generated response.

The context window is not permanent memory. Most APIs require the application to resend any history that the model should consider. As a conversation grows, the application may need to drop old turns, summarize them, or retrieve only relevant facts.

Do not fill the entire window with input. Leave room for the answer and for any tool results added later. A large advertised window does not guarantee equal attention to every token. Test whether the model can find and use important details across realistic long prompts.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

05

What does the temperature parameter control?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Temperature changes how strongly the model favors its most likely next tokens. A low value makes common choices more dominant, which usually produces more consistent output. A higher value gives less likely choices more chance, which can add variety but also increase mistakes or drift.

Use lower temperature for extraction, classification, and strict formatting. Moderate values can help with brainstorming or creative drafts. Temperature does not control truthfulness: the model's most likely answer can still be wrong.

Some models, especially reasoning models, do not expose temperature or support only a default value. Treat sampling settings as model-specific. Change one setting at a time and compare results on an evaluation set rather than choosing a value by intuition alone.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

06

What is the difference between pretraining and post-training?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

Pretraining teaches a model broad language patterns by asking it to predict missing or next tokens across a very large dataset. This stage builds most of the model's general knowledge and basic abilities. The result is often called a base model.

Post-training teaches that base model how to behave for particular uses. It can include examples of good instruction following, human or AI preference feedback, safety training, tool use, and reinforcement learning on tasks with verifiable answers.

The distinction matters because a knowledgeable base model may only continue text instead of answering a request. Post-training makes it more helpful and easier to control, but it can also introduce biases such as excessive agreement or refusal. Both stages shape the final behavior.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

07

What is a hallucination, and why do LLMs hallucinate?

Beginner ·

Answer it yourself first - out loud, or typed below.

How should your speech become text?

Listening… your words appear above as you speak - tap Stop when you're done.

Recording · cr - tap Stop & transcribe when you're done.

Transcribing with AI…

Voice:

Keep going - a few more words and AI can grade it.

Last attempt -

Your answer

Re-explain

A hallucination is a claim produced by a model that sounds plausible but is unsupported or false. Examples include an invented citation, a nonexistent API, or a wrong date stated with confidence.

LLMs learn to generate likely text, not to verify every statement. Their training data can be incomplete, outdated, or conflicting. Knowledge stored in model weights is also an imperfect compression of that data. When a prompt requires missing information, the model may continue with a pattern that resembles a good answer.

Applications should assume hallucinations can occur. Useful controls include retrieval from trusted sources, calculation tools, and clear permission to admit uncertainty. Tie citations to source text and evaluate whether claims have factual support.

Rewriting in plainer words…

This answer doesn't lend itself to a diagram - it reads best . No credits were charged.

Why there's no diagram: “”

The interactive diagram is below the answer - jump to diagram ↓ · Below it, the related concept . Jump to it ↓

Related concept

Tailored explanation · switch back to · ·
What should the new diagram focus on?
How well did you know this?
AI:

08

What is a knowledge cutoff, and how should it influence how you build with a model?

Part of Pro
09

What does it mean for a model to be multimodal?

Part of Pro
10

What are embeddings, in simple terms?

Part of Pro
11

What does the major model landscape look like in 2026?

Part of Pro
12

What is the difference between open-weight and proprietary API models, and when would you choose each?

Part of Pro
Intermediate 21
13

Describe the transformer architecture at the level an application engineer should understand.

Part of Pro
14

Explain self-attention conceptually. What problem does it solve?

Part of Pro
15

How does byte-pair encoding (BPE) tokenization work?

Part of Pro
16

Why does the same content cost different amounts in different languages, and why should engineers care?

Part of Pro
17

How do you count tokens accurately before sending a request, and why not just estimate?

Part of Pro
18

How do temperature and top-p interact, and how should you set them in practice?

Part of Pro
19

What is top-k sampling, and how does it compare with top-p?

Part of Pro
20

What are stop sequences, and when would you use them?

Part of Pro
21

What happens to model quality as the context window fills up?

Part of Pro
22

Compare context window sizes across the major 2026 models. What caveats apply?

Part of Pro
23

What is prompt caching, and how do you structure prompts to exploit it?

Part of Pro
24

Explain RLHF at a high level. Why is it needed?

Part of Pro
25

What is the difference between a base model and an instruct or chat model, and when does it matter?

Part of Pro
26

What are reasoning models, and when do they actually help?

Part of Pro
27

What is test-time compute, and why did it become a major scaling axis?

Part of Pro
28

What practical techniques reduce hallucinations in an LLM application?

Part of Pro
29

How do embeddings power semantic search and RAG?

Part of Pro
30

How do you choose an embedding model in 2026?

Part of Pro
31

What are scaling laws, and how do they inform model size, data, and compute decisions?

Part of Pro
32

What is the difference between encoder-only, decoder-only, and encoder-decoder transformer models, and where is each used?

Part of Pro
33

What is LoRA, and how does parameter-efficient fine-tuning compare with full fine-tuning?

Part of Pro
Expert 22
34

Why is attention quadratic in sequence length, and what does that imply for long-context work?

Part of Pro
35

What is the KV cache, and why does it dominate LLM inference economics?

Part of Pro
36

What is a Mixture-of-Experts architecture, and why has it become standard for large models?

Part of Pro
37

What are the tradeoffs when quantizing a self-hosted model?

Part of Pro
38

Is temperature 0 deterministic? Explain why or why not.

Part of Pro
39

Give a taxonomy of hallucination causes and match mitigations to each.

Part of Pro
40

How would you design model routing or cascading to balance cost and quality?

Part of Pro
41

When does a small model beat a frontier model?

Part of Pro
42

How do you control how much a reasoning model thinks, and why does it matter?

Part of Pro
43

Compare DPO with PPO-based RLHF for preference tuning.

Part of Pro
44

What are RLAIF and Constitutional AI?

Part of Pro
45

How do multimodal models process images, and what does that cost in tokens?

Part of Pro
46

Advertised context windows keep growing. How do you evaluate what a model can actually use?

Part of Pro
47

What techniques reduce LLM inference latency, and which matter most?

Part of Pro
48

How would you measure and monitor hallucinations in a production LLM system?

Part of Pro
49

Walk through the economics of a high-volume LLM feature and the levers for optimizing cost.

Part of Pro
50

Discuss sampling beyond temperature and top-p: failure modes and current practice.

Part of Pro
51

What are the known failure modes of RLHF-style post-training?

Part of Pro
52

When do you choose RAG, long context, or fine-tuning, and how do they combine?

Part of Pro
53

How much should you trust a reasoning model's visible chain of thought?

Part of Pro
54

Can token log probabilities be used to estimate model confidence, and what are the limits?

Part of Pro
55

How do transformers represent token order, and what are rotary position embeddings (RoPE)?

Part of Pro

No matches

Try a different filter or search term.

Know someone prepping for LLM Fundamentals? Send them this set.
Pro · $10/mo

48 of 55 LLM Fundamentals answers are in Pro.

Full answers, code samples, and AI explanations that go simpler or deeper. Cancel anytime.

  • Full answers + code
  • AI explanations, simpler or deeper
  • 1,000 AI credits / month
  • Cancel anytime

Change topic

Pick a different technology or stack. Your current topic stays put until you choose a new one.

Technologies
No technologies match “”.
Cross-cutting topics
No topics match “”.
By role
Stacks & frameworks

MEAN

MongoDB, Express, Angular, Node.js

MERN

MongoDB, Express, React, Node.js

LAMP

Linux, Apache, MySQL, PHP

Django

Python Full-Stack Development

Ruby on Rails

Convention over Configuration

Serverless on AWS

Serverless Architecture on AWS

Flutter Mobile

Flutter Cross-Platform Mobile Development

Spring Boot

Enterprise Java Development

.NET

Microsoft Ecosystem

Vue

Vue.js, Vite, TypeScript, Tailwind, Node.js

Go Backend

Golang, gRPC, PostgreSQL, Redis, RabbitMQ

FastAPI

Python, FastAPI, SQLAlchemy, PostgreSQL

React Native

React, TypeScript, Redux, Firebase

iOS Native

Swift, SwiftUI, UIKit, Firebase

Android Native

Java, Jetpack Compose, Firebase

DevOps / Platform

Docker, Kubernetes, Terraform, CI/CD

AI Engineer

LLMs, RAG, Agents, Evals

AI-Powered Developer

Claude Code, Copilot, Agentic Workflows

Core SWE Interview Prep

Data structures, algorithms, OS, concurrency, networking, git