SevyDevy

Design an AI image generator like midjourney

PremiumLLM systemMedium

  • Diffusion models
  • GPU scheduling
  • Priority queues

Quick answer

This LLM system interview question asks you to design an AI image generator like midjourney. Aim for a design that uses language models to serve users well, then explain retrieval, prompting, serving, evaluation and trade-offs. Interviewers want to see how you control quality, cost and latency, and how you evaluate the results.

The problem

Design an AI image generator like Midjourney. Users type a text prompt and get a grid of 4 images, then upscale one or ask for variations. The hard parts are scheduling 5 million jobs a day on expensive GPUs, keeping paid fast jobs under a minute, and blocking unsafe prompts and images without frustrating normal users.

The model is already trained. This interview is about serving it well and safely.

What must an AI image generator like midjourney do?

  • Generate: A prompt, plus optional reference image, aspect ratio and style, returns 4 images.
  • Fast and relaxed modes: Paid plans spend a monthly allowance of fast GPU time; relaxed jobs wait in a lower-priority queue.
4 more requirementsUnlock to see all

How well must it do it?

  • Latency: Fast jobs complete within 60 s at p95 end to end; relaxed jobs within 10 minutes at p95.
  • Safety: At least 99% of a red-team set of unsafe prompts blocked, and at most 2% of a benign set wrongly blocked.
4 more requirementsUnlock to see all

What scale should you design for?

Use these numbers in your estimates.

The scale numbers unlock with this questionUnlock

Key concepts

  • Diffusion models
  • GPU scheduling
  • Priority queues
  • Content safety classifiers
  • Prompt adherence
  • Watermarking

How you’ll practise

6 short steps · save and come back any time
  1. Problem framing
  2. Data and retrieval
  3. Prompting and orchestration
  4. Evaluation and safety
  5. Serving, cost and latency
  6. Wrap-up

Lala, personalized to you, gives a hint when you ask and reviews your design when you are ready.

What do interviewers look for?

In any LLM system design round.

  • Defines the user task and what a good answer is
  • Explains how relevant context reaches the model
  • Plans evaluation before and after launch
  • Controls cost and latency with caching and routing
  • Covers safety, privacy and abuse
  • Handles failures and fallbacks gracefully

Questions people ask about this interview question

Which design type is this question?
It is an LLM system question. You design an AI image generator like midjourney and explain your choices the way you would in an interview.
Is this question asked at entry level?
It is marked Medium. Entry-level engineers can practise it, but it expects you to reason about requirements and trade-offs, not only list components.
What should I cover first?
Start with the user task, what a good answer looks like and how it will be measured. Agree on scope with the interviewer before you design anything.
Can I practise it for free?
It is a premium question. Sign up and unlock it once for 10 credits; it then stays unlocked. When you finish, Lala, your personalized AI mentor, can review your design for 30 credits.

Related questions

Updated · Written by the SevyDevy team

Premium questionSign up free, then unlock it