Learn. Practice. Feel prepared.
GenAI & LLM Engineering Objective Questions and Answers
This GenAI & LLM engineering quiz contains carefully curated objective questions with correct answers and clear explanations. It is designed for developers and ML engineers to test your skills in building, optimizing, evaluating, and deploying LLM-powered applications.
Practice GenAI & LLM Engineering MCQs with Detailed Explanations
Answer at least 12 questions to submit and verify answers.
1 Which technique is most suitable to reduce hallucinations in LLM-based applications that answer from private documents? Medium
Correct answer:
Retrieval-Augmented Generation (RAG)
RAG grounds the model's responses on retrieved private documents, significantly reducing hallucinations by providing factual context.
2 What is the primary role of embeddings in GenAI systems? Easy
Correct answer:
Represent text as dense vectors for semantic search
Embeddings convert text into dense vectors that capture semantic meaning, enabling similarity search and retrieval.
3 Which factor most directly impacts LLM inference latency in production? Medium
Correct answer:
Model parameter count
Larger parameter counts increase computation per token, directly affecting inference latency.
4 What is a key benefit of using quantization for LLM deployment? Medium
Correct answer:
Reduces memory footprint and speeds up inference
Quantization reduces model precision, lowering memory usage and improving inference speed with minimal accuracy loss.
5 Which decoding strategy is most likely to increase output diversity but also hallucinations? Medium
Correct answer:
High temperature sampling
Higher temperature increases randomness in token selection, leading to more diverse but less reliable outputs.
6 In a RAG pipeline, what is the main purpose of chunking documents? Medium
Correct answer:
Improve embedding granularity for better retrieval
Chunking improves retrieval precision by embedding smaller, semantically coherent pieces of text.
7 Which metric is most appropriate for evaluating retrieval quality in a vector search system? Hard
Correct answer:
Recall@k
Recall@k measures how often relevant documents appear in the top-k retrieved results, which is key for retrieval systems.
8 What is the main advantage of parameter-efficient fine-tuning (PEFT) methods like LoRA? Medium
Correct answer:
Lower compute and memory cost
PEFT methods adapt small subsets of parameters, reducing compute and memory requirements compared to full fine-tuning.
9 Which approach best mitigates prompt injection attacks in production systems? Hard
Correct answer:
Input sanitization and instruction hierarchy
Combining input validation with system instruction hierarchies helps prevent malicious user prompts from overriding core behavior.
10 What is the main purpose of a system prompt in LLM applications? Easy
Correct answer:
Control model behavior and role
System prompts define the assistant’s role, tone, and constraints, guiding overall behavior.
11 Which architecture component enables LLMs to capture long-range dependencies? Medium
Correct answer:
Self-attention mechanism
Self-attention allows the model to relate tokens across long sequences, capturing long-range dependencies.
12 What is the primary drawback of increasing context window size? Medium
Correct answer:
Higher compute and memory cost
Larger context windows significantly increase compute and memory requirements during inference.
13 Which technique helps prevent data leakage from training data in deployed LLMs? Hard
Correct answer:
Differential privacy during training
Differential privacy limits memorization of sensitive data, reducing the risk of data leakage.
14 What is the key role of rerankers in a RAG pipeline? Medium
Correct answer:
Reorder retrieved documents by relevance
Rerankers improve retrieval precision by reordering candidate documents based on relevance to the query.
15 Which failure mode occurs when the LLM answers confidently with incorrect facts? Easy
Correct answer:
Hallucination
Hallucination refers to confident generation of incorrect or fabricated information.