Generative AI Engineer interview questions
100 real questions with model answers and explanations for Junior candidates.
See a Generative AI Engineer resume example →Practice with flashcards
Spaced repetition · Hunter Pass
Questions
A generative model learns a data distribution it can sample from, while a discriminative model learns to predict a label or boundary from an input.
- A diffusion model can create a new image resembling its training distribution.
- A discriminative image classifier maps an existing image to labels such as cat or dog.
- Some learned representations can support both tasks, but generation and classification use different objectives and outputs.
Why interviewers ask this: The interviewer checks whether the candidate can distinguish content generation from prediction without equating every neural network with generative AI.
A latent representation is a learned compact description of data in a space where the model can manipulate useful features.
- Nearby latent points often decode to outputs with similar high-level properties, although this is not guaranteed for every model.
- A latent can retain shape and composition while omitting some pixel-level detail.
- Sampling or editing latents is cheaper than operating on every pixel when the latent tensor is much smaller.
Why interviewers ask this: A strong answer connects latent space to learned features, compression, and practical generation rather than calling it hidden data.
An autoencoder learns to reconstruct its input through an encoder, a bottleneck representation, and a decoder.
- The encoder maps an image or other asset into a lower-dimensional code.
- The decoder uses that code to reconstruct an output close to the original input.
- A reconstruction loss trains both parts, and the bottleneck forces the code to retain useful information instead of copying every value directly.
Why interviewers ask this: The interviewer evaluates whether the candidate understands the encoder, bottleneck, decoder, and reconstruction objective as one system.
A variational autoencoder learns a distribution for each input's latent code and trains with an ELBO that balances reconstruction against a regular latent space.
- The encoder predicts parameters such as a mean and variance rather than one fixed code.
- The reconstruction term rewards latents that let the decoder reproduce the input.
- The KL term keeps the learned posterior near a chosen prior, usually a standard normal, so new latents can be sampled.
- The ELBO is optimized because the exact data likelihood involves an intractable integral over possible latents.
Why interviewers ask this: A strong answer explains both ELBO terms and why the bound is useful without requiring a full derivation.
The reparameterization trick makes stochastic latent sampling compatible with gradient-based training.
- The encoder predicts a mean and scale, then sampling is written as z equals mean plus scale times random epsilon.
- Epsilon comes from a fixed distribution, so randomness is separated from the learned encoder outputs.
- Gradients can then flow through the mean and scale into the encoder during backpropagation.
Why interviewers ask this: The interviewer checks whether the candidate understands how the trick preserves randomness while allowing gradients to reach encoder parameters.
A GAN trains a generator to create synthetic samples and a discriminator to distinguish real samples from generated ones.
- The generator maps random noise, and sometimes conditioning, into an image or other asset.
- The discriminator receives real and generated examples and outputs a real-versus-fake judgment.
- Training alternates updates so the discriminator supplies a learned training signal to the generator.
Why interviewers ask this: A strong answer identifies each network's input, output, and role in the coupled training process.
Adversarial loss rewards the discriminator for separating real from generated samples and rewards the generator for fooling the discriminator.
- The two objectives form a game rather than a fixed pixel-by-pixel target for the generator.
- In practice, the non-saturating generator loss is often used because it gives stronger gradients early in training.
- If one network becomes much stronger, the other can receive poor gradients, so update balance and learning rates matter.
Why interviewers ask this: The interviewer evaluates whether the candidate understands the competing objectives and why adversarial training can be unstable.
Mode collapse occurs when a generator produces only a narrow set of outputs even though the real data contains much more variety.
- I would generate many samples from different noise inputs under fixed settings and look for repeated identities, poses, layouts, or textures.
- Feature-space distances, clustering, and coverage or recall metrics can reveal low diversity within the generated set and missing regions of a real validation distribution.
- Sharp individual images do not rule out collapse, and nearest training-neighbor checks address memorization rather than generated-sample diversity.
Why interviewers ask this: A strong answer distinguishes visual quality from distribution coverage and diagnoses collapse through diversity among generated samples rather than training-set similarity.
The forward diffusion process gradually adds known noise to clean training data until it becomes close to random noise.
- At each timestep, a small amount of Gaussian noise is added according to a predefined schedule.
- A closed-form relation can produce a noisy sample at a chosen timestep directly during training.
- The forward process is fixed rather than learned; it creates supervised noisy and clean pairs for training the denoiser.
Why interviewers ask this: The interviewer checks whether the candidate knows that forward diffusion corrupts data with a known process rather than generating it.
Reverse denoising starts from noise and repeatedly uses a trained model to estimate a less noisy sample.
- The denoiser receives the current noisy latent or image together with its timestep.
- A scheduler converts the model prediction into the next sample using the selected sampling rule.
- Repeating this path toward timestep zero produces a structured result from the learned data distribution.
Why interviewers ask this: A strong answer separates the denoiser's prediction from the scheduler step that advances the sample.
A noise schedule defines how much signal is removed or noise is added across diffusion timesteps.
- It can be expressed through beta, alpha, or sigma values depending on the formulation and scheduler.
- Early and late timesteps have different signal-to-noise ratios, which changes what the denoiser must recover.
- Training and inference schedules must be compatible, because an arbitrary mismatch can reduce sample quality.
Why interviewers ask this: The interviewer evaluates whether the candidate connects the schedule to signal-to-noise levels rather than treating it as a progress counter.
Timestep embeddings tell the denoiser how noisy the current sample is so it can apply the appropriate transformation.
- The same network sees inputs ranging from almost clean to almost pure noise.
- A numeric timestep is converted into a vector, often with sinusoidal features followed by learned layers.
- That vector conditions blocks throughout the denoiser instead of being treated as an image pixel.
Why interviewers ask this: A strong answer explains why one shared denoiser needs an explicit noise-level signal.
Epsilon prediction asks the model for the noise in the current sample, while x0 prediction asks for an estimate of the clean sample directly.
- Given the timestep and schedule, either prediction can be converted into the other mathematically.
- The parameterization changes the target scale and how training emphasizes different noise levels.
- The pipeline scheduler must interpret the model output using the parameterization on which the checkpoint was trained.
Why interviewers ask this: The interviewer checks whether the candidate understands these as alternative prediction targets with compatible pipeline math.
Classifier-free guidance strengthens conditioning by combining a conditional denoiser prediction with an unconditional prediction from the same model.
- During training, conditioning is sometimes dropped so the model learns both behaviors.
- At inference, the difference between conditional and unconditional predictions is scaled and added to the unconditional result.
- A higher guidance scale can improve prompt adherence but may reduce diversity or create oversaturated artifacts.
Why interviewers ask this: A strong answer describes both conditioning dropout and the quality trade-off of guidance scale.
More sampling steps usually increase latency linearly, while quality gains often level off after enough steps for the chosen model and scheduler.
- Each step normally requires another denoiser evaluation, which is the expensive part of image generation.
- Too few steps can leave composition or fine details underdeveloped unless the model was trained or distilled for short sampling.
- I would compare candidate step counts on a fixed prompt and seed set because the best count is scheduler and checkpoint specific.
Why interviewers ask this: The interviewer evaluates whether the candidate can measure the quality-latency trade-off instead of assuming more steps are always better.
Latent diffusion performs the denoising process in a compressed learned space instead of directly over full-resolution pixels.
- An encoder converts an image into a smaller spatial latent tensor before diffusion training or image-conditioned inference.
- The denoiser processes fewer values, reducing memory and compute compared with pixel-space diffusion.
- A decoder converts the final clean latent back into an image, so compression quality still affects the output.
Why interviewers ask this: A strong answer connects latent-space denoising to both computational savings and reconstruction limits.
The VAE translates between pixel images and the latent space in which the diffusion model operates.
- Its encoder is used for training images and for tasks such as img2img or inpainting that begin with an image.
- Its decoder turns the final denoised latent into visible pixels.
- The VAE is not the main denoiser, and reconstruction errors can appear as color shifts or lost fine detail even when denoising succeeds.
Why interviewers ask this: The interviewer checks whether the candidate distinguishes compression and reconstruction from the diffusion denoising task.
A U-Net denoiser transforms a noisy image or latent into the prediction required for one reverse diffusion step.
- Its downsampling path captures broad spatial context, while its upsampling path restores spatial resolution.
- Skip connections carry local detail between matching resolutions.
- Timestep and text conditioning are injected into its blocks so the prediction reflects both noise level and prompt.
Why interviewers ask this: A strong answer links the U-Net's multiscale structure to its actual denoising output.
Cross-attention lets image or latent features retrieve relevant information from text representations while denoising.
- Queries come from current image features, while keys and values come from encoded prompt tokens.
- Different spatial positions can attend to different words, helping connect objects and attributes to regions.
- Cross-attention improves conditioning but does not guarantee correct counting, binding, or layout.
Why interviewers ask this: The interviewer evaluates whether the candidate knows which modality supplies queries and which supplies conditioning information.
The text encoder converts tokenized prompt text into contextual vectors that condition the image denoiser.
- The tokenizer first maps text to the vocabulary and sequence format expected by that encoder.
- The encoder represents each token in context, so the same word can produce different vectors in different prompts.
- Many pipelines keep the text encoder frozen during inference and most adapter training, while the denoiser consumes its outputs.
Why interviewers ask this: A strong answer distinguishes tokenization, text encoding, and image denoising as separate pipeline stages.
Locked questions
- 21
What happens when a prompt exceeds the text encoder's token limit?
promptingtokens - 22
How does a random seed help with reproducibility in image generation?
- 23
What is a negative prompt in diffusion image generation?
promptingnegative-prompt - 24
What does denoising strength control in img2img?
- 25
How is an inpainting mask used in a diffusion pipeline?
inpaintingci-cd - 26
How does outpainting extend an image?
- 27
What problem does ControlNet solve in diffusion pipelines?
controlnetci-cd - 28
What does an IP-Adapter add to a text-to-image pipeline?
ip-adapterci-cd - 29
What is LoRA for fine-tuning a diffusion image model?
fine-tuninglora - 30
What is DreamBooth used for?
dreambooth - 31
When would you choose LoRA instead of a full fine-tune?
fine-tuninglora - 32
What are the base and refiner concepts in SDXL?
- 33
What is a Diffusion Transformer, or DiT?
nlpdit - 34
What is the core idea of an MM-DiT architecture for text-to-image generation?
mm-dit - 35
Why is temporal coherence difficult in text-to-video generation?
temporal - 36
How do keyframes differ from frame interpolation?
interpolation - 37
How do waveform, spectrogram, and token representations differ for generative audio?
tokensspectrogram - 38
What are the acoustic model and vocoder in a TTS system?
vocodersystem-design - 39
What kinds of conditioning can guide a music-generation model?
- 40
What are multimodal embeddings?
nlpembeddings - 41
How is standard FID computed for generated images?
fid - 42
What are the main limitations of Inception Score?
inception-score - 43
How would you evaluate compositional generation for counting, spatial relations, and attribute binding?
bindingdecision-makingoop - 44
How would you run a human pairwise evaluation of two image models?
llm-eval - 45
What role does a safety classifier play in a generative pipeline?
safety-classifierci-cd - 46
How does a watermark differ from provenance metadata for generated media?
watermarkprovenance - 47
What does fp16 mean for generative-model inference, and is it integer quantization?
model-compressionprecisionquantization - 48
How does batch size affect throughput and per-asset generation cost?
throughputbatch - 49
What are the main components of a Hugging Face diffusers text-to-image pipeline?
ci-cddiffuserscomponents - 50
How would you safely share and run a ComfyUI workflow that uses downloaded model files?
comfyui - 51
A user requests a 16:9 banner, but your image pipeline returns a square image. How would you debug it?
ci-cd - 52
The same seeded video prompt produces clips with different motion and playback timing on two machines. What would you pin for reproducibility?
prompting - 53
An SDXL prompt puts a required object near the end, but the object never appears. How would you check both text encoders?
prompting - 54
Images become oversaturated and develop harsh edges after CFG is raised from 7 to 20. What would you do?
- 55
A four-step image preview looks acceptable overall, but tiny faces and logos are often damaged. How would you decide where that preview is safe?
- 56
An instruction-based image editor changes a jacket from blue to red, but also alters the person's face and the room. How would you improve edit locality?
- 57
An inpainted sleeve has a visible seam around the mask boundary. How would you reduce it?
- 58
A ControlNet pipeline receives a Canny edge map but produces incoherent structure with a depth ControlNet checkpoint. What is wrong?
controlnetci-cd - 59
With an IP-Adapter reference enabled, every result copies its composition and barely follows the text prompt. How would you rebalance it?
promptingip-adapteroop - 60
A portrait LoRA reproduces the same clothing and background in nearly every prompt. How would you address the overfit?
promptingfine-tuninglora - 61
You have one approved still image of a character, but the animated result loses the face and clothing after a few seconds. How would you transfer the character consistently?
- 62
A text-to-image fine-tune has many empty captions and captions that describe the wrong objects. What would you do before training?
fine-tuning - 63
A fine-tuning job crashes halfway through because several downloaded images are corrupt. How would you prevent another wasted run?
fine-tuning - 64
A LoRA training run is stable in fp32 but its loss becomes NaN in mixed precision. How would you debug it?
fine-tuninglora - 65
An SDXL job fits at 1024 by 1024 with batch one, but OOMs at 1536 by 1536 with batch two and a ControlNet. How would you make it fit?
controlnetbatch - 66
Generated images gain a green tint only after the latent is decoded. How would you investigate the VAE?
- 67
A teammate swaps the diffusion scheduler and the same prompt and seed now produce a different image. Is that a bug?
prompting - 68
A moderation filter blocks benign anatomy drawings as NSFW. How would you handle this false positive?
- 69
A red-team image passes moderation even though it clearly violates the product policy. What would you do with this false negative?
- 70
An invisible watermark is detectable on the original image but disappears after social-media recompression. What would you change?
watermark - 71
A portrait generator matches its reference closely on front-facing studio photos but fails on side poses, dim light, and some cultural clothing. How would you evaluate it?
llm-evaldecision-makinggenerators - 72
A model gets a high CLIPScore by writing the prompt words inside the image. How would you evaluate it more fairly?
promptingdecision-makingllm-eval - 73
Two reviewers disagree often when comparing outputs from image models A and B. How would you improve the pairwise evaluation?
llm-evalconflict - 74
A generated campaign image looks nearly identical to one training image. How would you investigate possible memorization?
- 75
Generated audio sounds distorted, and its waveform has flat peaks at full scale. How would you fix the clipping?
- 76
A TTS voice repeatedly mispronounces the product name Qlora. How would you correct and test it?
- 77
A customer uploads a celebrity interview and asks the app to clone that voice. What should the pipeline do?
ci-cd - 78
A MusicGen request asks for 20 seconds, but the melody-conditioning clip is only 5 seconds and the ending becomes unrelated. How would you handle the duration mismatch?
- 79
A generated video looks good frame by frame but brightness and texture flicker during playback. How would you debug it?
- 80
After export, the drum stem in generated music lands 180 ms ahead of the melody stem. How would you diagnose and fix it?
- 81
A generated 24 fps clip plays too fast after export and its audio ends later than the video. What would you inspect?
- 82
A shared ComfyUI workflow opens with red unknown nodes on a new machine. How would you make it run?
comfyui - 83
A diffusers pipeline worked yesterday, but loading the same model now fails after a library upgrade. How would you resolve the revision mismatch?
ci-cddiffusers - 84
A user asks for a tutorial with text and generated images alternating in one response. When would you use interleaved multimodal output instead of separate text and image calls?
- 85
The first image request to a Modal endpoint takes 35 seconds, while warm requests take 4 seconds. How would you address the cold start?
endpoints - 86
Replicate retries a completion webhook, and your service creates three copies of the same output. How would you make the handler safe?
replicationwebhooks - 87
A batch generated 800 usable images during a two-hour run on a GPU priced at $1.60 per hour. How would you calculate per-image cost?
batchhardware - 88
GPU throughput improves with batches of eight, but interactive users wait too long for a batch to fill. What would you change?
throughputhardwarebatch - 89
The model reports four-second inference, but users receive images after seven seconds. How would you measure the missing latency?
inferencelatency - 90
A designer wants to recreate an approved image next month. What generation provenance would you save?
design - 91
A creative-review request uploads 28 reference images, but the multimodal model accepts at most 20. How would you handle it?
- 92
A generated caption says a person is holding a phone, but no phone is visible. How would you reduce this hallucination?
hallucination - 93
An image-to-3D pipeline receives front, side, and rear photos of a chair, but one view shows different legs and the mesh becomes distorted. How would you handle view disagreement?
conflictci-cd - 94
A talking-head video starts in sync, but the lips visibly lag the speech near the end. How would you detect and locate the drift?
iac - 95
You need to translate a live support call while preserving the speaker's tone. How would you choose between speech-to-speech and an ASR plus translation plus TTS cascade?
- 96
An uploaded mood-board image contains tiny text telling the model to ignore the user and publish private assets. How would you defend against it?
- 97
A campaign generator starts in French minimalist style but later outputs English copy with a playful tone. How would you prevent the drift?
iacgenerators - 98
A video moderator checks one frame every ten seconds and misses a one-second unsafe segment between samples. How would you improve the pipeline?
ci-cd - 99
Debug logs for an image-generation endpoint contain full user prompts and uploaded portraits. What would you change?
promptingendpoints - 100
How would you explain a generative image project you built, including quality, latency, and cost?
latency