Skip to content
tezvyn:

Top 30 Llms Interview Questions and Answers

30 multiple-choice questions on Llms, drawn from 30 bites out of the 63 tagged Llms on Tezvyn. Answer them here or read straight down. Every question carries the correct option, why it is correct, and a link to the bite it came from.

30 questions. Pick an answer, or open “Show the answer” to read it.

Answers are graded in your browser. Nothing is saved, and no XP or streak is earned here. The app keeps score.

  1. Question 1 of 30

    Which situation best illustrates why a loss function should not be the only measure of a model's real-world effectiveness?

    Show the answer

    Answer: a · The model achieves a low loss score, but its predictions are biased or provide no practical value to users.

    The card explicitly states that a low loss score doesn't guarantee real-world usefulness, as outputs can still be nonsensical, biased, or unhelpful. This highlights that loss functions are for optimization, not the final arbiter of a model's real-world usefulness. Option C describes a scenario where a loss function isn't typically used, rather than a limitation of relying on it as a sole metric when it is applied.

    Read the full bite: Loss Function: Quantifying 'How Wrong' a Model Is

  2. Question 2 of 30

    When training a large transformer, training loss falls while validation loss rises. Which action most directly addresses the root cause?

    Show the answer

    Answer: b · Apply early stopping or add regularization like weight decay

    The divergence signals overfitting, where the model memorizes training noise instead of generalizable patterns. Early stopping and regularization directly combat this, whereas longer training or more parameters typically worsens the gap, and a lower learning rate does not directly fix memorization.

    Read the full bite: Validation loss increases while training loss decreases: what is this?

  3. Question 3 of 30

    Why are positional encodings necessary before the first self-attention layer in a standard Transformer?

    Show the answer

    Answer: a · Because self-attention computes unordered pairwise dot products, leaving attention scores unchanged when tokens are permuted

    Self-attention is permutation-invariant: swapping tokens does not change their dot-product attention scores, so the model receives no sequence-order signal without positional encodings. Distractor A represents the common misconception that feed-forward layers can learn implicit order, but they process each position independently and cannot recover shuffled order.

    Read the full bite: Explain positional encodings in Transformers and their necessity

  4. Question 4 of 30

    For which scenario would an LSTM be preferred over a traditional RNN?

    Show the answer

    Answer: c · Tasks requiring memory of context from distant points in a long sequence.

    LSTMs are specifically designed to overcome the vanishing gradient problem in traditional RNNs, enabling them to maintain and utilize information from far back in a sequence. For short-term dependencies, a simpler RNN might be more efficient, and for large-scale parallel tasks, Transformers are often preferred.

    Read the full bite: LSTMs: Giving Neural Networks a Longer Memory

  5. Question 5 of 30

    Why does self-attention use three separate learned projections of the same input rather than the raw embeddings directly?

    Show the answer

    Answer: a · It allows the model to learn which token features to use for matching versus which to pass forward as content

    The correct answer reflects that learned projections decouple the matching process from content retrieval, letting the model decide which aspects of a token to use for scoring and which to propagate forward. The distractor describing a decoder query with encoder key and value defines cross-attention, not self-attention, where all three matrices are derived from the same input sequence.

    Read the full bite: Explain Q, K, and V matrices in self-attention

  6. Question 6 of 30

    How does self-attention primarily determine the relevance of other words to a given word in a sequence?

    Show the answer

    Answer: d · By comparing the current word's Query vector with every other word's Key vector.

    Self-attention calculates relevance by measuring the similarity between a word's Query vector and other words' Key vectors. This process allows it to directly identify and weigh the importance of all other words, unlike sequential processing or fixed context windows.

    Read the full bite: Self-Attention: The Transformer's Core Idea

  7. Question 7 of 30

    Which statement accurately captures the computational and memory complexity of exact self-attention as sequence length grows?

    Show the answer

    Answer: a · FLOPs grow as O(n^2) from the QK^T attention score matrix, while activation memory can be reduced to O(n) by recomputing rather than storing the full matrix.

    Exact self-attention must perform O(n^2) FLOPs to compute the attention score matrix, but activation memory is not fundamentally quadratic: by recomputing scores instead of materializing the full n×n matrix in HBM, memory can be reduced to O(n). Option C is tempting because standard implementations often do store the full matrix, leading many to assume that O(n^2) memory is unavoidable even without approximation.

    Read the full bite: Why is self-attention O(n^2) and what are the implications?

  8. Question 8 of 30

    Under Chinchilla's compute-optimal scaling laws, how should a fixed FLOP budget be divided between model parameters and training tokens?

    Show the answer

    Answer: b · Scale model parameters and training tokens equally, resulting in smaller models trained on much more data.

    Chinchilla showed that for a fixed compute budget, parameters and training tokens should be scaled equally, meaning smaller models must be trained on proportionally more data to be compute-optimal. Option D describes the pre-Chinchilla approach that produced undertrained models, while option C incorrectly suggests holding model size fixed rather than scaling both dimensions together.

    Read the full bite: How did Chinchilla change compute allocation between model size and data size?

  9. Question 9 of 30

    For which task would a Causal Language Model be the most suitable choice?

    Show the answer

    Answer: c · Extending a partial sentence into a complete, coherent paragraph

    Causal Language Models are designed for open-ended text generation, predicting the next word based only on preceding words, making them ideal for continuing or extending text. Tasks like sentiment analysis, information extraction, or summarization typically require understanding the entire input, which is a limitation for CLMs.

    Read the full bite: Causal Language Modeling: The Autocomplete Engine

  10. Question 10 of 30

    When adapting a foundation model for high-stakes scientific reasoning, which approach best balances capability gains with bias control according to the described best practices?

    Show the answer

    Answer: d · Apply domain-adaptive pretraining on curated scientific literature, followed by instruction tuning and reasoning-based distillation, validating each component with ablations

    The correct approach combines curated domain-adaptive pretraining, specialized instruction tuning, and reasoning distillation with ablation validation. The code-heavy distractor is wrong because although code strengthens general reasoning, scientific specialization requires curated literature and quality scoring, not raw unfiltered papers.

    Read the full bite: How does pre-training dataset composition influence capabilities and biases?

  11. Question 11 of 30

    What must a few-shot classification prompt include that a zero-shot prompt must not?

    Show the answer

    Answer: d · Two to four labeled demonstrations showing feedback mapped to categories

    Few-shot prompts rely on in-context learning through explicit input-output demonstrations, which zero-shot prompts omit by definition. Task instructions, output formats, and category labels are components present in both approaches, so selecting them confuses auxiliary structure with the defining presence of labeled examples.

    Read the full bite: How would you construct zero-shot and few-shot prompts for feedback classification?

  12. Question 12 of 30

    What is the core mechanism by which AdamW ensures L2 regularization is consistently applied, unlike the original Adam?

    Show the answer

    Answer: c · It applies the weight decay as a direct subtraction from the weights, independent of the gradient's adaptive scaling.

    The card states AdamW applies weight decay by directly subtracting a fraction of the weight's value in a separate step, decoupling it from the adaptive learning rate mechanism. Option A is incorrect because AdamW doesn't just reorder the application within the gradient calculation; it completely separates it and applies it directly to the weights.

    Read the full bite: AdamW: Decoupling Weight Decay for Better Generalization

  13. Question 13 of 30

    How does Chain-of-Thought prompting change the way a model solves a multi-step problem compared with standard prompting?

    Show the answer

    Answer: a · It makes the model output intermediate reasoning steps that become additional context for the final answer.

    CoT prompting works by inducing the model to generate intermediate reasoning steps as tokens, creating additional context that the model attends to when producing the final answer. Distractor A is wrong because it anthropomorphizes the model as performing deeper internal thinking, whereas the actual mechanism is simply conditioning the final prediction on an explicit externalized reasoning trace.

    Read the full bite: Explain Chain-of-Thought prompting, its reasoning mechanism, and ideal use cases

  14. Question 14 of 30

    Which approach to selecting and ordering demonstrations is most likely to improve text-to-SQL execution accuracy?

    Show the answer

    Answer: a · Retrieve candidates by SQL syntax similarity, balance pattern diversity across joins and aggregations, order simple to complex, and anchor with schema context.

    Effective text-to-SQL prompting requires retrieving examples by SQL syntax, ensuring diverse query patterns, scaffolding from simple to complex, and grounding each example in schema context. The most tempting distractor relies on natural language embedding similarity, which often retrieves semantically close but syntactically irrelevant demonstrations, and front-loading complex SQL overwhelms the model rather than scaffolding it.

    Read the full bite: How do you select in-context examples for text-to-SQL prompts?

  15. Question 15 of 30

    For which type of computational problem is data parallelism most appropriate?

    Show the answer

    Answer: b · Dividing a large dataset among multiple processors, each running the same program on its assigned portion.

    Data parallelism is designed for scenarios where a single, computationally intensive operation needs to be performed on a massive dataset, with each processor handling a different chunk. Option A describes task parallelism, while Option C highlights a situation where data parallelism would be inefficient due to communication overhead.

    Read the full bite: Data Parallelism: One Task, Many Data Chunks

  16. Question 16 of 30

    An engineer needs to improve an LLM's structured JSON extraction rate using only prompt changes. Which approach should they prioritize?

    Show the answer

    Answer: d · Include the exact JSON schema with empty values and add one to three valid input-output examples

    Embedding an exact JSON skeleton and providing few-shot exemplars are the two prompt-based techniques that constrain the output distribution by making the desired token sequence highly probable. Chain-of-thought reasoning is a tempting distractor because it often increases verbosity and introduces stray tokens that break JSON validity.

    Read the full bite: Describe two prompt-based techniques to ensure valid LLM JSON output

  17. Question 17 of 30

    Under a fixed FLOP budget, a team must choose between a 100B-parameter model on 200B tokens and a 50B-parameter model on 400B tokens. What should they expect?

    Show the answer

    Answer: b · The 50B model will likely match or outperform the 100B model while costing less to serve

    The card states that for a fixed FLOP budget, scaling parameters and tokens equally is optimal, so the smaller model on more data can match or beat the larger one while being cheaper to serve. Option D reflects the outdated assumption that parameters alone drive performance, while D incorrectly assumes overfitting rather than undertraining is the risk.

    Read the full bite: LLM Scaling Laws: Match Parameters to Tokens

  18. Question 18 of 30

    Which design best avoids redundant demonstrations while keeping retrieval latency acceptable at scale?

    Show the answer

    Answer: a · Fetch a larger candidate set using ANN, apply a diversity reranker, then assemble a token-bounded prompt asynchronously.

    Fetching a larger ANN candidate set and reranking for diversity prevents redundant examples while keeping latency low, and asynchronous assembly protects inference time. Option D is tempting but exact flat search is O(N) and too slow for online serving, and it lacks any diversity mechanism.

    Read the full bite: Design dynamic few-shot example retrieval from a vector database

  19. Question 19 of 30

    Which statement best describes how supervised fine-tuning updates a pre-trained language model?

    Show the answer

    Answer: b · It updates existing weights by predicting the next token only on curated assistant completions, masking the prompt.

    Supervised fine-tuning updates existing weights by continuing next-token prediction on curated prompt-completion data, computing loss only on assistant tokens while masking prompts. The most tempting distractor is wrong because SFT deliberately uses curated demonstrations and a small learning rate, not raw internet text like pre-training.

    Read the full bite: Describe supervised fine-tuning for a pre-trained language model

  20. Question 20 of 30

    What is the primary motivation for employing Tensor Parallelism in large language models?

    Show the answer

    Answer: c · To process a single, excessively large model layer by distributing its internal components across multiple GPUs.

    Tensor Parallelism is specifically designed to enable the execution of individual model layers that are too large to fit into a single GPU's memory by splitting the layer's components. Option A describes pipeline parallelism, which distributes entire layers, not parts of a single layer.

    Read the full bite: Tensor Parallelism: Split Layers, Not Just Models

  21. Question 21 of 30

    When adapting a large model to dozens of tasks on a tight compute budget, why is LoRA strongly preferred over full fine-tuning?

    Show the answer

    Answer: a · It trains only a small number of extra parameters per task, keeping one shared base model and sharply reducing compute, storage, and serving costs while matching performance.

    LoRA adds lightweight adapters per task around a single frozen base model, drastically cutting compute, storage, and inference costs while maintaining comparable performance. Distractor B is wrong because the card explicitly flags the belief that full fine-tuning always outperforms PEFT as a major red flag, and storing separate full checkpoints for many tasks is prohibitively expensive.

    Read the full bite: Full fine-tuning or LoRA on a tight compute budget?

  22. Question 22 of 30

    Why does LoRA reduce GPU memory usage during fine-tuning compared to full fine-tuning?

    Show the answer

    Answer: b · It freezes the original weight matrix W and trains only low-rank matrices A and B, so gradients and optimizer states are only stored for A and B.

    LoRA keeps the original weight matrix W frozen and only trains the small low-rank matrices A and B, which means gradients and optimizer states like those in Adam are only maintained for A and B, drastically reducing memory usage. The most tempting distractor claims the update is merged during training, but merging BA into W actually happens after training to preserve inference speed, not to save memory during fine-tuning.

    Read the full bite: How does LoRA work and why is it memory-efficient?

  23. Question 23 of 30

    In the RLHF pipeline, why is a separate reward model trained on human preference comparisons before the final RL stage?

    Show the answer

    Answer: d · To generalize discrete human comparisons into a continuous scalar score that drives automated policy optimization

    The reward model captures human preference numerically as a scalar so that automated RL optimization can occur. Option C is a common misconception: the reward model is not the final deployed policy; stage three produces the aligned language model that users interact with.

    Read the full bite: Walk through RLHF's three stages, outputs, and purposes.

  24. Question 24 of 30

    In which situation should you avoid few-shot prompting?

    Show the answer

    Answer: d · A clearly described one-sentence task is running near the model's token limit

    The card states that few-shot prompting should be avoided when a zero-shot instruction is sufficient and when the context window is nearly full, because examples then add cost and bias without benefit. Distractor D describes a valid use case, as adapting niche style without retraining is exactly where few-shot prompting excels.

    Read the full bite: Few-Shot Prompting

  25. Question 25 of 30

    When an LLM regresses on legacy tasks after domain-specific fine-tuning, which approach best balances new task mastery with preserving existing capabilities?

    Show the answer

    Answer: c · Adopt LoRA with a regularization term that penalizes deviation from base weights while evaluating on holdout legacy tasks

    LoRA restricts the update space, regularization prevents drift from base capabilities, and legacy evaluation detects regression early. Simply lowering the learning rate is a common misconception because gradients can still overwrite critical knowledge even at small step sizes.

    Read the full bite: What is catastrophic forgetting in LLMs and how do you mitigate it?

  26. Question 26 of 30

    What best describes the relationship between the retriever and generator in a basic RAG system?

    Show the answer

    Answer: b · The retriever searches an external index and passes results to the generator for synthesis

    The retriever fetches relevant passages from an indexed knowledge base and the generator synthesizes an answer using both the original query and that retrieved context. Option A is tempting but wrong because it confuses RAG with fine-tuning: external documents are never baked into the model weights.

    Read the full bite: Describe a basic RAG architecture and its two main components

  27. Question 27 of 30

    In which situation is Least-to-Most Prompting the most appropriate strategy?

    Show the answer

    Answer: c · When the problem's complexity far exceeds that of the few-shot examples, and it can be solved incrementally.

    The card explicitly states Least-to-Most Prompting is for when "the problem's complexity far exceeds that of your few-shot examples" and can be broken into "a clear sequence of smaller, dependent steps." Option B describes a feature also present in Chain-of-Thought, but not the unique advantage of Least-to-Most for harder problems.

    Read the full bite: Least-to-Most Prompting: Solving Hard Problems Incrementally

  28. Question 28 of 30

    Which approach best handles a user question requiring both a precise database aggregation and a qualitative summary from documents in a hybrid RAG system?

    Show the answer

    Answer: c · Use a query planner to route the aggregation to native SQL execution and the summary request to vector search, then synthesize both outputs

    Native SQL preserves exact numeric aggregations and filter semantics that vector search or text inference cannot reliably replicate, while synthesis combines both sources accurately. Option D is the most tempting distractor because it mirrors standard text-only RAG, but flattening tables into chunks destroys relational operations like joins and SUMs.

    Read the full bite: How would you modify retrieval architecture for hybrid text and SQL RAG?

  29. Question 29 of 30

    During LLM function calling, after the model decides a tool is needed, what does it actually do before the client takes over?

    Show the answer

    Answer: a · It emits a JSON object with the function name and arguments for the client to execute

    The model only generates structured text shaped like a JSON payload containing the function name and arguments; the host application must execute the actual function and return the result. The distractor suggesting the model runs code in a sandbox reflects the common misconception that the LLM has agency, whereas modern APIs keep all side effects strictly on the client side.

    Read the full bite: How does function calling work in modern LLMs?

  30. Question 30 of 30

    What is your code's responsibility after the LLM emits a get_weather request in a tool-use loop?

    Show the answer

    Answer: c · Parse the structured arguments, run get_weather yourself, and return the result to the model.

    Your application code must parse the structured request, execute get_weather itself, and feed the result back to the model. The most tempting distractor is that the LLM directly executes the API call, but modern LLMs only emit function-call requests and never handle networking or authentication themselves.

    Read the full bite: Walk me through building a weather agent with get_weather

Could you explain these out loud?

That is what an interview actually tests. Tezvyn gives you questions like these with what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon