Resumable Iterator with Multi-Dimensional Support
Asked at OpenAI · Coding Questions · Difficulty: Medium · Last asked Jun 20, 2026
You need to build a system that can pause and restart a loop (iteration). You must be able to save your current spot and come back to it later. The problem starts easy and gets harder in four steps: defining the rules, making a simple list iterator, making a 2D iterator (matrix), and finally a 3D iterator. The main goal is to save the "state" (your position) so you can resume exactly where you left off.
Loading the problem…
More OpenAI interview questions
- Classifier Analysis
- Clean Noisy Human Labels by Scoring Annotator Reliability
- Two-Team Turn-Based Battle Simulator
- Backward Pass of a Row-Sharded MLP with all_gather
- Transformer Fundamentals: Attention, Positions and Normalization
- Debug a Mini GPT and Add a KV Cache