← Openai Interview Insights

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

SeniorPrefer not to say
May 2026

Summary

System design round at OpenAI for a software engineering role, focused entirely on designing a GPU job scheduler for a text-to-video generation service. Pretty deep dive, multiple parts, and the follow-ups got increasingly brutal toward the end.

Questions Asked (10)

Q1

Walk through the full request lifecycle for a long-running GPU generation job: how does a submission get accepted, where does it wait, how does it get dispatched to a worker, and how does the client get status and results back?

System DesignTechnical Trade-offs
Author's notes

This is the foundation question and I spent probably too long here.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the scope and assumptions (e.g., expected job duration, scale, and reliability requirements). Then walk through the lifecycle in chronological order: submission, queuing, dispatch, execution, and status/result retrieval. Emphasize trade-offs and design choices at each stage, such as queueing strategy, worker selection, and status update mechanisms.

Pro tip: Show awareness of real-world constraints like GPU scarcity, job preemption, and cost optimization. Mention how you would handle failures and ensure idempotency, as these are critical in production systems.

1. Submission and Validation

Describe how a client submits a job via an API endpoint, including authentication, request validation, and job ID generation. Mention any initial checks like resource quotas or parameter validation.

2. Queuing and Persistence

Explain where the job waits: a durable queue (e.g., Kafka, SQS) or database-backed queue. Discuss prioritization, fairness, and how jobs are persisted to survive failures.

3. Dispatch and Scheduling

Cover how a scheduler picks jobs and assigns them to available GPU workers, considering factors like GPU type, locality, and current load. Mention worker registration and heartbeat mechanisms.

4. Execution and Monitoring

Describe how the worker executes the job, reports progress, and handles failures (e.g., retries, timeouts). Include how intermediate status is updated.

5. Status and Result Retrieval

Explain how the client polls or subscribes for status updates and retrieves results (e.g., via webhooks, polling, or streaming). Discuss result storage and access control.

Key Points to Mention

  • Use of a message queue for decoupling and load leveling
  • Scheduler design for GPU allocation and bin packing
  • Worker health checks and fault tolerance (e.g., retries, dead letter queues)
  • Status update mechanisms: polling vs. push notifications
  • Result storage in object storage (e.g., S3) with signed URLs
  • Idempotency and exactly-once semantics for job submission and execution

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

Q2

How do you design the scheduling policy across multiple user tiers with different SLOs, while making sure no tier gets completely starved under sustained load?

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

Strict priority was the obvious wrong answer and I knew that going in, so I jumped to weighted fair queuing pretty fast.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the tiers, their SLOs, and the workload characteristics. Then propose a hierarchical scheduling architecture that combines strict priority for latency-sensitive tiers with fair-share or weighted fair queuing for lower tiers, and explicitly address starvation prevention through mechanisms like aging, borrowing, or reserved capacity. Finally, discuss trade-offs and how you would validate the design under sustained load.

Pro tip: Emphasize that starvation prevention is not just about fairness but also about meeting business SLIs for all tiers—show you understand that even best-effort tiers may have contractual or reputational implications. Mention concrete metrics like tail latency and starvation time bounds.

1. Clarify requirements and constraints

Ask about the number of tiers, their SLOs (e.g., latency, throughput), workload patterns, and whether tiers are internal or external. Confirm if preemption is allowed and what the cost of starvation is.

2. Choose a scheduling model

Propose a hierarchical scheduler: e.g., strict priority for the highest tier, weighted fair queuing (WFQ) or deficit round robin (DRR) for others. Explain how weights map to SLOs and capacity.

3. Design starvation prevention

Introduce mechanisms like aging (promoting long-waiting requests), borrowing (allowing lower tiers to use idle capacity from higher tiers), or reserved minimum shares. Ensure no tier is permanently blocked.

4. Analyze trade-offs and edge cases

Discuss how the design handles bursts, overload, and failures. Compare strict priority vs. fair sharing in terms of SLO attainment and complexity.

5. Validate and monitor

Propose simulation or load testing to verify SLOs and starvation bounds. Define metrics like per-tier latency percentiles, starvation duration, and fairness index to monitor in production.

Key Points to Mention

  • Hierarchical scheduling with strict priority for critical tiers and weighted fair queuing for others
  • Starvation prevention via aging, borrowing, or reserved capacity
  • Trade-offs between SLO attainment, fairness, and implementation complexity
  • Use of metrics like tail latency, starvation time, and fairness index
  • Handling of sustained overload and bursty traffic
  • Preemption and its impact on lower-tier requests

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

Q3

How do you enforce per-tier and per-customer quotas at admission so the scheduler isn't overwhelmed trying to be fair across traffic it should have rejected upstream?

System DesignAPI & Integrations
Author's notes

Answered this one pretty cleanly.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Frame the answer around a layered admission control system where quotas are enforced as early as possible (edge/gateway) using distributed counters and token buckets, with the scheduler only seeing traffic that has already passed quota checks. Emphasize that fairness is a scheduling concern only for admitted work, and that rejecting excess upstream protects the scheduler and improves overall system health.

Pro tip: Mention that quota enforcement must be fast, local, and eventually consistent—use approximate counters with periodic reconciliation rather than synchronous global locks, because a slow quota check is as bad as no quota check. Also note that you should return clear 429s with Retry-After headers so clients can back off intelligently.

1. Define quota dimensions and enforcement point

Identify the quota dimensions (per-tier, per-customer, maybe per-endpoint) and decide where to enforce them—ideally at the API gateway or a dedicated admission service before requests reach the scheduler. Explain that enforcing at admission prevents wasted scheduler cycles.

2. Choose a distributed rate-limiting algorithm

Select an algorithm like token bucket or sliding window with distributed counters (e.g., Redis or a local sidecar with gossip). Discuss trade-offs between strict global limits and approximate local limits with periodic sync.

3. Handle burst, priority, and fairness across tiers

Describe how to allow bursts for higher tiers (e.g., larger bucket sizes) and how to ensure lower tiers aren't starved. Mention that the scheduler can then apply fair queuing only among admitted requests, simplifying its job.

4. Design for failure and observability

Explain what happens if the quota service is unavailable—fail open or closed? Include metrics, logging, and alerting on quota rejections and near-limit usage. Also mention client feedback via 429 and Retry-After.

5. Scale and evolve the system

Discuss how to scale the quota enforcement horizontally, handle hot customers, and adjust quotas dynamically. Mention that quotas can be enforced at multiple layers (edge, service mesh) for defense in depth.

Key Points to Mention

  • Admission control vs. scheduling: quotas should reject before the scheduler, so the scheduler only deals with admitted work.
  • Distributed rate limiting with token buckets or sliding windows, using local counters with periodic reconciliation for low latency.
  • Per-tier and per-customer isolation: separate buckets and limits, with burst allowances for higher tiers.
  • Graceful degradation: fail-open vs. fail-closed policies, and how to avoid cascading failures if the quota store is down.
  • Client experience: return 429 Too Many Requests with Retry-After and clear error messages.
  • Observability: metrics on quota usage, rejections, and latency; alerting on anomalies.

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

Q4

When a high-priority job arrives and all GPUs are occupied, how do you decide which running job to preempt, and do you checkpoint it or just kill and restart?

System DesignTechnical Trade-offs
Author's notes

This is where the question got interesting.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the decision as a policy-driven trade-off between cluster utilization, job priority, and preemption cost. Then walk through a concrete decision framework: evaluate preemption cost (checkpoint availability, restart time), job priority and SLA, and resource fit. Finally, discuss checkpointing vs. kill-restart with attention to overhead, fault tolerance, and implementation details like checkpoint frequency and storage.

Pro tip: Emphasize that preemption decisions should be automated via a scheduler policy (e.g., priority preemption with checkpoint-aware eviction) rather than manual, and that checkpointing is usually worth the overhead for long-running jobs but not for short ones—quantify the trade-off with restart time vs. checkpoint time.

1. Define preemption policy and priorities

Establish clear job priority levels (e.g., high, medium, low) and preemption rules: only preempt lower-priority jobs, and prefer jobs that are cheapest to preempt. Consider fair-share or SLA-based policies.

2. Assess preemption cost of candidate jobs

For each running job, estimate the cost to preempt: does it have recent checkpoints? How long to restart from scratch? How much progress would be lost? Prefer jobs with low restart cost or recent checkpoints.

3. Decide checkpoint vs. kill-restart

If the job supports checkpointing and the checkpoint overhead is small relative to restart time, checkpoint then preempt. If checkpointing is expensive or the job is short, kill and restart later. Consider checkpoint frequency and storage I/O.

4. Implement graceful preemption with notification

Signal the job to checkpoint if needed, wait for completion (with timeout), then release resources. If timeout, force kill. Log the preemption event for auditing and future policy tuning.

5. Monitor and refine policy

Track metrics like preemption frequency, checkpoint overhead, and job restart times. Use this data to adjust preemption thresholds and checkpoint strategies to minimize overall cluster waste.

Key Points to Mention

  • Priority-based preemption: only preempt lower-priority jobs, and consider job age or fair-share to avoid starvation.
  • Checkpointing trade-offs: checkpoint overhead (CPU, I/O, storage) vs. restart cost (lost work, re-computation).
  • Checkpoint frequency: more frequent checkpoints reduce lost work but increase overhead; use adaptive checkpointing based on job runtime.
  • Graceful preemption: send SIGTERM or a custom signal to allow the job to checkpoint, with a timeout before SIGKILL.
  • Resource fit: ensure the preempted job's resources match the high-priority job's requirements (e.g., GPU memory, count).
  • Automation: implement preemption as a scheduler policy (e.g., in Kubernetes, Slurm, or custom scheduler) rather than manual intervention.

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

Q5

How do you allocate GPUs to multi-GPU jobs without causing fragmentation or leaving GPUs idle while a job waits for the rest of its allocation?

System DesignAlgorithms & Data Structures
Author's notes

Gang scheduling.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Frame the problem as a scheduling and resource management challenge, then propose a solution that combines gang scheduling with topology-aware placement and preemption. Emphasize the trade-offs between utilization, fairness, and job completion time, and how your design minimizes fragmentation and idle waiting.

Pro tip: Show awareness that perfect solutions are impossible; instead, focus on minimizing fragmentation and idle time through policies like backfilling and preemption, and mention how you would measure and iterate on these metrics in production.

1. Define the problem and constraints

Clarify the workload characteristics (job sizes, durations, GPU types, network topology) and the goals (maximize utilization, minimize fragmentation, ensure fairness).

2. Choose a scheduling strategy

Propose gang scheduling to allocate all GPUs for a job atomically, and consider backfilling to fill idle resources with smaller jobs that can complete before the large job's start time.

3. Implement placement and allocation policies

Use topology-aware placement to keep multi-GPU jobs within a single node or rack when possible, and employ bin-packing or best-fit algorithms to reduce fragmentation.

4. Handle waiting and preemption

Introduce preemption or checkpointing for low-priority jobs to free resources for large jobs, and use reservation or queueing mechanisms to avoid indefinite waiting.

5. Monitor and adapt

Track metrics like GPU utilization, job wait time, and fragmentation, and use them to tune scheduling parameters or switch strategies dynamically.

Key Points to Mention

  • Gang scheduling to prevent partial allocation and deadlock
  • Backfilling to utilize idle GPUs while a large job waits
  • Topology-aware placement to minimize communication overhead and fragmentation
  • Preemption and checkpointing to prioritize large jobs without wasting resources
  • Bin-packing or best-fit algorithms for efficient resource allocation
  • Metrics for evaluating scheduling effectiveness (utilization, wait time, fragmentation)

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

Q6

One enterprise customer suddenly submits 10,000 jobs at once. How do you protect other enterprise customers and lower tiers, and what does the offending customer actually experience?

System DesignTechnical Trade-offs
Author's notes

Per-customer quota cap within the enterprise tier.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the problem as multi-tenant resource isolation and fairness, then propose a layered defense: admission control, per-tenant quotas, and priority scheduling. Finally, describe the offending customer's experience, emphasizing transparency and graceful degradation rather than silent failure.

Pro tip: Mention that you would instrument and alert on per-tenant usage patterns to detect anomalies before they impact others, and that you'd communicate proactively with the offending customer about their quota limits and options.

1. Admission Control and Rate Limiting

Implement per-tenant rate limits and admission control at the API gateway to reject or queue excess requests before they consume backend resources.

2. Resource Quotas and Isolation

Enforce hard quotas on compute, memory, and concurrency per tenant, and use resource isolation (e.g., cgroups, separate queues) to prevent noisy neighbors.

3. Priority Scheduling and Fairness

Use weighted fair queuing or priority-based scheduling to ensure lower-tier customers still get their guaranteed share of resources.

4. Graceful Degradation and Backpressure

Apply backpressure to the offending tenant by throttling or queuing their jobs, while allowing critical or higher-priority jobs to proceed.

5. Customer Experience and Communication

The offending customer experiences slower processing, explicit rate-limit errors, or queued jobs with estimated wait times, plus proactive notifications and dashboards showing quota usage.

Key Points to Mention

  • Multi-tenancy and isolation techniques (e.g., namespaces, cgroups, separate queues)
  • Per-tenant quotas and rate limiting (token buckets, sliding windows)
  • Priority and fairness algorithms (weighted fair queuing, deficit round robin)
  • Backpressure and load shedding strategies
  • Observability: per-tenant metrics, alerting, and anomaly detection
  • Customer communication: transparent error messages, dashboards, and support outreach

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

