← Mistral AI Interview Insights

Mistral AI·Software Engineer·Onsite - System Design / Architecture·Senior

Senior
May 2026

Summary

System design interview at Mistral AI for a software engineering role. The whole thing was centered on one meaty problem: building an inference API to convert PDFs to Markdown using a fixed set of primitives. Started synchronous, then pivoted to a full async multi-tenant design. Pretty demanding for a single session.

Questions Asked (2)

Q1

A single user uploads a 1000-page PDF and waits for the result. Design the API and processing pipeline to return all converted pages as fast as possible, covering how you parallelize the CPU-bound splitting stage, batch the GPU OCR stage, and pipeline all three stages together.

System DesignTechnical Trade-offsAPI & Integrations
Author's notes

This is where I spent most of my energy.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and constraints (latency target, hardware, PDF structure), then propose an asynchronous API that returns a job ID and streams results. Design a three-stage pipeline (split → OCR → assemble) with bounded queues, parallel CPU splitting, batched GPU OCR, and backpressure to maximize throughput and minimize end-to-end latency.

Pro tip: Emphasize that the real bottleneck is often the GPU OCR stage, so batching and overlapping I/O with compute are critical; also mention that returning pages incrementally as they complete can dramatically improve perceived latency.

1. Clarify requirements and constraints

Ask about latency targets, hardware (CPU cores, GPU memory), PDF characteristics (text vs. scanned), and whether partial results are acceptable. This shapes the entire design.

2. Design the API contract

Propose an asynchronous API: POST /convert returns a job ID, and the client polls or subscribes via WebSocket/SSE for page results. Include options for streaming pages as they become ready.

3. Architect the three-stage pipeline

Split the PDF into pages using a process pool (CPU-bound), feed pages into a bounded queue, and have a GPU worker batch pages for OCR. Use a second queue for OCR results and an assembler that emits pages in order.

4. Parallelize and batch effectively

Parallelize splitting across CPU cores with multiprocessing; batch OCR requests on the GPU with dynamic batching to maximize utilization. Tune batch size based on GPU memory and latency requirements.

5. Handle backpressure and ordering

Use bounded queues to prevent memory blowup; implement backpressure so fast stages don't overwhelm slow ones. Track page order and buffer out-of-order results to deliver a consistent stream.

Key Points to Mention

  • Asynchronous API with job ID and streaming/polling for results
  • Process pool for CPU-bound PDF splitting to bypass GIL
  • Dynamic batching on GPU for OCR to maximize throughput
  • Bounded queues and backpressure to manage memory and prevent overload
  • Overlapping stages via pipelining to hide latency
  • Incremental result delivery to improve perceived performance

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Now redesign the system for many concurrent users where results can be returned asynchronously. Cover the job submission and polling or webhook API, how you structure separate worker pools for each stage, autoscaling per stage, and how you handle backpressure, fairness across tenants, retries, and partial failures in a multi-page job.

System DesignTechnical Trade-offsAdaptability & Ambiguity
Author's notes

A lot to unpack.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the requirements and constraints, then design an asynchronous job processing system with a clear API for submission and result retrieval. Break down the pipeline into stages, each with its own worker pool and autoscaling, and address cross-cutting concerns like backpressure, fairness, retries, and partial failures. Emphasize trade-offs and how you would validate the design.

Pro tip: Proactively discuss how you would handle partial failures in multi-page jobs by checkpointing progress and allowing resumption, and how you would ensure fairness across tenants using per-tenant queues or rate limiting. This shows you think about real-world operational challenges.

1. Clarify Requirements and Constraints

Ask questions to understand expected scale, latency SLAs, tenant isolation needs, and failure semantics. This ensures your design meets the actual needs.

2. Design the API and Job Lifecycle

Define endpoints for job submission (returning a job ID) and result retrieval via polling or webhooks. Outline the job states (e.g., pending, processing, completed, failed) and how clients are notified.

3. Architect the Processing Pipeline with Worker Pools

Break the job into stages (e.g., fetch, process, aggregate) and assign dedicated worker pools per stage. Explain how stages communicate (e.g., queues) and how autoscaling works per stage based on queue depth or CPU.

4. Address Backpressure, Fairness, and Reliability

Describe mechanisms for backpressure (e.g., bounded queues, rate limiting), fairness across tenants (e.g., per-tenant queues, weighted fair queuing), retries with exponential backoff, and handling partial failures (e.g., checkpointing, idempotency).

5. Discuss Trade-offs and Validation

Summarize key trade-offs (e.g., polling vs webhooks, complexity vs scalability) and how you would test and monitor the system (e.g., load testing, metrics, tracing).

Key Points to Mention

  • Asynchronous job submission with job ID and polling/webhook for results
  • Separate worker pools per stage with independent autoscaling
  • Backpressure handling via bounded queues and rate limiting
  • Fairness across tenants using per-tenant queues or quotas
  • Retry strategies with exponential backoff and idempotency
  • Partial failure handling in multi-page jobs via checkpointing and resumption

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.