InterviewStack.io LogoInterviewStack.io

Generative AI and Large Language Models Questions

The capabilities and behavior of modern generative and large language models. Covers how LLMs are pretrained, in-context learning and few-shot prompting, generative model families (autoregressive, diffusion), context windows, and tokenization and sampling. Emphasizes understanding what generative models can and cannot do and how they differ from discriminative ML.

MediumTechnical
128 practiced

Implement nucleus (top-p) sampling in Python. Input is a 1-D array of logits; return a sampled token index. Sort or accumulate probabilities efficiently and correctly handle edge cases where p is very small or very large. State the computational complexity.

EasyBehavioral
73 practiced

Tell me about a time you led the deployment of a machine-learned system that required human-in-the-loop feedback (e.g., RLHF or preference collection). Describe the Situation, your Task, the Actions you took (data collection, annotator instructions, tooling, and rollout), and the Results. What trade-offs did you make between speed, cost, and quality?

EasyTechnical
92 practiced

In RLHF, what is the purpose of applying a KL penalty relative to a reference policy? Explain how it guards against extreme policy shifts, preserves pre-trained behavior, and how you might tune the KL coefficient in practice.

HardTechnical
102 practiced

You must choose an approach for a production chatbot: (A) a supervised model fine-tuned on conversation logs, (B) retrieval plus a reranker, or (C) RL fine-tuning with human feedback (RLHF). Compare these on safety, response quality, data requirements, compute cost, and monitoring needs. Which would you choose for a first production release, and why?

HardTechnical
93 practiced

Given a fixed compute budget measured in GPU-hours, design a mixed training allocation across stages (continued pretraining, supervised fine-tuning, preference collection/annotation, reward-model training, RLHF). Define an objective (maximize human-preference gain per GPU-hour), propose an approximate model of marginal returns per stage, and describe how you'd validate and iterate on the allocation in practice.

Unlock Full Question Bank

Get access to all 38 Generative AI and Large Language Models interview questions and detailed answers.

Sign in to Continue

Join thousands of developers preparing for their dream job.