A Tencent Interviewer's Agent Architecture Grilling, Answered from a Real CLI Implementation
Agent interviews at major Chinese tech firms now test implementation details, not just definitions. Candidates who can trace every concept—ReAct, MCP, memory eviction, streaming tool-call assembly—to a real codebase stand out, and the bar is shifting from "used a framework" to "designed the control loop."
The interview opens with the boundary between LLMs and agents: the model decides, the framework executes, and the difference is whether a closed loop of decision-action-observation exists. From there, the candidate breaks down a ReAct agent into five concrete modules—model client, tool registry, executor, loop control, and context management—and walks through the full execution flow, including streaming parameter reassembly and a 20-turn hard limit.
Deeper questions probe the architecture of a from-scratch agent framework (six layers, with security as a first-class concern), the relationship between MCP and local tools (unified registry, namespace isolation, and virtual tools for resources), and a three-tier memory system spanning session, project, and global scopes. The candidate details compression triggers, deduplication, TTL-based expiration, and a hard rule that model-generated summaries never graduate to long-term memory.
Skill loading gets a quantified defense: a progressive disclosure mechanism keeps only a 4000-character index resident, loading full skill bodies on demand, which cuts context cost by 25x versus eager loading. The quality-assurance answer layers post-write syntax checks, a reviewer agent with retries, and prompt-level acceptance criteria—while openly admitting what hasn't been built yet.
Streaming tool-call parameter reassembly is a concrete failure mode that framework users rarely see but that every builder must handle; a half-arrived JSON fragment crashes the executor.
The hard separation between compression-generated summaries and long-term memory is a design choice with real consequences. Without it, the model's own paraphrasing gradually pollutes the knowledge base.
Quantifying the Skill loading mechanism—25x context savings—turns a design pattern into a defensible engineering decision, which is exactly what interviewers want to hear.
Admitting what isn't built yet (hooks, structured output validation, auto-retry) while detailing what is built signals engineering maturity more than pretending completeness.
The interviewer's closing study checklist is itself a syllabus: prefix caching economics, temperature/structured prompting, RAG chunking and hybrid search—all mapped to Claude Code's open-source ecosystem as a reference implementation.