Generative AI Interview Questions for Freshers
12 generative AI interview questions for freshers and students: tokens, context windows, embeddings, temperature, hallucination, RAG, system prompts and few-shot prompting. Each answer explains why the other options are wrong.
CoversEmbeddingsHallucinationLLM basicsPromptingRAGRetrievalSamplingTokens
Practice questions with answers
Tap an option: green is right, red is wrong, and the explanation says why.
In a large language model, what is a token?
Show answer and explanation
Answer: C. A chunk of text the model reads and predicts, such as a word, part of a word or a punctuation mark
Models don't read characters or words directly: a tokenizer splits text into pieces from a fixed vocabulary. Common words are often one token, rare words split into several (for example tokenization may become token + ization), and punctuation and spaces count too. That's why limits and prices are quoted in tokens, not words. It is not always one word or one character, and an API key is a credential, unrelated to tokens.
What does an LLM's context window limit?
Show answer and explanation
Answer: C. The total number of tokens the model can handle in one request, prompt and generated output together
The context window is the maximum number of tokens the model can attend to in a single call: system prompt, conversation history, retrieved documents and the answer it writes all share it. A model has no memory between calls; chat apps resend the history each time, and older turns are dropped or summarised once the window is full. It has nothing to do with training data size or the user interface.
What is a text embedding?
Show answer and explanation
Answer: C. A list of numbers (a vector) that represents the meaning of a text, so similar texts get nearby vectors
An embedding model maps text to a fixed-length vector, for example 768 or 1,536 numbers. Texts with similar meaning end up close together, which is what semantic search and RAG rely on: embed the question, then find the stored chunks with the nearest vectors. An embedding cannot be turned back into the exact original text the way a zip file can, and it is not a prompt template or a picture.
True or false: an LLM can state false information in a confident, fluent way, and this is usually called hallucination.
Show answer and explanation
Answer: True
True. An LLM generates the most plausible next tokens; it has no built-in fact check, so it can produce a fluent answer that is wrong, such as an invented citation or API. This is called hallucination. It is reduced, not eliminated, by grounding the model in retrieved sources, asking it to say when the sources don't contain the answer, and checking important claims. Fluency is not evidence of accuracy, which is why production systems evaluate answers.
Which setting makes an LLM's output more random and varied?
Show answer and explanation
Answer: C. A higher temperature
Temperature rescales the model's next-token probabilities before sampling. Above 1 it flattens them, so less likely tokens get picked more often and output becomes more varied; near 0 it sharpens them until the most likely token almost always wins. A lower temperature does the opposite. Max tokens only caps the length of the answer, and the length of the system prompt doesn't control randomness.
What is retrieval-augmented generation (RAG)?
Show answer and explanation
Answer: C. Retrieving relevant passages from your own documents and adding them to the prompt so the model answers from them
RAG adds a search step before generation: the question is used to find relevant chunks (usually by embedding similarity, often combined with keyword search), and those chunks go into the prompt as context. The model can then answer from current, private data and cite it, without retraining. Updating weights per question would be slow and expensive, and RAG is neither hardware nor a compression technique.
What is a system prompt mainly used for?
Show answer and explanation
Answer: D. Setting the role, rules and output format that apply to the whole conversation
A system prompt is the instruction block that sits before the conversation: who the assistant is, what it must and must not do, the tone and the format (for example, "answer in JSON with these fields"). It shapes every reply but doesn't change speed or the context window, and it counts toward the window like any other text. Secrets such as passwords never belong in a prompt, because prompts can leak through the model's output.
Which of these help reduce hallucinations in a question-answering bot? Select all that apply.
Show answer and explanation
Answer: B. Ground answers in retrieved source passages and ask the model to cite them + C. Tell the model to say it doesn't know when the sources don't contain the answer
Grounding is the main fix: when the answer is in the provided passages and the model must cite them, it has less reason to invent facts, and citations make mistakes easy to check. Giving the model an explicit way out ("if the context doesn't say, reply that you don't know") stops it from guessing to be helpful. A maximum temperature adds randomness and makes invention more likely, and removing the sources takes away the very grounding that helps.
What does few-shot prompting mean?
Show answer and explanation
Answer: B. Including a few worked input and output examples in the prompt so the model copies the pattern
In few-shot prompting you show the model a handful of examples of the task inside the prompt (input, then the exact output you want), followed by the new input. The model infers the format and style without any training. Fine-tuning changes the weights, which is a different and heavier step. Sampling several answers and voting is called self-consistency, and capping output length is just a max-tokens setting.
Cosine similarity between two embedding vectors measures what?
Show answer and explanation
Answer: D. How closely the vectors point in the same direction, regardless of their length
Cosine similarity is the dot product of two vectors divided by the product of their lengths, which equals the cosine of the angle between them: 1 means the same direction, 0 means unrelated (orthogonal), and negative values mean opposite. Because it ignores length, it compares meaning rather than magnitude. It isn't a token count, it is different from Euclidean distance (though the two rank results the same for normalised vectors), and it isn't a next-text probability.
Take it as a timed test
- 12 questions
- 15 min
- Pass mark 60%
- Answers shown at the end
Sign in with your email to take the test: we send a 6-digit code, no password. Your scores and reports are saved to your account. The test also uses 10 questions that aren't shown above, so practise for understanding, not memory.
About this paper
This freshers paper has 12 generative AI questions for students and new graduates applying to AI, data and software roles. It covers the words every interviewer expects you to use correctly: what a token is, what the context window limits, what an embedding represents, how temperature changes output, why models hallucinate and what retrieval-augmented generation adds. Ten questions are on this page with full explanations. Each timed test draws 12 questions from a larger bank, including ones that aren't shown here, so every attempt is different: practise for understanding rather than memory.
Answer each question before opening the explanation, and say your reasoning out loud the way you would in an interview. Then take the timed test: 15 minutes, a pass mark of 60%, and a report that shows which topics cost you marks.