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
81 practiced

Explain scaling laws for language models: how do model size, dataset size, and compute budget influence loss and generalization? What are the practical consequences for dataset preparation, model selection, and cost estimates when planning to train an LLM?

HardTechnical
94 practiced

You must decide between two third-party LLM options for a knowledge assistant: a faster, cheaper model with slightly lower factual accuracy, versus a slower, costlier model with better factuality. How would you evaluate and choose, and how might you combine both to meet product goals?

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.

MediumTechnical
87 practiced

What is a context window, and why is it bounded? At a conceptual level, what are the main strategies (chunking and summarization, sliding windows, retrieval) for working within or around a limited context window, and what does each trade off in terms of latency and factuality?

MediumTechnical
93 practiced

You have 500k multilingual sentences and need to design a tokenizer and vocabulary for training a new LLM. What are the vocabulary-size trade-offs, and how would you handle rare scripts, code-mixing, and balancing token coverage across languages?

Unlock Full Question Bank

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

Sign in to Continue

Join thousands of developers preparing for their dream job.