Here are 31 generative AI interview questions, with short answers in simple English. They cover how models create text and images, how to build products with them, and how to use them safely.
Save your progress and get the AI Engineering cheat sheet PDF
AI Engineering Cheat Sheet: what our labs measured, one rule per result. 12 pages. Free with an account.
How a text-to-image model makes a pictureRandom noise here means an image of random coloured dots, like TV static. The model starts from that and cleans it up step by step. At each step, the text decides what the noise should turn into.
How a text-to-image model makes a pictureRandom noise here means an image of random coloured dots, like TV static. The model starts from that and cleans it up step by step. At each step, the text decides what the noise should turn into.
How to answer a generative AI question
Give the idea in one or two plain sentences. Then add one practical point: a risk, a cost, or how you would test it. That shows you have thought about real products, not only definitions.
This page is the free part.
The course goes deeper on Generative AI
₹999 in India/$49 everywhere elseonce, for the whole course
The AI Engineering course covers Generative AI across a run of lessons, not one page. These 4 alone are about 258 minutes of step-by-step reading, every one with code you run in the browser, all with a quiz.
A model name is a spec sheet written in shorthand. Learn to decode publisher, family, version, parameter count, mixture-of-experts markers, post-training suffixes and numeric formats, and to predict from the name alone whether a model will fit on your GPU.
80 min · diagrams · code you run · quizfree to read now
Synthetic data, measured on 30,000 real card holders over 30 seeds. Boosted trees trained on rows from a Gaussian copula scored 0.734 ROC-AUC on real people, against 0.751 when trained on real rows. Tested on its own made-up rows, the worst generator scored highest, 0.947. A generator that copied people with a little noise passed one privacy check and failed another, and passing both is still not privacy. Adding made-up rows to 200 real ones helped one model and hurt the other.
Why prompts are production artifacts, not strings in your app, and how a prompt registry gives you versioning, testing, rollback, lineage, and caching.
Start with clear definitions. Many interviews open with one of these to see if you can explain the field simply.
What is generative AI?
Generative AI means models that create new content: text, images, audio, video or code. They learn patterns from a large amount of example data, then produce new data that follows those patterns.
ChatGPT writing an email and a model drawing a picture from a sentence are both generative AI. ChatGPT runs on an LLM (large language model), a model that reads and writes text in small pieces called tokens.
What is the difference between a generative and a discriminative model?
A discriminative model learns how to pick a label for an input, such as spam or not spam. A generative model learns how the data itself is spread out, which lets it make new examples.
Some generative models, like Naive Bayes, can also classify. So the difference is what the model learns, not only what it outputs.
What is a foundation model?
A foundation model is a large model trained on broad data, so it can be used for many tasks. GPT, Claude, Llama and Gemini are examples.
You build on it with a prompt, with RAG, or with fine-tuning, instead of training a new model from zero. RAG adds relevant text from your documents to the prompt. Fine-tuning trains the model a little more on your own examples.
Open-weight or closed model: how do you choose?
A closed model is used through the provider's API, a web service you send requests to. You never see its weights, the numbers it learned. An open-weight model gives you the weights, so you can run it yourself.
Closed models are often stronger and easier to start with. Open-weight models let you keep data in-house, lower the cost at high volume, and fine-tune freely. Read each model's licence before you use it.
GANs, VAEs and diffusion are the three classic families for images. You need the idea behind each, and why diffusion took over.
Three ways to generate imagesA GAN learns through a contest between two networks. A VAE learns a compact code it can decode. A diffusion model learns to remove noise. Most image generators today use diffusion.
How does a GAN work?
A GAN (generative adversarial network) has two networks. The generator makes fake examples. The discriminator tries to tell fakes from real examples. Each gets better by competing with the other.
GANs can make sharp images fast. They are hard to train. They can also suffer mode collapse, where the generator keeps making only a few kinds of output.
A VAE (variational autoencoder) has an encoder and a decoder. The encoder maps each example to a small range of likely values in a compact space, called the latent space. The decoder rebuilds the example from a point in that space.
Training keeps the latent space smooth and centred. So a random point from it decodes into a sensible new example. VAE images are often a little blurry.
In training, the model sees images with random noise added, and learns to predict that noise. If you can predict the noise, you can subtract it. To generate, the model starts from pure noise and removes a little at each step, until an image appears.
It is slower than a GAN, because it takes many steps. It is more stable to train and gives more varied, high-quality images.
A text encoder turns the prompt into numbers. At every noise-removing step, the model reads those numbers, so its guess of the noise depends on the text.
Many models use classifier-free guidance. They make one guess with the prompt and one without it, then exaggerate the difference. A higher guidance setting follows the prompt more closely.
What is latent diffusion?
Removing noise from a full-size image is slow. Latent diffusion first uses an encoder, like a VAE's, to compress the image into a much smaller latent form. It runs diffusion there, then decodes the result back into pixels.
Stable Diffusion works this way. It is a big reason image generation can run on one home graphics card (GPU).
How is diffusion made faster?
Better samplers can reach a good image in far fewer steps than the original method. Distillation trains a student model to do the work of many steps in just a few.
Fewer steps usually cost a little quality, so the right number depends on the product.
How is text generation different from image diffusion?
Text models are usually autoregressive: they write one token at a time, each based on the tokens before. Diffusion models refine a whole image at once, over many steps.
The two are getting closer. Some image models now generate tokens one by one, and some text models use diffusion.
3. Multimodal models
Multimodal means a model works with more than one kind of data, such as text and images together.
How a model reads an imageThe image is turned into tokens that sit next to the text tokens. From then on, the language model treats them almost like words.
How does a vision-language model understand an image?
A vision encoder cuts the image into small patches and turns each into numbers. A small projection layer maps these into the same space as text tokens. They become image tokens, placed next to the text tokens.
The language model then reads both together, so it can answer questions about the picture.
What is CLIP?
CLIP is a model from OpenAI. It turns images and text into lists of numbers in one shared space, called an embedding space. A photo of a dog and the words "a photo of a dog" end up close together.
It was trained on image and caption pairs, pulling matching pairs together and pushing others apart. It is used for image search and to guide image generation.
How do voice assistants use generative AI?
The common design has three steps. Speech-to-text, also called ASR (automatic speech recognition), turns speech into text. An LLM writes the answer. Text-to-speech (TTS) reads it aloud.
Newer models handle audio directly, which lowers the delay and keeps tone of voice. The three-step design is still easier to debug.
4. Building with generative AI
This part is about turning a model into a product that works every day.
What makes a good prompt?
Give the model a clear role, the task, the context it needs, and the exact output format. Add one or two examples of good answers when the format matters.
Put fixed instructions first and changing content last. Many providers then reuse, or cache, the fixed part across requests, which saves cost.
A small change to a prompt can break answers in ways nobody notices. So store prompts with a version. Test each change against a fixed set of examples, and keep a way to roll back.
Log which prompt version produced each answer, so a bad answer can be traced.
Prompting, RAG or fine-tuning: where do you start?
Start with prompting, because it is fastest to change. Add RAG when the model needs your own or fresh information. Fine-tune only to change behaviour that prompting cannot fix.
Each step costs more time and money than the one before. Move on only when you have measured a need.
How do you control the cost of a generative AI app?
Send easy requests to a small, cheap model and hard ones to a strong model. This is called routing. Also cut repeated text from prompts, cap the length of replies, and cache common answers.
Measure the cost per request, not only the monthly bill, so you can see which feature costs most.
How do you know a generative AI app is working in production?
Checking for errors is not enough. The app can report success and still give a wrong answer. Log the full prompt, the answer, the tokens used and the time of each step, under one ID per request.
Then review samples of real answers regularly, and track user feedback.
Generated content rarely has one correct answer. These questions test how you measure quality anyway.
How do you evaluate output that has no single right answer?
Combine several methods. Keep a fixed set of test inputs with examples of good answers. Use code checks for format and facts. Use an LLM judge, a model that grades answers, for things like tone. Check the judge against human grades.
In production, compare versions with real users in an A/B test, where each group sees a different version.
FID (Fréchet Inception Distance) turns many generated and many real images into numbers with an image model. Then it measures how far apart the two groups are. Lower is better. CLIP score checks how well an image matches its text prompt.
Both are rough. Human ratings are still the final test for image quality.
How do you reduce hallucinations in a generative AI product?
Give the model the right source text to answer from. Ask it to cite that text, and let it say it does not know. Check important facts in code where you can.
Design the product so that a wrong answer is caught or is not harmful. For example, show sources, or ask a person to approve risky actions.
This part covers privacy, safety, law and security.
A prompt is a data exportWhatever you put in a prompt leaves your system. Remove personal data first, and decide how long prompts and logs are kept.
How do you protect personal data in a generative AI app?
Treat every prompt sent to a provider as data leaving your company. Remove or mask personal data, like names and phone numbers, before it reaches the model and your logs.
Keep logs only as long as you need them. Check where the provider stores data, and make deletion work in every store.
Guardrails are checks around the model. Input checks can block attacks or personal data. Output checks can block harmful content, leaked secrets or broken formats.
They reduce risk but do not remove it. Combine them with limits on what the app is allowed to do.
Models are trained on huge amounts of existing work. The law on this is still being decided in many countries. Output can sometimes copy training data closely.
In practice, check the licence of the model you use. Avoid prompts that ask for a named artist's or brand's work. Ask your legal team about your use case.
How can AI-generated images be detected?
Detection from pixels alone is unreliable. The stronger approach is labelling at creation. Watermarks like Google's SynthID hide a signal in the content. C2PA content credentials attach signed information about how a file was made.
Neither is complete, because some tools add no label and some labels can be removed.
Can downloading a model be a security risk?
Yes. Some model file formats use Python's pickle format. A pickle file can include instructions to run any code while it loads. A harmful file can take over the machine before you see the model.
Prefer the safetensors format, which holds only numbers. Fix the exact version of everything you install, and check the source of every model you load.
Train one model on the synthetic data and one on real data. Test both on real data you kept aside. If the synthetic one scores close to the real one, the synthetic data is useful.
Also check the rare cases, not just the averages. Then check the generator did not copy real rows. A near copy of a real person's record is a privacy leak.
Model collapse happens when models are trained on the output of earlier models, again and again. Rare cases get sampled less each time, until they disappear, and the output becomes more and more average.
So keep real data in the training mix, and track where your data came from.
The interviewer's follow-up is "have you actually built this?" What would you say?
Memorised answers fall apart at the second question. The lessons below teach the parts behind the answers, starting with "Reading a Model Name: What 27B, FP8, A3B and Instruct Actually Mean", so you can explain why and not only what.
The lessons that teach the next part
A model name is a spec sheet written in shorthand. Learn to decode publisher, family, version, parameter count, mixture-of-experts markers, post-training suffixes and numeric formats, and to predict from the name alone whether a model will fit on your GPU.
Synthetic data, measured on 30,000 real card holders over 30 seeds. Boosted trees trained on rows from a Gaussian copula scored 0.734 ROC-AUC on real people, against 0.751 when trained on real rows. Tested on its own made-up rows, the worst generator scored highest, 0.947. A generator that copied people with a little noise passed one privacy check and failed another, and passing both is still not privacy. Adding made-up rows to 200 real ones helped one model and hurt the other.
Why prompts are production artifacts, not strings in your app, and how a prompt registry gives you versioning, testing, rollback, lineage, and caching.
Every answer on this page comes from our AI Engineering course: 210 lessons on RAG, evals, agents, serving, security and MLOps. Many of them are built around a real experiment. You learn why the answer is right, which is what an interviewer checks with the second question. 10 lessons are free to read, with no card needed.
These questions are a start. The interview asks more.
Get all 150 questions in the GenAI and LLM Engineering pack
Each question has why it is asked, a full answer, what the interviewer listens for, the follow-ups, the common mistakes and a diagram (173 diagrams in all). A PDF you keep, junior to staff level.