← Anthropic Interview Insights

Anthropic·Software Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
May 2026

Summary

System design round at Anthropic for a software engineering role, focused almost entirely on GPU inference serving. The problem was meaty and the hints they dropped mid-interview made it clear they wanted you to reason from first principles, not just recite vague distributed systems platitudes.

Questions Asked (7)

Q1

Design an online GPU inference serving system that batches compatible requests together, routes work to GPU workers, supports multiple models and versions concurrently, and balances throughput against latency SLOs.

System DesignTechnical Trade-offs
Author's notes

This was the whole interview basically.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and SLOs, then sketch a high-level architecture with a request router, batching queue, and GPU worker pool. Dive into the batching strategy and scheduling policies, explaining how they balance throughput and latency while supporting multiple models and versions. Conclude with trade-offs and failure handling.

Pro tip: Emphasize that batching must be compatible (same model, version, and input shape) and discuss dynamic batching with a timeout to avoid latency violations. Show awareness of GPU memory constraints and model swapping costs.

1. Clarify Requirements and SLOs

Ask about expected QPS, model types, latency SLOs (e.g., p99), and hardware constraints. Define what 'compatible' means for batching.

2. High-Level Architecture

Propose components: API gateway, request queue, batching scheduler, GPU worker pool, model registry, and monitoring. Explain how requests flow through the system.

3. Batching and Scheduling Strategy

Describe dynamic batching with a max batch size and timeout, and a scheduling policy that prioritizes latency-sensitive requests while maximizing GPU utilization.

4. Multi-Model and Version Support

Explain how to load multiple models/versions on GPUs, possibly using model multiplexing or separate worker pools, and how to route requests to the correct version.

5. Trade-offs and Failure Handling

Discuss trade-offs between throughput and latency, and strategies for handling GPU failures, overload, and model updates without downtime.

Key Points to Mention

  • Dynamic batching with timeout and max batch size to balance latency and throughput
  • Compatibility criteria for batching: same model, version, and input dimensions
  • GPU memory management and model swapping overhead
  • Load balancing and routing strategies (e.g., consistent hashing, least-loaded)
  • Autoscaling GPU workers based on queue depth and latency SLOs
  • Monitoring and metrics for latency, throughput, and GPU utilization

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

Q2

What makes two inference requests 'compatible' for batching, and which compatibility mismatch is a correctness bug rather than just an efficiency problem?

System DesignTechnical Trade-offs
Author's notes

I listed model ID, model version, input dtype, and sequence length range.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining what 'compatible' means for batching inference requests: they must share the same model, tokenizer, and execution configuration, and their input/output shapes must be compatible for concatenation. Then distinguish between mismatches that only affect efficiency (e.g., different sequence lengths causing padding overhead) and those that break correctness (e.g., different models or tokenizers leading to wrong outputs).

Pro tip: Emphasize that correctness bugs arise when batching changes the semantics of individual requests, such as mixing requests with different sampling parameters (e.g., temperature, top-p) or different stop sequences, because the batch-level implementation may apply one set of parameters to all. This shows you understand the subtle pitfalls beyond obvious model mismatches.

1. Define compatibility criteria

List the dimensions along which requests must match for safe batching: model architecture and weights, tokenizer, input/output tensor shapes, and execution configuration (e.g., dtype, device).

2. Separate efficiency vs. correctness

Explain that some mismatches (e.g., varying sequence lengths) only cause inefficiency due to padding, while others (e.g., different models) produce incorrect results if batched.

3. Identify the critical correctness bug

Pinpoint the mismatch that is a correctness bug: batching requests that require different sampling parameters (e.g., temperature, top-k, top-p) or different stop conditions, because the batch will apply a single set of parameters, altering outputs.

4. Discuss mitigation strategies

Mention how to handle incompatible requests: group by compatibility keys, use separate batches, or implement per-request parameter handling if the system supports it.

Key Points to Mention

  • Same model and tokenizer are prerequisites for batching.
  • Input shapes must be compatible for concatenation; padding can handle length differences but adds overhead.
  • Different sampling parameters (temperature, top-p, top-k) across requests in a batch cause incorrect outputs if not handled per-request.
  • Stop sequences and max tokens must be consistent or handled individually to avoid truncation or extra generation.
  • Batching requests with different dtypes or devices can lead to errors or silent precision loss.
  • Efficiency mismatches (e.g., varying lengths) can be mitigated with bucketing or dynamic batching, but correctness mismatches require separation.

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

Q3

What conditions should trigger the scheduler to stop waiting and dispatch a batch? How do you derive the linger time limit from the latency SLO rather than picking an arbitrary number?

System DesignTechnical Trade-offs
Author's notes

I gave three triggers: batch size cap hit, linger timeout, and worker becoming available with an idle queue.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by enumerating the conditions that should trigger a dispatch: batch size threshold, linger time limit, queue drain, and system signals like memory pressure. Then explain how to derive the linger time from the latency SLO by subtracting expected processing and network overhead, and validating with tail latency measurements.

