← Questions

Design an image generation product

0
MetaSystem designLast asked Aug 2025

An AI system design interview question asked in Meta's technical phone screen, last asked Aug 2025. It tests generative ai, diffusion and model serving.

Design an image generation product: users type a prompt (and optionally upload a reference image) and get images back within seconds. Cover the system end to end, from training data to serving, then extend the design to a model that both accepts and produces text and images.

Requirements

  • Functional: text-to-image generation with a few images per request, plus options such as size, style and image-to-image editing.
  • Functional: safety filtering of prompts and outputs, and a way for users to report bad results.
  • Functional: an extension to multimodal generation: inputs and outputs that mix text and images, as in a chat assistant.
  • Non-functional: a target latency per request (for example under 10 seconds), high GPU utilization and a controlled cost per image.
  • Non-functional: large request volume with daily peaks.

Clarifying questions

  • Who are the users: consumers, designers, developers through an API?
  • What latency and resolution do we promise, and what is the cost budget per image?
  • Do we train our own model, or fine-tune and serve an existing one?
  • Which content is not allowed, and in which regions?
  • How do we measure "good" images?

What a strong answer covers

  • Data: sources and licensing, deduplication, quality and safety filtering, and recaptioning images with a vision-language model to improve prompt following.
  • Model choices: latent diffusion or flow models compared with autoregressive image tokens; text encoders for conditioning; training at low resolution first, then higher.
  • Compute planning for training, and the training objective.
  • Serving: GPU workers with batching, fewer sampling steps through distillation, quantization, caching of prompt embeddings, a queue with priorities, and autoscaling.
  • Safety as layers: a prompt classifier, output image classifiers, watermarking or provenance metadata, and human review for reports.
  • Evaluation: automatic metrics (FID, CLIP score, prompt-following checks) and human preference ratings, with bias and diversity checks.
  • The multimodal extension: one model over interleaved text and image tokens, or a language model that calls an image generator. Data alignment, instruction tuning and preference tuning.
  • Monitoring: latency, cost per image, filter rates, user feedback.

Follow-ups

  • Cut the cost per image in half without a visible drop in quality.
  • Users ask for a consistent character across many images. What changes?
  • Walk through a recent paper relevant to this design: its key idea, setup and metrics, and how you would put it into production.

Where it's asked

  • Meta · Technical phone screen · Last asked Aug 202545 min · Two coding problems in CoderPad, about 20 minutes each · Usually no AI; some newer screens are AI-assisted

What it tests

generative ai · diffusion · model serving

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing