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
Think of an LLM as a super-powered autocomplete, like your phone keyboard suggesting the next word, but trained on far more text. Technically, a large language model is a neural network, usually a transformer, trained on huge amounts of text to predict the next token. It writes an answer one token at a time, adding each new token to the input. In my college project I used an LLM API to summarise product reviews. I kept the temperature low for consistent summaries and checked the outputs, because LLMs can hallucinate.
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.
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.”
“Temperature is like a spice level for word choice. Technically, it scales the probability distribution over the next token before one is sampled. Low values make the model stick to the most likely tokens, so answers are focused and repeatable. High values make output more varied. I would use a low value like 0.2 for extracting invoice fields and a higher one for brainstorming product names.”
“Hallucination is when the model confidently gives an answer that sounds right but is false, like a student guessing in an exam. It happens because the model predicts likely text, not verified facts. To reduce it, I give the model trusted documents to answer from, tell it to say it does not know when unsure, keep temperature low for factual tasks, and add checks for important outputs.”
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
What does an LLM actually do when it writes an answer?Searches the internet for every answerCopies a stored answer from its training dataPredicts the next token, again and again
In English text, one token is roughly…About 4 characters, or three-quarters of a wordExactly one sentenceAlways exactly one word
You need consistent output for extracting invoice fields. Which temperature fits best?1.50.11.0
In a very long chat, the bot forgets the user’s name from the first message. Why?The model got tiredThe temperature was too highEarly messages fell outside the context window
Best way to reduce hallucinations in a company FAQ bot?Give it trusted company documents to answer fromRaise the temperatureMake the prompt as short as possible
🏅
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
1Token ≈ 4 chars of English
2Context window = what it sees
3Low temp = focused output
★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.
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.
One Comment