Mock-LLM Inference Engine — Dynamic Batching
Asked at xAI · Coding Questions · Difficulty: Hard · Last asked Dec 14, 2025
Implement a simplified inference-engine loop on top of a `model(batch) → next_tokens` API. The bar is dynamic batching: as sequences finish (max_tokens or stop-token), free their slots and fill them with new requests from a waiting queue, while keeping the slot↔request mapping correct so results never get crossed.
Loading the problem…