Q7

If you wanted to add GPU fleet autoscaling, how does the multi-minute provisioning lag change your queuing and preemption strategy?

System DesignTechnical Trade-offs
Author's notes

Honestly caught me a bit flat-footed.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by acknowledging that multi-minute provisioning lag fundamentally shifts autoscaling from a reactive to a predictive problem, requiring queue-aware and preemption-aware policies. Then propose a two-tier strategy: short-term reactive scaling for burst absorption and long-term predictive scaling based on workload forecasts, with preemption used to reclaim capacity from low-priority jobs when demand spikes.

Pro tip: Emphasize that the goal is not to eliminate lag but to make the system resilient to it by decoupling job admission from resource availability—e.g., using a queue with deadlines and preemption to maintain utilization while meeting SLAs.

1. Characterize the lag and workload

Quantify the provisioning lag (e.g., 2-5 minutes) and analyze workload patterns (arrival rate, job duration, priority mix) to understand the impact on queueing and utilization.

2. Design a multi-tier queueing system

Implement priority queues with deadlines and preemption, where high-priority jobs can preempt lower-priority ones, and low-priority jobs fill gaps to maintain utilization.

3. Adopt predictive autoscaling

Use historical data and workload forecasts to pre-provision GPU capacity ahead of demand, reducing reliance on reactive scaling that suffers from lag.

4. Define preemption policies

Establish clear preemption rules: which jobs can be preempted, how to checkpoint and resume them, and how to avoid thrashing by limiting preemption frequency.

5. Monitor and adapt

Continuously monitor queue lengths, provisioning latency, and job success rates; adjust scaling thresholds and preemption aggressiveness based on feedback.

Key Points to Mention

  • Provisioning lag makes reactive autoscaling insufficient; predictive scaling is necessary.
  • Queueing strategy should prioritize jobs by deadline and preemptibility, not just FIFO.
  • Preemption must be safe: checkpointing and resumption mechanisms for preempted jobs.
  • Overprovisioning vs. underprovisioning trade-off: cost vs. SLA violations.
  • Use of spot instances or preemptible VMs to reduce cost, with fallback to on-demand.
  • Feedback loops: monitor lag and adjust scaling policies dynamically.

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

Q8

Your fleet has multiple GPU SKUs and some jobs only run on certain hardware. How does the scheduler handle job-to-hardware compatibility?

System DesignData Modeling
Author's notes

Short answer from me: tag jobs with hardware requirements at submission, tag GPUs with their SKU, and filter eligible GPUs before running the scheduling algorithm.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by framing the problem as a constraint-based scheduling challenge, where each job declares hardware requirements and the scheduler matches them to available GPU SKUs. Then describe a two-phase approach: first filtering nodes by compatibility (e.g., GPU model, memory, driver version), then scoring and selecting among compatible nodes based on utilization and other policies. Finally, discuss how to handle dynamic changes and failures to ensure jobs are rescheduled appropriately.

Pro tip: Emphasize that compatibility should be expressed as a declarative, extensible set of labels or taints/tolerations rather than hardcoded logic, so new GPU SKUs can be added without scheduler changes. Also mention that preemption and backfilling can improve utilization while respecting compatibility constraints.

1. Define hardware requirements and labels

Explain how jobs specify their hardware needs (e.g., GPU model, memory, compute capability) and how nodes are labeled with their GPU SKU attributes. This creates a declarative contract for compatibility.

2. Filter nodes by compatibility

Describe the filtering phase where the scheduler excludes nodes that don't match the job's requirements. This can be done via label selectors, taints/tolerations, or custom predicates.

3. Score and select among compatible nodes

After filtering, the scheduler scores remaining nodes based on factors like current utilization, locality, and fairness, then picks the best fit. This optimizes resource usage while respecting constraints.

4. Handle dynamic changes and failures

Discuss how the scheduler reacts to node failures, GPU errors, or changes in job requirements. This includes rescheduling jobs to compatible nodes and possibly preempting lower-priority jobs.

5. Monitor and evolve the system

Mention the importance of observability (metrics on scheduling latency, utilization per SKU) and the ability to extend the compatibility model as new hardware is added.

Key Points to Mention

  • Use of node labels and job annotations to declaratively express GPU SKU requirements (e.g., nvidia.com/gpu-model: A100).
  • Taints and tolerations or node affinity/anti-affinity to enforce compatibility and prevent scheduling on incompatible nodes.
  • Two-phase scheduling: filtering (hard constraints) then scoring (soft preferences) to balance compatibility and utilization.
  • Handling of heterogeneous clusters: mixing GPU SKUs, ensuring jobs are only placed on nodes that meet their needs.
  • Rescheduling and preemption strategies when nodes become unavailable or jobs fail due to hardware issues.
  • Extensibility: designing the compatibility model to easily incorporate new GPU types without modifying scheduler code.

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

