← OpenAI Interview Insights

OpenAI·Mobile Engineer·Onsite - System Design / Architecture·Senior

SeniorPrefer not to say
Jun 2026

Summary

One round with OpenAI for a mobile engineer role, focused entirely on system design. The problem was meaty and had a lot of moving parts, which I wasn't fully ready for.

Questions Asked (1)

Q1

Design an API and mobile architecture for rate-limiting access to different AI model versions. When a user hits their limit, show a toast notification with the wait time until their next free access and a link to upgrade to a paid plan. Cover endpoint design, mobile-side patterns, and relevant function signatures.

System DesignAPI & IntegrationsTechnical Trade-offs
Author's notes

This was a lot to juggle at once.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by clarifying requirements (per-user, per-model limits, free vs paid tiers) and then design a REST API that returns rate-limit status in headers and a structured 429 response with retry-after and upgrade URL. On the mobile side, centralize API calls in a networking layer that intercepts 429s, parses the wait time, and triggers a toast with a deep link to the upgrade flow, while caching limits to avoid unnecessary requests.

Pro tip: Emphasize idempotency and graceful degradation: show the toast only once per limit hit and use exponential backoff with jitter for retries, but never block the UI thread—this demonstrates production maturity.

1. Clarify requirements and constraints

Ask about rate-limiting dimensions (per user, per model version, per tier), expected traffic, and whether limits are enforced client-side or server-side. Confirm the mobile platforms and offline behavior expectations.

2. Design the API contract

Define endpoints like GET /v1/models/{model_version}/access to check limits and POST /v1/completions with rate-limit headers (X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset). For 429 responses, include a JSON body with retry_after_seconds and upgrade_url.

3. Outline mobile architecture patterns

Propose a networking layer (e.g., URLSession with interceptors or Retrofit with OkHttp interceptors) that handles 429s globally, parses retry-after, and emits events to a rate-limit coordinator. Use a repository pattern to cache limits and a toast presenter that shows the message with a deep link.

4. Define key function signatures

Provide signatures for core functions: e.g., `func checkRateLimit(for modelVersion: String, completion: @escaping (RateLimitStatus) -> Void)` and `func handleRateLimitError(_ error: RateLimitError, in viewController: UIViewController)` that triggers the toast.

5. Discuss trade-offs and edge cases

Address clock skew, offline mode, toast frequency (debounce), and how to handle multiple concurrent requests hitting the limit. Mention using exponential backoff for retries and ensuring the upgrade link opens securely.

Key Points to Mention

  • Use standard HTTP status codes (429 Too Many Requests) and headers like Retry-After and X-RateLimit-* for clarity.
  • Include a machine-readable error body with fields like retry_after_seconds and upgrade_url to simplify client handling.
  • Centralize rate-limit handling in the networking layer to avoid duplicating logic across view controllers.
  • Cache rate-limit status locally to reduce API calls and provide immediate feedback when offline.
  • Debounce toast notifications to prevent spamming the user when multiple requests fail simultaneously.
  • Use deep linking or universal links for the upgrade flow to ensure a seamless transition to the payment page.

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