Agents practice problems

21 problems · 0 solved

An LLM agent is a program that lets a language model decide which tool to call, reads the result, and repeats until the task is done. The model does the thinking, but plain code does the plumbing: parsing output, calling tools safely, and stopping at the right time. These problems focus on that plumbing. You will parse a ReAct action from model output, extract a JSON tool call from messy text, route a request to a tool by keyword score, detect a repeating tool-call loop, retry a flaky tool with exponential backoff, enforce token and dollar budgets, validate tool arguments against a schema, trim and compact chat history under a token budget, and schedule a task plan into parallel waves with cycle detection. Start with the Easy problems on parsing ReAct actions and trimming history. Then write the main tool-calling loop and the retry logic, and end with schema validation and plan scheduling. Teams building AI products spend most of their time on exactly this glue code, and interviews for applied LLM roles now ask you to write an agent loop that does not break or burn money.

Easy 8

Medium 6

Hard 7

Related topics

All practice problems