Q9

Identical prompts and parameters come in repeatedly. How would you add result caching or deduplication, and what are the correctness and privacy risks?

System DesignTechnical Trade-offs
Author's notes

Cache key is a hash of prompt plus all generation parameters.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying the system context and requirements, then propose a caching/deduplication layer with a well-defined cache key and eviction policy. Discuss correctness risks like stale results and non-determinism, and privacy risks like cross-user data leakage, and explain how to mitigate them with TTLs, scoping, and encryption.

Pro tip: Emphasize that caching is a trade-off between latency/cost and correctness/privacy; show you can quantify the impact and propose safeguards like per-user cache scoping and audit logs.

1. Clarify requirements and constraints

Ask about the expected scale, latency requirements, and whether prompts may contain sensitive data. Determine if the system is multi-tenant and what compliance requirements exist.

2. Design the cache key and storage

Define a cache key that includes the prompt, parameters, model version, and user/tenant ID to avoid cross-contamination. Choose a storage layer (e.g., Redis, Memcached) with appropriate TTL and eviction policies.

3. Implement deduplication and caching logic

Use a request coalescing mechanism to deduplicate identical in-flight requests. For caching, check the cache before processing and store results after completion, ensuring atomicity and consistency.

4. Identify and mitigate correctness risks

Address risks like stale results (use TTL and invalidation), non-deterministic outputs (include model version and temperature in key), and cache poisoning (validate inputs and outputs).

5. Address privacy and security risks

Scope caches per user/tenant, encrypt sensitive data at rest, and implement access controls. Consider data retention policies and the right to be forgotten (e.g., cache invalidation on user deletion).

Key Points to Mention

  • Cache key composition: prompt, parameters, model version, user/tenant ID
  • TTL and eviction policies to balance freshness and hit rate
  • Request coalescing for deduplication of concurrent identical requests
  • Correctness risks: stale data, non-determinism, cache poisoning
  • Privacy risks: cross-user leakage, data retention, encryption
  • Monitoring and metrics: hit rate, latency, error rates, and cache invalidation triggers

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

Q10

How do you keep the scheduler itself highly available, and what prevents a job from being dispatched to two workers simultaneously after a scheduler crash?

System DesignTechnical Trade-offs
Author's notes

Distributed lock or a compare-and-swap on job state before dispatch.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by explaining the general architecture for scheduler high availability, such as active-passive or leader election with a distributed consensus system. Then, dive into the specific mechanisms that prevent duplicate job dispatch, like distributed locks, idempotency, and exactly-once semantics. Emphasize trade-offs between consistency, availability, and complexity.

Pro tip: Mention that true exactly-once dispatch is impossible in distributed systems, so you design for at-least-once with idempotent workers and deduplication. This shows you understand the theoretical limits and practical workarounds.

1. Scheduler HA Architecture

Describe how the scheduler itself is made highly available, e.g., using a leader election protocol (Raft, Paxos) with a distributed store like etcd or ZooKeeper, or a multi-active design with partitioning.

2. Job Dispatch Protocol

Explain the protocol for dispatching jobs: the scheduler assigns a job to a worker by writing to a durable queue or database, and the worker acknowledges completion. This ensures the job state is persisted before dispatch.

3. Preventing Duplicate Dispatch

Detail mechanisms to prevent a job from being dispatched twice after a crash: distributed locks, leases with timeouts, idempotent job execution, and deduplication using unique job IDs.

4. Failure Recovery

Describe how the system recovers from a scheduler crash: a new leader is elected, it reads the persisted state, and resumes dispatching jobs that are not yet completed, while ensuring no duplicates via the mechanisms above.

5. Trade-offs and Guarantees

Discuss the trade-offs between consistency, availability, and latency, and clarify the guarantees provided (e.g., at-least-once with idempotency vs. exactly-once).

Key Points to Mention

  • Leader election with consensus algorithms (Raft, Paxos) for scheduler HA
  • Distributed locks or leases with timeouts to prevent concurrent dispatch
  • Idempotent job execution and deduplication using unique job IDs
  • Persistent job state in a durable store (database, queue) before dispatch
  • At-least-once delivery with idempotency as a practical alternative to exactly-once
  • Trade-offs: consistency vs. availability, complexity vs. reliability

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