Openai Interview Questions
Practice the exact questions companies are asking right now.
Design a sandboxed cloud IDE
System design: Sandboxed cloud IDE (Colab-like) Design a multi-tenant, browser-based cloud IDE/notebook that lets users run code in an isolated sandbo...
Explain KV cache in Transformer inference
Question In Transformer-based language model inference, what is a key-value (KV) cache? Explain: - What gets cached (tensors, shapes at a high level) ...
Implement an in-memory SQL-like table
Problem Implement a simple in-memory database for one table. All values are strings. Each row is identified by a rowKey (string). Each row contains co...
Design a distributed crossword fill solver
Scenario You are building a service that fills a crossword-like grid with words. - The board size is not specified; assume a medium board around 50×50...
Implement credit ledger with out-of-order timestamps
Problem You are implementing a GPU credit ledger that supports adding credits, charging credits, and querying balances. Requests can arrive in any tim...
Design a RAG system with evaluation
Scenario You are asked to design a Retrieval-Augmented Generation (RAG) system that answers user questions using a private corpus (e.g., internal docs...
Implement toy-language types and generic substitution
Problem: Toy Language Type System (Printing + Generic Resolution) You are implementing a small type system for a custom “Toy Language”. Types can be: ...
Implement a memory allocator with malloc/free
Problem You are implementing a simplified memory allocator over a contiguous memory region. Initialize the allocator with a fixed total size: - alloca...
Simulate turn-based monster team battle
Design an object-oriented model and implement the core battle logic for a turn-based fight between two teams of monsters. The system should simulate t...
Compute time to infect all cells
You are given an n × m grid representing people in a city. - Each cell is either infected (1) or healthy (0). - Two cells are neighbors if they share ...
Implement a persistent sharded key-value store
Problem Implement a simple key–value store that persists data on disk. You must store the data in fixed-size shards, where each shard is saved in one ...
Design a payment processing system
Scenario Design a backend payment system for an online product that supports: - One-time charges and refunds. - Idempotent payment APIs (clients may r...
Refactor a chat message processing function
Task You are given a poorly written JavaScript function that processes an incoming chat message and updates an in-memory store. The code is hard to re...
Answer project deep dive and cross-functional questions
Behavioral / leadership round prompts You’re asked to cover some or all of the following: 1. Technical deep dive presentation - Prepare a short sli...
Implement map serialization and deserialization
You are given an in-memory map (dictionary) from strings to strings. Implement two functions: - string serialize(map<string, string> m) - map<string, ...
Debug and fix a PyTorch Transformer training loop
Minimal Causal LM Debugging and Optimization Context You are given a tiny causal decoder-only language model implemented in PyTorch. It appears to "tr...
Implement IPv4 iterators and CIDR expansion
Problem: IPv4 Iterators and CIDR Expansion You are implementing utilities to iterate over IPv4 addresses. An IPv4 address is in dotted-decimal form: A...
Design a CI/CD system with stuck-job handling
Scenario Design a CI/CD platform similar to GitHub Actions/Jenkins that: - Triggers pipelines on events (e.g., push/PR/merge). - Runs pipelines as a D...
Design a CI/CD system with live log streaming
System Design Prompt: CI/CD Platform (shell-script jobs) Design a CI/CD system that can: 1. Allow users to define pipelines consisting of multiple job...
How would you build an image classifier with dirty data?
Scenario You are asked to build an image classification model (single-label, multi-class) for a product team. The image dataset is known to be dirty (...