← 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 engineer role, centered on a single meaty problem about credit accounting for GPU jobs. The question had a lot of moving parts and I think I handled the basics okay but stumbled when they pushed on concurrency and scheduling extensions.

Questions Asked (1)

Q1

Design a GPU credit accounting system where users have balances, jobs consume credits based on GPU type and duration, and the system supports granting/refunding credits, reserving credits at job start, deducting on completion, rejecting jobs with insufficient funds, and reporting per-user usage.

System DesignData ModelingTechnical Trade-offs
Author's notes

I started with the data model, which felt natural: a users table with a balance column, a reservations table keyed on job ID, and a usage log for reporting.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements and scale, then design a data model with user balances and a ledger for auditability. Propose a two-phase commit-like flow: reserve credits at job start, deduct on completion, and handle failures with refunds. Discuss trade-offs between consistency, latency, and complexity.

Pro tip: Emphasize idempotency and atomicity in credit operations to prevent double-spending or lost refunds, especially in distributed systems. Mention that using a ledger (append-only log) simplifies auditing and reconciliation.

1. Clarify Requirements and Scale

Ask about expected QPS, number of users, job types, and consistency requirements. Determine if real-time balance updates are needed or if eventual consistency is acceptable.

2. Design Data Model

Propose tables for users (balance), jobs (status, GPU type, duration, cost), and a ledger for credit transactions. Consider using a relational database for ACID guarantees.

3. Define Credit Operations

Outline APIs for granting, reserving, deducting, refunding, and reporting. Ensure each operation is idempotent and atomic, using transactions or distributed locks.

4. Handle Job Lifecycle

Describe the flow: job submission checks balance, reserves credits, runs job, then deducts or refunds based on outcome. Include error handling for insufficient funds and job failures.

5. Address Scalability and Trade-offs

Discuss partitioning, caching, and asynchronous processing. Compare strong vs. eventual consistency, and how to handle concurrent reservations.

Key Points to Mention

  • Idempotency keys for credit operations to prevent duplicate charges/refunds
  • Atomic transactions or distributed locks for balance updates
  • Ledger-based accounting for auditability and reconciliation
  • Reservation pattern to avoid overspending during job execution
  • Handling of job failures and automatic refunds
  • Reporting: aggregating usage per user, possibly with materialized views or batch jobs

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