32Implement a resumable iterator with getState() and setState(), then make it span multiple files▼hardOpenAI1 replies◆ premiumAn OpenAI bank regular: next() over a list, then save/restore position, then resume across multiple JSON files where some are empty. The whole question is one decision (what counts as state) and most candidates get it wrong on part one.Open full answer →
61Write a generator that yields fixed-size batches from a large iterator for streaming inference.▼easyOpenAIAnthropicHugging Face1 replies◆ premiumBatching inputs is how you keep a GPU fed, but the source is an iterator you cannot index or len(). The warm-up that screens whether you can write a lazy generator that handles the ragged final batch.Open full answer →