Generative AI Interview Questions and Answers

LLMs, prompting, embeddings, RAG, vector databases, agents, evaluation and safety questions for GenAI and AI application roles.

Basic Generative AI questions

  1. 1. What is a large language model?

    An LLM is a transformer neural network trained on large text datasets to predict the next token. Through scale and instruction tuning it can answer questions, write code, summarise and follow instructions.

  2. 2. What are tokens and the context window?

    Tokens are the pieces of text a model reads and writes, roughly three quarters of an English word each. The context window is the maximum number of tokens (prompt plus response) the model can handle in one request, which affects cost and how much data you can include.

  3. 3. What does temperature control?

    Temperature controls randomness when sampling the next token. Low values give focused, repeatable answers for extraction or code; higher values give more varied, creative output.

Intermediate Generative AI questions

  1. 4. What are embeddings?

    Embeddings are vectors that represent the meaning of text, so similar meanings are close together. They power semantic search, clustering, recommendations and the retrieval step of RAG, usually compared with cosine similarity.

  2. 5. Explain Retrieval-Augmented Generation (RAG).

    Documents are split into chunks, embedded and stored in a vector database. For each question, the most relevant chunks are retrieved and added to the prompt, so the model answers from your data with citations, reducing hallucination without retraining.

  3. 6. RAG vs fine-tuning?

    RAG adds fresh or private knowledge at query time and is easy to update. Fine-tuning changes model weights to teach a style, format or specialised behaviour. Many systems use RAG for knowledge and light fine-tuning for behaviour.

  4. 7. How do you reduce hallucinations?

    Ground answers with RAG, instruct the model to say when it does not know, ask for citations, use low temperature, validate structured output against a schema and evaluate answers against reference data.

Advanced Generative AI questions

  1. 8. What is an AI agent?

    An agent is an LLM that plans and takes actions by calling tools (APIs, search, databases, code) in a loop, observing results until a goal is met. Protocols like the Model Context Protocol (MCP) standardise how tools are exposed to agents.

  2. 9. How do you evaluate an LLM application?

    Build a test set of real questions with expected answers, measure retrieval quality (recall of the right chunks) and answer quality (faithfulness, relevance, correctness) with human review or LLM-as-judge, and track latency, cost and failures in production.

  3. 10. What is prompt injection and how do you defend against it?

    Prompt injection is malicious text in user input or retrieved content that tries to override instructions or leak data. Defend by separating system and user content, treating tool outputs as untrusted, restricting tool permissions, validating outputs and requiring confirmation for sensitive actions.

Want to practise these with a trainer? APEX live batches include mock interviews, real projects and placement support. See upcoming batches.

Prepare with an APEX course