Agent loops: workflows vs agents
- Agents
- Asked in most interview loops
- About 2 h to learn
- 5 vetted resources
What this topic covers
An agent is a model running in a loop: it reasons about the goal, calls a tool, reads the result, and repeats until it decides it is done. A workflow is the same building blocks wired along a fixed code path (chain, route, fan-out, orchestrate, evaluate-and-retry) where the program, not the model, decides the next step. Interviewers ask you to draw the loop, say what the stopping condition is, explain when a fixed workflow beats an autonomous agent (cost, latency, predictability), and name failure modes such as runaway loops, bad tool results fed back as truth, and no guardrails on side effects. Expect a follow-up on how ReAct-style thought/action/observation traces make the loop inspectable.
You’re ready when you can
What interviewers check, from the resources below.
- Explain why tool descriptions deserve as much prompt work as the main prompt
- Give two ways to make a tool harder to misuse (poka-yoke), e.g. absolute paths
- Choose an input format the model can produce reliably and justify it
- Describe how you'd test a tool definition before shipping it
- Draw the thought → action → observation loop and state its stopping condition
- Explain the difference between chain-of-thought and ReAct in one sentence
- Describe where the loop's rules live (system prompt) and what the model actually emits at each step
- Compare chain-of-thought, tree-of-thoughts and outsourcing planning to an external planner
- Explain how ReAct and Reflexion let an agent correct itself after a failed action
- List three reasons agents fail in practice (finite context, long-horizon planning, unreliable natural-language interfaces)
What to study, in order
Each link opened and checked by hand; the date says when.
Start here
Building effective agents (opens in a new tab)
Anthropic Engineering · Erik S., Barry Zhang · 25 min · Free · checked 21 Oct 2026
- Why
- Gives you the vocabulary for tool design questions (“how would you design the tools for this agent?”) that separates builders from API callers.
- What to read
- Read “Building block: The augmented LLM” and “Appendix 2: Prompt engineering your tools”; skim “When (and when not) to use agents”.
- What to skip
- The workflow patterns (prompt chaining through evaluator-optimizer) and “Appendix 1: Agents in practice”, which belong to the agent-patterns topic.
Free alternative
Understanding AI Agents through the Thought-Action-Observation Cycle (opens in a new tab)
Hugging Face Agents Course · Hugging Face · 20 min · Free · checked 21 Oct 2026
- Why
- The shortest clean explanation of the loop every agent framework hides; it gives you the three-word vocabulary (thought, action, observation) interviewers expect you to use on the whiteboard.
- What to read
- Read “The Core Components” through “Alfred, the weather Agent”, then continue to the next lesson and read “ReAct: Reasoning + Acting” and “Comparison: ReAct vs. CoT”.
- What to skip
- The emoji-heavy list of thought types on the next page and the smolagents build that follows; the framework code is not what gets asked.
Go deeper
LLM Powered Autonomous Agents (opens in a new tab)
Lil'Log · Lilian Weng · 45 min · Free · checked 21 Oct 2026
- Why
- Still the reference map of agent components (planning, memory, tools); senior interviewers borrow its vocabulary when they ask how you would decompose a task or let an agent recover from a bad step.
- What to read
- Read “Agent System Overview”, then “Component One: Planning” (both “Task Decomposition” and “Self-Reflection”), then “Component Three: Tool Use” and “Challenges”.
- What to skip
- “Component Two: Memory” (the MIPS/ANN survey overlaps with vector-search topics) and the “Case Studies”; the post is from mid-2023, so the tool-use methods predate native function calling.
Go deeper
ReAct: Synergizing Reasoning and Acting in Language Models (opens in a new tab)
arXiv · Shunyu Yao et al. · 35 min · Free · checked 22 Oct 2026
- Why
- The thought, action, observation loop in almost every agent framework comes from ReAct, and interviewers expect you to explain it and its failure modes.
- What to read
- Read §2 with Figure 1 (the interleaved trace format), §3.2 on the methods compared (CoT, act-only, ReAct and the CoT-SC combinations) and §3.3 results. Then read Appendix E.1 on success and failure modes.
- What to skip
- Skip §4’s ALFWorld and WebShop details beyond the main table, §5 related work and the full trajectories in Appendix D.
Go deeper
smolagents (opens in a new tab)
GitHub · huggingface · 45 min · Free · checked 22 Oct 2026
- Why
- smolagents keeps its whole agent loop in one file of under 1,000 lines, so it’s the quickest way to see a ReAct loop, tool calling and code-as-action agents for real.
- What to read
- Read the README’s “Quick demo”, “How do Code agents work?” and “Security” sections. Then open src/smolagents/agents.py: MultiStepAgent.run and _run_stream (the loop and step limit), and the _step_stream methods of ToolCallingAgent and CodeAgent. Glance at memory.py for how steps become chat messages. Run the quick demo with a model you have access to.
- What to skip
- Skip Hub sharing, the CLI section, the open-model benchmark section and the remote-executor integrations beyond knowing they exist.
Companies that test Agents most
Put Agent loops in your plan
Tell us your interview date and hours a day; it lands on the right day, in the right order.