LLM Interview Questions: Tokens, Prompts and Temperature Explained

LAB 13 The Interview Lab · AI & ML Engineer

LLM basics: tokens, prompts and temperature

Understand how large language models really work, in plain words, and answer the LLM questions that AI interviews now ask.

⏱ 10 min🎯 AI/ML freshers & developers🧪 4 hands-on drills
Your lab progress0 of 4 drills done
Spot itDecodeBuildTest

Most AI and ML interviews now include a few questions on large language models (LLMs), the technology behind tools like ChatGPT, Claude and Gemini. Interviewers want to see that you understand what happens inside: what a token is, why a chatbot forgets long chats, and why the same prompt can give different answers.

In this lab you will learn the core ideas in simple English: tokens, context window, temperature, hallucination and prompt patterns. You will also practise a 3-step way to explain any concept, so you sound clear and confident instead of memorised.

The big idea: simple, then correct, then used

Explain any AI concept in three frames. Interviewers love this order.

Step 1
FRAME 1
Simple
Start with an everyday analogy anyone can follow.
Step 2
FRAME 2
Correct
Give the exact technical meaning with the right terms.
Step 3
FRAME 3
Used
Show where you used it or how it affects a real product.
An LLM does not look up answers. It predicts the next token, one at a time.
Drill 1 · Spot it

Spot the difference

Same question: “What is an LLM?” Two answers. Switch between them and watch what changes.

An LLM is like ChatGPT. It is an AI that knows everything on the internet and can answer any question. It understands language just like humans and thinks before it answers. It is trained on a lot of data and many companies are using it now. It is very powerful and it is the future of AI.
✕ Says it “knows everything” and “thinks like humans”, which is wrong
✕ No tokens, no training, no prediction
✕ Buzzwords with no real example
Drill 2 · Decode

Quick concept check

Tap each card to flip it.

Key concepts, explained simply

Analogy first, then the correct technical idea. This is exactly how to answer in the interview.

Tokens and tokenisationLike cutting a sentence into LEGO pieces. A tokenizer splits text into tokens and gives each one a number (an ID). A long word may become two or three tokens. Hindi and many other languages often need more tokens per word than English.
Context windowLike the size of a whiteboard. It is the maximum number of tokens the model can work with in one request, usually counting both your input and its reply. Anything outside the window is invisible to the model.
Temperature and top-pLike a spice knob. Temperature reshapes the next-token odds: low makes the top choice even more likely, high spreads the chances out. Top-p picks only from the smallest group of tokens whose chances add up to p. Usually you tune one, not both.
HallucinationLike a student who confidently writes a wrong answer instead of leaving it blank. The model produces fluent text that is false or made up, because it predicts likely words, not checked facts. Reduce it with trusted source documents, clear instructions and human checks.
Prompt patternsZero-shot: just ask. Few-shot: show two or three examples first. System prompt: set the role and rules. Step-by-step: ask the model to reason in steps for tricky tasks. Output format: ask for a fixed structure like a table or JSON.
Training vs inferenceTraining is like years of school; inference is the exam. Pre-training teaches next-token prediction on huge text. Fine-tuning adapts the model to a task. Inference is when the trained model answers your prompt, and API usage is billed per token.
messages = [
  {"role": "system", "content": "You are an HR assistant. Reply in 3 short bullet points."},
  {"role": "user", "content": "Summarise this job description: ..."}
]
# low temperature = focused, repeatable output
response = client.chat(model=MODEL, messages=messages, temperature=0.2, max_tokens=150)
💡 The system message sets the rules, the user message is the task, a low temperature keeps output consistent and max_tokens caps the reply length. This is simple pseudo-code: function names change between providers, but every LLM API has these same ideas.
Drill 3 · Build

Build your concept explanation

Fill the blanks. Your answer writes itself on the right.

Your explanation
Start typing on the left and your answer will appear here.
⏱ ~0 seconds spoken0 words

Three model answers to real LLM questions

Each one follows Simple, Correct, Used. Adapt them to your own projects.

“A context window is like the whiteboard the model can see. It is the maximum number of tokens the model can process in one request, including my prompt, the chat history and its reply. If a conversation grows beyond it, older parts get cut, so the model forgets them. In my chatbot project, I kept a short running summary of earlier messages so key details stayed inside the window.”

Four mistakes that make AI answers sound shallow

Saying the LLM “understands” or “knows” like a humanSay it predicts the next token using patterns learned in training. That is more accurate and sounds more expert.
Thinking a token is the same as a wordA token can be a full word, part of a word or punctuation. Limits and API costs are counted in tokens, not words.
Saying low temperature makes answers correctLow temperature makes output more focused and repeatable, not more truthful. A model at low temperature can still hallucinate.
Only listing tool names“I used ChatGPT and LangChain” is not enough. Explain what you built, which settings you chose and why.
Drill 4 · Test

Test yourself

Question 1 of 5

0:00

Rehearse before the real thing

Pick one concept: token, context window or temperature. Press start and explain it out loud using Simple, Correct, Used. The ring turns amber at 60 seconds and red at 90.

Interview Lab · 13
LLM basics in 4 lines
  1. 1Token ≈ 4 chars of English
  2. 2Context window = what it sees
  3. 3Low temp = focused output
  4. ★Ground answers in real sources
worldremotejobs.com@keshav_consults

Screenshot it. Save it. Share it.

Keep this card on your phone and look at it five minutes before your interview.

Share on WhatsApp
Next in the lab
Lab 14 · Where do you see yourself in 5 years?
Open lab →

Quick answers

Do I need transformer maths for a fresher AI role?

Usually not in depth. Know the big ideas: tokens, embeddings, attention (each token can look at other tokens to understand context) and next-token prediction. Research roles will go deeper into the maths.

Does temperature 0 always give the same answer?

It makes output close to repeatable, but not always identical. Small differences in how the computation runs on servers can still change results, so do not promise exact repeatability.

What is the difference between a system prompt and a user prompt?

The system prompt sets the role, rules and tone for the whole chat. The user prompt is the actual question or task. Good apps keep important rules in the system prompt.

How is RAG related to hallucination?

RAG (retrieval-augmented generation) first finds relevant documents, then gives them to the model along with the question. This grounds the answer in real data. You will learn it fully in Lab 25.

More remote jobs

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *