面试题库
共 328 题,当前筛选 2 题。
课程全部30 天从前端工程师到 Agent 工程师5 天提示词工程零基础Claude 高效使用:从对话到 Claude CodeCodex 与 OpenAI Agents SDK 高效使用7 天 MCP:把工具接进任何 Agent7 天 Agent Skills:把经验做成可复用能力5 天上下文工程14 天 RAG:从检索到可信回答14 天用 Agent 搭一条 AI 短剧生产线
标签
全部#prompt-engineering2#reliability22#cost15#architecture12#streaming11#security10#observability9#distributed-systems8#idempotency8#multi-agent8#rag7#system-design7
还有 136 个标签收起标签
#api-design6#operations6#sse6#deployment5#message-bus5#tool-calling5#agent-loop4#behavioral4#error-handling4#evaluation4#framework-design4#mcp4#routing4#concurrency3#context-engineering3#interview-prep3#langgraph3#llm-basics3#model-routing3#orchestration3#prompt-injection3#protocol3#redis-streams3#scalability3#scheduling3#agent-design2#auth2#checkpointing2#communication2#cost-control2#database2#debugging2#interview-process2#latency2#long-term-memory2#memory2#ordering2#rate-limiting2#react2#resume2#retrieval2#sharding2#state-machine2#state-management2#tool-design2#tool-permissions2#trade-offs2#ux2#agent-basics1#agent-quality1#async1#atomicity1#cancellation1#capacity-planning1#career1#chunking1#compression1#configuration1#consistent-hashing1#context1#context-compression1#context-management1#correctness1#customer-support1#data-modeling1#deliberate-practice1#docker1#documentation1#engineering-tradeoffs1#escalation1#event-driven1#fallback1#fan-out1#fencing-token1#forking1#framework-selection1#frontend1#global-market1#hybrid-search1#interrupt-merge1#isolation1#json-parsing1#jwt1#knowledge-organization1#lease1#least-privilege1#llm-as-judge1#loop-guard1#mobile1#multi-tenancy1#nodejs1#performance1#persistence1#pgvector1#portfolio1#prioritization1#proactive-messaging1#product-engineering1#project-storytelling1#prompt1#provider-abstraction1#quiet-hours1#ranking1#recall1#reconnect1#redis1#reflection1#replay1#reporting1#rerank1#retrieval-quality1#retry1#retry-semantics1#rrf1#sampling1#sandboxing1#schema-design1#secrets-management1#self-assessment1#self-introduction1#self-presentation1#service-architecture1#session-management1#split-brain1#star1#stateless1#storytelling1#structured-output1#system-prompt1#testing1#timezone1#tool-execution1#tools1#tracing1#transport1#vector-database1
30 天从前端工程师到 Agent 工程师
D4 模型接入与系统提示词:多 provider 抽象与 fallback、覆盖默认人设(dg P03/P04/M04)
系统提示词(system prompt)在 Agent 里起什么作用?为什么不能用框架默认的?What does the system prompt do in an agent, and why not rely on the framework default?
国内高频海外高频进阶#prompt-engineering#system-prompt分析过程 · 先想清楚再作答
- 前半句是送分题,后半句才是区分度所在——很多人答得出 system prompt 是干什么的,答不出「默认值有什么坑」。
- 先说作用:它是唯一一段在整段对话里权重稳定、不会被后续几十轮稀释的指令,用来设定身份、能力边界和输出格式。
- 再答「为什么不能用默认的」,要给出三条具体后果而不是泛泛说「不够定制」:一是它不知道你的业务边界,用户问业务外的问题它会热情地答;二是它不约束输出格式,前端样式会被冷不丁冒出的 Markdown 标题打乱;三是最要命的——它会随框架升级而变化,你测好的所有行为建立在一段看不见的文本上,出 bug 时你的代码一行没动,极难排查。
- 结论落到工程做法:生产环境的 system prompt 是拼出来的模板,结构是「人设 + 能力边界 + 输出要求 + 动态上下文」,最后一块每次请求现拼。
- 可以预期的追问:动态上下文里最容易漏什么?答「当前时间」——模型没有时钟,不告诉它今天几号,它算不出「三天前下的单」是哪天。这个细节很能体现有没有真做过。
- 第二个追问:prompt 怎么测试?答案是把它当配置而不是代码——存库、加版本号、支持按比例灰度,因为你没法写单元测试断言「模型语气变友好了」。
How to reason about it · think before answering
- The first half is a warm-up; the discriminating half is why the default is dangerous.
- State the role: it is the one instruction block whose weight stays stable across dozens of turns, setting identity, capability boundaries and output format.
- Then give three concrete consequences rather than 'not customized enough': it does not know your business boundary so it happily answers off-topic questions; it does not constrain output format so stray Markdown headings break your UI; and worst, it changes when the framework updates — your tested behavior rests on invisible text, and the bug appears with zero code changes.
- Land on practice: a production system prompt is assembled from a template — persona, capability boundary, output requirements, dynamic context — with the last part rebuilt per request.
- Expect: what gets forgotten in dynamic context? The current time. Models have no clock; without today's date they cannot resolve 'the order I placed three days ago'.
- Second follow-up: how do you test a prompt? Treat it as configuration, not code — store it, version it, roll it out to a percentage, because you cannot unit-test 'the tone got friendlier'.
答题要点
- system prompt 设定身份、能力边界与输出格式,是对话里权重最稳定、不被后续轮次稀释的一段指令
- 框架默认人设不知道你的业务边界,会热情回答业务外的问题,浪费 token 且跑题
- 默认人设不约束输出格式,模型可能吐出 Markdown 标题打乱前端样式
- 最危险的是默认值会随框架升级而变化,代码一行没动却出现行为回归,极难排查
- 生产做法:显式拼模板(人设 + 能力边界 + 输出要求 + 动态上下文),当作配置存储、加版本号、可灰度
Key points
- The system prompt sets identity, capability boundaries and output format, and keeps stable weight across turns
- A default persona does not know your business boundary and will cheerfully answer off-topic questions
- It does not constrain formatting, so stray Markdown can break your UI
- Most dangerous: defaults change on framework upgrades, producing behavior regressions with no code change
- Production practice: assemble it explicitly, treat it as versioned configuration, and roll changes out gradually
D5 工具系统与事件驱动:参数校验、错误回传让模型自纠错、事件订阅(dg P05/P06/M05/M07)
设计 Agent 的工具时你会遵循哪些原则?名字、描述、参数分别该怎么写?What principles do you follow when designing tools for an agent — how do you write the name, the description and the parameter schema?
国内高频海外高频基础#tool-design#prompt-engineering分析过程 · 先想清楚再作答
- 这题的区分度在于你把工具描述当成什么。当成函数注释的人会答「写清楚做什么」,当成提示词的人才会答到点子上——描述会原样进入模型的上下文,参与「该不该调、参数填什么」的判断,它的读者是模型不是同事。
- 拆成三件事分别说:名字要动词加宾语(query_order 而不是 handler2),因为名字是模型的第一道筛选;描述最有价值的一句不是「做什么」而是「什么时候不该用它」,把边界写进去能砍掉一大半误用;参数里每个字段都要有自己的 description,格式类字段还要给一个合法示例——模型对「订单号」没有概念,看到 SO20260901 这个样例,填对的概率会陡增。
- 接着给出一条几乎没人主动说的成本判断:工具定义每一轮都会被完整重发,一个写得扎实的工具约 100 到 150 token,挂 20 个就是每轮两三千 token 的固定开销。所以「工具越多越强」是错的,只挂当前场景用得上的那几个。
- 再补一条可迁移的工程判断:工具改名或改语义是破坏性变更,等价于换了个工具——调好的提示词会失效,历史会话的 messages 里还留着旧名字,恢复旧会话时模型会去调一个不存在的工具。所以改工具要像改公开 API 一样走版本与灰度。
- 可以预期的追问:几十上百个工具怎么办?答案是先用一轮便宜模型做工具检索,只把最相关的几个塞进正式请求,而不是一股脑全挂上。
How to reason about it · think before answering
- The discriminator is what you think a tool description is. People who treat it as a docstring answer 'describe what it does'; people who treat it as part of the prompt get it right — the description goes verbatim into the model's context and drives both tool selection and argument filling. Its reader is the model, not your teammate.
- Split it into three: names read like commands (query_order, not handler2) because the name is the model's first filter; the most valuable sentence in a description is not what the tool does but when NOT to use it, which removes most misrouting; and every parameter needs its own description plus a concrete example for format-shaped fields — a model has no notion of 'order id', but SO20260901 makes it far more likely to get it right.
- Then raise the cost point most candidates miss: tool definitions are resent in full every turn. A well-written tool runs 100 to 150 tokens, so twenty of them is a fixed two- to three-thousand-token tax per turn. More tools is not more capable — only mount what the current scenario needs.
- Add a transferable engineering judgment: renaming a tool or silently widening its semantics is a breaking change. Tuned prompts stop working, and old sessions still carry the old name in messages, so resuming one makes the model call a tool that no longer exists. Version and roll out tool changes the way you would a public API.
- Expect the follow-up: what about dozens or hundreds of tools? Retrieve tools with a cheap model first and mount only the top few, rather than shipping the whole catalog every turn.
答题要点
- 工具定义是提示词的一部分,读者是模型:它只能看到名字、描述、参数 schema,看不到你的实现
- 名字用动词加宾语;描述里最值钱的是「什么时候不该用它」;每个参数都要有 description,格式类字段给一个合法示例
- 工具定义每轮完整重发,20 个工具就是每轮固定两千多 token,只挂当前场景用得上的
- 改名或改语义等于换工具,会让调好的提示词失效、让旧会话调到不存在的工具,要走版本与灰度
- 工具规模上去之后,先用便宜模型做工具检索再挂载最相关的几个
Key points
- A tool definition is part of the prompt; the model only sees name, description and parameter schema
- Name it verb plus object; the most valuable line in a description is when not to use it; every parameter needs a description, and format fields need a concrete example
- Definitions are resent every turn, so twenty tools is a fixed two- to three-thousand-token tax — mount only what the scenario needs
- Renaming or redefining a tool is a breaking change that invalidates tuned prompts and breaks resumed sessions
- At scale, retrieve the relevant tools with a cheap model before mounting them