Pro tip: Mention that the linger time should be set as a fraction of the SLO budget to leave room for other latency contributors, and that you'd monitor the actual end-to-end latency distribution to adjust it dynamically.

1. Identify dispatch triggers

List the conditions that cause the scheduler to stop waiting: batch size reached, linger time expired, queue empty, or external signals like shutdown or memory pressure.

2. Define the latency SLO budget

Break down the end-to-end latency SLO into components: queue wait, batch formation (linger), processing, and network. Allocate a portion to linger.

3. Derive linger time from SLO

Set linger time = SLO budget for batching minus expected processing and network overhead, ensuring it's a fraction of the total to allow for variability.

4. Validate and adjust

Measure actual latency percentiles (p50, p95, p99) and adjust linger time to meet SLO without excessive batching delay.

5. Consider trade-offs

Discuss how linger time affects throughput and latency; longer linger improves batching efficiency but risks SLO violations.

Key Points to Mention

  • Batch size threshold as a primary trigger to bound memory and processing time.
  • Linger time as a deadline to prevent indefinite waiting and ensure latency SLO.
  • Queue drain condition when no more requests are expected (e.g., low traffic).
  • System signals like memory pressure or shutdown that force dispatch.
  • Deriving linger time by subtracting processing and network overhead from the SLO budget.
  • Using tail latency (p99) to validate and adjust linger time, not just average.

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

Q4

How does your scheduler need to change for autoregressive LLM generation compared to fixed-cost models, and what becomes the binding capacity constraint once you move to continuous batching?

System DesignTechnical Trade-offsAlgorithms & Data Structures
Author's notes

This was a follow-up and it's where I felt most out of my depth.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by contrasting fixed-cost models (e.g., BERT) where each request has a known, static compute cost, with autoregressive LLMs where generation is iterative and per-token cost varies. Explain how the scheduler must shift from batch-level scheduling to token-level scheduling with continuous batching, and identify the new binding constraint (often KV cache memory or memory bandwidth) rather than compute.

Pro tip: Emphasize that the binding constraint shifts from compute to memory bandwidth and KV cache capacity, and that scheduling decisions must now consider memory fragmentation and eviction policies to maintain high utilization.

1. Contrast workload characteristics

Describe how fixed-cost models have uniform, predictable execution times per request, while autoregressive LLMs generate tokens sequentially with variable output lengths, leading to dynamic and heterogeneous workloads.

2. Explain scheduling implications

Detail why static batching is inefficient for LLMs: it wastes compute on padding and cannot adapt to early-finishing sequences. Introduce continuous batching (iteration-level scheduling) where new requests can join and finished ones leave at each token step.

3. Identify the new binding constraint

Argue that with continuous batching, compute is no longer the bottleneck; instead, KV cache memory capacity and memory bandwidth become the limiting factors because each active sequence requires storing keys and values for all previous tokens.

4. Discuss trade-offs and optimizations

Mention techniques like PagedAttention to manage KV cache memory efficiently, and how scheduling must balance batch size, memory usage, and latency to maximize throughput without causing out-of-memory errors.

5. Conclude with practical impact

Summarize that the scheduler must be memory-aware and dynamic, and that the binding constraint is the KV cache size (or memory bandwidth), which dictates the maximum number of concurrent sequences and overall system throughput.

Key Points to Mention

  • Fixed-cost models (e.g., BERT) have static per-request compute; autoregressive LLMs have variable, token-by-token compute.
  • Continuous batching (iteration-level scheduling) allows dynamic addition/removal of sequences at each token generation step.
  • KV cache memory grows linearly with sequence length and batch size, becoming the primary capacity constraint.
  • Memory bandwidth limits how fast KV cache can be read/written, affecting token generation speed.
  • PagedAttention and similar techniques manage KV cache memory to reduce fragmentation and enable larger batches.
  • Scheduling must balance latency (time per token) and throughput (tokens per second) under memory constraints.

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

Q5

The dashboard shows low GPU utilization but p99 latency is rising. What's the likely cause and what would you tune?

Root Cause AnalysisSystem Design
Author's notes

Liked this one.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the workload and metrics (e.g., batch size, sequence length, model size, GPU type) to rule out measurement artifacts. Then hypothesize that the bottleneck is not raw compute but memory bandwidth, data loading, or synchronization overhead, and propose a systematic tuning plan that addresses each layer of the stack.

Pro tip: Emphasize that low GPU utilization with rising p99 often indicates tail latency from stragglers or queuing effects, not just a slow kernel. Mention that you'd check for GPU memory fragmentation and CUDA context switching as subtle culprits.

1. Clarify the setup and metrics

Ask about the model, batch size, sequence length, GPU type, and how utilization and latency are measured. Confirm whether p99 is end-to-end or per-inference, and whether the workload is steady or bursty.

2. Identify the bottleneck layer

Check if the GPU is idle waiting for data (CPU preprocessing, I/O, network), or if kernels are inefficient (small ops, poor occupancy). Use profiling tools like Nsight Systems or PyTorch Profiler to see gaps and kernel durations.

3. Analyze tail latency sources

Investigate stragglers, queuing delays, memory fragmentation, or thermal throttling. Look at per-request latency distribution and GPU memory usage over time to spot spikes or leaks.

4. Propose tuning actions

Suggest concrete fixes: increase batch size or use dynamic batching, optimize data pipeline with prefetching and pinned memory, enable CUDA graphs, use mixed precision, or adjust kernel launch parameters.

5. Validate and iterate

Recommend A/B testing changes with controlled experiments, monitoring both utilization and p99 latency. Emphasize that tuning is iterative and should be guided by profiling data.

Key Points to Mention

  • Data loading bottleneck: CPU preprocessing, disk I/O, or network transfer starving the GPU.
  • Small kernel launches and launch overhead causing GPU idle time between operations.
  • Memory bandwidth saturation or memory fragmentation leading to inefficient GPU usage.
  • Stragglers in distributed training or inference causing tail latency spikes.
  • Queuing effects and batching strategies: dynamic batching can improve utilization but may increase latency if not tuned.
  • Profiling tools: Nsight Systems, PyTorch Profiler, nvidia-smi, and custom latency histograms.

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

Q6

A single tenant sends a burst of long-sequence requests that fill one length bucket. How does your design prevent this from starving other tenants?

System DesignTechnical Trade-offs
Author's notes

Per-tenant quota on queue slots per bucket was my answer.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging the problem: a single tenant's burst can monopolize a length bucket, starving others. Then describe a multi-layered defense: per-tenant quotas, fair queuing, and dynamic resource allocation to ensure isolation and fairness.

Pro tip: Emphasize that fairness must be enforced at multiple levels (admission, scheduling, and preemption) and that metrics like per-tenant latency and throughput are crucial for detecting and mitigating starvation.

1. Identify the bottleneck

Explain that the length bucket is a shared resource and a burst from one tenant can exhaust its capacity, causing head-of-line blocking for others.

2. Enforce per-tenant quotas

Describe how each tenant has a maximum number of concurrent requests or a rate limit per bucket, preventing any single tenant from consuming all resources.

3. Implement fair queuing

Use a scheduling algorithm like weighted fair queuing or deficit round-robin to allocate bucket capacity proportionally among active tenants, ensuring no tenant is starved.

4. Enable dynamic rebalancing

If a tenant is idle, allow others to borrow its share temporarily, but reclaim it when the tenant becomes active again, maintaining fairness over time.

5. Monitor and preempt

Continuously monitor per-tenant usage and latency; if starvation is detected, preempt or throttle the offending tenant's requests to restore fairness.

Key Points to Mention

  • Per-tenant rate limiting and concurrency caps
  • Fair queuing algorithms (e.g., WFQ, DRR) for proportional sharing
  • Work-conserving vs. non-work-conserving scheduling trade-offs
  • Dynamic quota adjustment based on tenant activity
  • Isolation mechanisms to prevent noisy neighbor effects
  • Metrics for detecting starvation (e.g., per-tenant latency, queue wait times)

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

Q7

A GPU worker crashes mid-batch. Which requests are affected, what do you retry, and why is retrying safe here?

System DesignTechnical Trade-offs
Author's notes

Inference is read-only so retrying is safe, no external state gets corrupted.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system architecture and failure model, then systematically identify affected requests based on batch composition and state. Explain the retry strategy with idempotency and safety guarantees, and justify why retries are safe in this context.

Pro tip: Emphasize that retries are safe only if operations are idempotent and side effects are managed; mention that you'd log and monitor retries to detect systemic issues, showing operational maturity.

1. Clarify the system and failure context

Ask questions to understand the GPU worker's role, batch processing model, and what 'crash' means (e.g., hardware failure, OOM, software bug).

2. Identify affected requests

Determine which requests were in the batch at the time of crash, considering in-flight vs. completed requests and any partial state.

3. Define retry strategy

Decide what to retry: likely the entire batch or only unacknowledged requests, depending on idempotency and checkpointing.

4. Explain safety of retries

Justify why retrying is safe: idempotent operations, no side effects, or deduplication mechanisms prevent duplicate processing.

5. Discuss monitoring and prevention

Mention logging retries, alerting on frequent crashes, and potential improvements like checkpointing or smaller batches.

Key Points to Mention

  • Idempotency of request processing to avoid duplicate side effects
  • Batch composition and how to track which requests were in-flight
  • Checkpointing or state management to resume from failure point
  • Retry policies: exponential backoff, max retries, and dead-letter queues
  • Isolation of failures to prevent cascading effects
  • Monitoring and alerting for retry attempts and crash patterns

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