Swap a Text Game's Heuristics for LLM Calls
Problem statement
How would you replace a terminal adventure game’s NPC heuristics with language-model calls? The game must still run end to end, using its existing legal-action rules and state updates. A model client is provided, and the interviewer expects you to understand, check and explain the implementation.
Handle model replies safely, diagnose a stalled call and implement the NPC policy.
Show hint
Before writing code, find the single place where heuristic decisions flow into the game loop and what goes in and out there.
Relevant roles: ML Engineer, AI Engineer, Agentic AI Engineer and Forward Deployed Engineer.