The fundamentals

Tokenization interview questions

The tokenization questions that keep coming up in AI engineer interviews. The first 3 come with full answers.

Updated 2026-09-05

01

What does tokenization do to your text, and why is it necessary?

A model only does math over numbers — it can't read letters. Tokenization is the step that bridges that: it splits your text into small pieces (usually subwords) drawn from a fixed vocabulary, then swaps each piece for its integer ID. What actually enters the network is that row of IDs, one per token — the letters are already gone. Without it there's no numeric input for the model to compute on.
02

Why split into word-pieces rather than whole words or single letters — what does BPE buy you?

Two extremes both fail. A whole-word vocabulary would need every word, typo, name and slang term — unworkably large, and it still chokes on any word it never saw. Single letters keep the list tiny but make sequences painfully long and slow. BPE (Byte-Pair Encoding) is the middle: it starts from characters and repeatedly merges the most common neighbouring pairs into bigger chunks, so frequent bits like "ing" or "tion" become single tokens while a rare word is built from a few smaller known pieces. Small vocabulary, but it can still spell out anything — even a brand-new word.
03

Cost and length limits are counted in tokens — what surprising consequence does that have for a long word?

A long or unusual word doesn't cost "one word" — it can quietly split into three or four tokens, and both your bill and your context window are measured in tokens, not words. So a prompt that looks short by word count can be far larger in tokens (rough English rule: 100 tokens ≈ 75 words). Code, math, emoji, long URLs and non-English text tokenize into many more pieces than plain English, so they cost more and fill the window faster for the same apparent length.

Also asked in interviews

These 3 run inside the bootcamp as recall drills and voice mock interviews. You answer, the AI grades.

Knowing an answer and saying it under pressure are two different days. Inside Skillumen you answer these out loud and get graded on the spot. Foundations is free.

Try it free →

The open-source companion list, Awesome AI Engineer Interview Questions, curates 105 of these on GitHub.