← Openai Interview Insights

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

SeniorPrefer not to say
Jun 2026

Summary

System design round at OpenAI for a software engineering role. The whole interview was basically one giant question about LLM inference infrastructure, and it went deep fast. Not a casual conversation.

Questions Asked (6)

Q1

Design a system that serves large language model inference requests at scale. Walk through the full request path from API gateway to model workers.

System DesignTechnical Trade-offs
Author's notes

I started with the API gateway and worked toward the GPU pool, covering auth, quota enforcement, and a request queue in between.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then walk through the request path layer by layer—API gateway, load balancing, batching/scheduling, model workers, and response streaming—highlighting key design decisions and trade-offs at each stage. Emphasize how you would handle latency, throughput, and cost constraints while ensuring reliability and scalability.

Pro tip: Focus on the unique challenges of LLM inference: variable request sizes, long generation times, and GPU memory constraints. Show you understand that batching and scheduling are critical for efficiency, and that streaming responses improve perceived latency.

1. Clarify Requirements and Scale

Ask about expected QPS, model sizes, latency SLOs, and cost constraints to frame the design. Establish whether the system is for real-time interactive use or batch processing.

2. Design the API Gateway and Load Balancing

Describe how requests enter the system: authentication, rate limiting, routing to appropriate model versions, and load balancing across workers. Mention the need for sticky sessions or consistent hashing for stateful models.

3. Implement Request Queuing and Batching

Explain how requests are queued and dynamically batched to maximize GPU utilization. Discuss trade-offs between batch size, latency, and throughput, and how to handle timeouts and prioritization.

4. Manage Model Workers and GPU Resources

Detail the model serving infrastructure: GPU workers, model loading, memory management, and autoscaling. Cover techniques like model parallelism, quantization, and caching to optimize performance.

5. Stream Responses and Handle Failures

Describe how to stream tokens back to the client, manage partial failures, and ensure reliability with retries and fallbacks. Discuss monitoring and observability for performance tuning.

Key Points to Mention

  • Dynamic batching and continuous batching to improve GPU utilization and throughput.
  • Trade-offs between latency and throughput, and how to meet SLOs with prioritization and admission control.
  • GPU memory management, model parallelism, and quantization techniques to fit large models.
  • Streaming responses (e.g., server-sent events) to reduce perceived latency for long generations.
  • Autoscaling and load balancing strategies for heterogeneous GPU workers.
  • Caching of common prompts or KV cache reuse to avoid redundant computation.

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

Q2

How would you implement batching to keep GPU utilization high while still meeting per-request latency targets like time-to-first-token and time-per-output-token?

System DesignTechnical Trade-offs
Author's notes

Continuous batching was the answer they were clearly fishing for.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the core tension between maximizing GPU utilization through larger batches and meeting strict per-request latency targets like TTFT and TPOT. Then describe a continuous batching system with dynamic batch sizing, prioritization, and preemption, and explain how you would tune and monitor it to balance throughput and latency.

Pro tip: Emphasize that latency targets are per-request SLOs, not just averages—design for tail latency by using techniques like chunked prefill and selective batching, and always validate with real traffic patterns.

1. Clarify requirements and constraints

Ask about the specific latency targets (e.g., p99 TTFT < 200ms, TPOT < 50ms), traffic patterns, and hardware. This shows you understand that batching strategies depend on concrete SLOs and workload characteristics.

2. Choose a batching strategy

Propose continuous batching (iteration-level scheduling) over static batching, as it allows new requests to join mid-flight and finished requests to leave, keeping the GPU busy without waiting for the slowest request.

3. Implement dynamic batch sizing and scheduling

Describe how to dynamically adjust batch size based on current load and latency headroom, using a scheduler that prioritizes requests to meet TTFT and TPOT targets, potentially with preemption for high-priority requests.

4. Optimize with advanced techniques

Mention techniques like chunked prefill to interleave prefill and decode phases, selective batching for operations with different compute characteristics, and memory management (e.g., PagedAttention) to reduce fragmentation and allow larger batches.

5. Monitor, tune, and validate

Explain how you would instrument the system to track GPU utilization, TTFT, TPOT, and tail latencies, then use that data to tune batch size limits, scheduling policies, and preemption thresholds to meet SLOs under varying load.

Key Points to Mention

  • Continuous batching (iteration-level scheduling) vs. static batching
  • Dynamic batch sizing based on latency headroom and queue depth
  • Chunked prefill to avoid head-of-line blocking and improve TTFT
  • Prioritization and preemption to meet per-request SLOs
  • Memory management techniques (e.g., PagedAttention) to support larger batches
  • Monitoring and tuning for tail latency, not just averages

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

Q3

What latency optimization techniques would you apply to an LLM serving stack?

System DesignTechnical Trade-offs
Author's notes

I listed KV-cache reuse, prefix caching, speculative decoding, and quantization.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing latency as a multi-layered problem across the serving stack, then walk through optimizations at each layer (model, system, and network) while highlighting trade-offs. Emphasize that the best approach depends on workload characteristics and SLAs, and mention how you would measure and iterate.

Pro tip: Quantify the impact of each technique with metrics like TTFT and TPOT, and discuss how you'd balance latency against throughput and cost—showing you understand real-world constraints at OpenAI's scale.

1. Define latency metrics and goals

Clarify what latency means in this context (e.g., time-to-first-token, time-per-output-token) and establish target SLAs based on use case. This sets the foundation for prioritizing optimizations.

2. Optimize at the model level

Discuss model architecture and inference optimizations such as quantization, pruning, distillation, and kernel fusion. Mention techniques like speculative decoding and KV cache management.

3. Optimize at the system level

Cover batching strategies (continuous batching, dynamic batching), scheduling, and hardware acceleration (GPU/TPU utilization, tensor parallelism). Include memory management and caching.

4. Optimize at the network and deployment level

Address network latency with edge deployment, CDNs, and efficient protocols (gRPC, HTTP/2). Discuss load balancing, autoscaling, and geo-distribution.

5. Measure, iterate, and trade off

Explain how you would instrument the stack, run A/B tests, and balance latency against throughput, cost, and accuracy. Highlight the importance of continuous profiling.

Key Points to Mention

  • Continuous batching and dynamic batching to maximize GPU utilization without sacrificing latency.
  • Quantization (e.g., FP16, INT8) and model compression techniques to reduce compute and memory footprint.
  • KV cache optimization and paged attention to handle long contexts efficiently.
  • Speculative decoding and parallel sampling to reduce per-token latency.
  • Hardware-aware optimizations: tensor parallelism, pipeline parallelism, and using faster interconnects (NVLink).
  • Caching strategies: prompt caching, embedding caching, and response caching at various layers.

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

Q4

How would you scale the GPU pool and manage costs, including mixing on-demand and spot instances and routing across multiple models?

System DesignTechnical Trade-offs
Author's notes

Talked through autoscaling based on queue depth and GPU utilization metrics, then got into spot instance interruption handling.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the workload characteristics and SLOs, then propose a multi-tier GPU pool with autoscaling, mixing on-demand for baseline and spot for burst, and a routing layer that directs requests to the most cost-effective model variant. Emphasize trade-offs between cost, latency, and reliability, and how you'd monitor and adjust dynamically.

Pro tip: Quantify the cost savings from spot instances and model routing (e.g., 'spot can cut costs 60-70% for fault-tolerant workloads') and mention how you'd handle spot interruptions gracefully with checkpointing and fallback to on-demand.

1. Clarify requirements and constraints

Ask about workload types (training vs inference), latency SLOs, fault tolerance, and budget. This determines the mix of instance types and routing policies.

2. Design a multi-tier GPU pool

Propose a pool with on-demand instances for baseline capacity and spot instances for elastic burst. Use autoscaling groups and consider reserved instances for steady-state.

3. Implement intelligent routing

Route requests across multiple models (e.g., different sizes or versions) based on cost, latency, and accuracy requirements. Use a load balancer with health checks and fallback logic.

4. Handle spot interruptions and failures

Design for graceful degradation: checkpoint long-running jobs, drain spot instances, and automatically shift traffic to on-demand or other regions.

5. Monitor, optimize, and iterate

Set up cost and performance dashboards, track spot savings and interruption rates, and continuously tune the routing and scaling policies.

Key Points to Mention

  • Use of spot instances for fault-tolerant workloads with checkpointing and graceful shutdown
  • Autoscaling policies based on queue depth, GPU utilization, and request latency
  • Model routing based on cost, latency, and accuracy trade-offs (e.g., canary or A/B testing)
  • Multi-region deployment to mitigate spot capacity shortages and improve latency
  • Cost monitoring and chargeback per team or model to drive accountability
  • Fallback mechanisms to on-demand or smaller models when spot capacity is unavailable

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

Q5

How do you handle reliability concerns like overload, cascading failures, and multi-region availability in an LLM serving system?

System DesignTechnical Trade-offs
Author's notes

Load shedding and circuit breakers I covered fine.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Structure your answer around the three concerns—overload, cascading failures, and multi-region availability—and for each, describe detection, mitigation, and trade-offs. Emphasize that LLM serving has unique constraints like long-running requests and GPU scarcity, so reliability strategies must adapt accordingly. Conclude by discussing how you'd validate these mechanisms through chaos testing and monitoring.

Pro tip: Frame reliability as a product requirement: tie each mechanism to user-facing SLOs (e.g., p99 latency, error rate) and explain how you'd measure and alert on them. This shows you think beyond infrastructure to customer impact.

1. Clarify requirements and constraints

Ask about expected traffic patterns, latency SLOs, cost constraints, and whether the system is multi-tenant. This ensures your answer is tailored to the actual scale and priorities.

2. Address overload

Discuss admission control (e.g., token bucket, concurrency limits), request prioritization, and graceful degradation (e.g., shorter max tokens, smaller models). Mention autoscaling with GPU-aware metrics.

3. Prevent cascading failures

Explain circuit breakers, timeouts, retries with jitter, and bulkheads to isolate failures. Highlight the need for backpressure and load shedding to avoid retry storms.

4. Ensure multi-region availability

Describe active-active or active-passive setups, data replication for model weights and caches, and global load balancing with health checks. Discuss failover strategies and consistency trade-offs.

5. Validate and iterate

Mention chaos engineering, load testing, and observability (metrics, tracing, logging) to continuously validate reliability. Emphasize learning from incidents and refining mechanisms.

Key Points to Mention

  • Admission control and rate limiting to prevent overload, with GPU-specific autoscaling.
  • Circuit breakers, timeouts, and retries with exponential backoff and jitter to avoid cascading failures.
  • Bulkhead isolation and load shedding to contain failures and protect critical paths.
  • Multi-region deployment with active-active or active-passive failover, and data replication strategies.
  • Observability: SLOs, monitoring, tracing, and alerting for early detection of reliability issues.
  • Chaos engineering and load testing to validate resilience under realistic failure scenarios.

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

Q6

What observability would you build into this system and how do you think about the cost tradeoffs of different monitoring approaches?

System DesignProduct Analytics & Metrics
Author's notes

Shorter exchange than the rest.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system's critical user journeys and failure modes, then propose a layered observability stack (metrics, logs, traces, and product analytics) tailored to those needs. Explicitly discuss cost tradeoffs by comparing sampling, aggregation, retention, and tooling choices, and tie them back to business impact and SLOs.

Pro tip: Emphasize that observability should be driven by SLOs and error budgets, not by collecting everything—this shows you understand cost discipline and prioritization. Also, mention that you'd start with high-level metrics and progressively add granularity only when debugging requires it.

1. Clarify system and goals

Ask questions to understand the system's architecture, critical user journeys, and business objectives. Identify key SLOs and potential failure points to focus observability efforts.

2. Propose a layered observability stack

Outline the four pillars: metrics (for alerting and dashboards), logs (for detailed debugging), traces (for request flow and latency), and product analytics (for user behavior). Explain how each layer addresses different needs.

3. Discuss cost tradeoffs

Compare costs of different approaches: e.g., high-cardinality metrics vs. logs, sampling rates for traces, retention periods, and managed vs. self-hosted solutions. Highlight the tradeoff between granularity and cost.

4. Prioritize and iterate

Explain how you'd start with essential metrics and alerts, then add more detailed observability as needed. Emphasize using SLOs to decide what to monitor and when to invest more.

5. Tie back to business impact

Connect observability choices to business outcomes: faster incident resolution, better user experience, and cost efficiency. Show how you'd measure the ROI of observability investments.

Key Points to Mention

  • The three pillars of observability: metrics, logs, and traces, plus product analytics for user-centric insights.
  • SLOs and error budgets as drivers for what to monitor and alert on.
  • Cost tradeoffs: sampling (e.g., trace sampling, log sampling), aggregation, retention policies, and cardinality control.
  • Use of open-source vs. commercial tools (e.g., Prometheus, OpenTelemetry, Datadog) and their cost implications.
  • The importance of high-cardinality data for debugging but its cost, and strategies to mitigate (e.g., dynamic sampling).
  • Iterative approach: start simple, add complexity only when justified by debugging needs or business value.

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