Dayward AI

Interview Bank

328 questions total; 1 shown with current filters.

Tag
136 more tags
#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#prompt-engineering2#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#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

From Frontend Engineer to Agent Engineer in 30 Days

D1 LLM API Basics: messages/roles, Tokens, Streaming, Temperature; What an Agent Actually Is

  • What do temperature and top_p control, and when would you use 0 versus 0.7?temperature 和 top_p 分别控制什么?什么场景用 0,什么场景用 0.7?
    Common overseasBasic#llm-basics#sampling

    How to reason about it · think before answering

    1. Establish that both act on the same next-token distribution but in different ways — that is the discriminator.
    2. temperature rescales the whole distribution; top_p truncates it to the smallest set reaching cumulative probability p.
    3. Hence the practical rule: tune one, not both, or you cannot attribute a regression.
    4. Choose by reproducibility, not by vibes: tool arguments, classification and structured output must be reproducible, so use 0.
    5. Add the agent angle: planning and tool-calling steps stay cold; only the final user-facing prose warrants higher values.

    分析过程 · 先想清楚再作答

    1. 先说清两者作用在同一个地方——模型算出的下一个 token 概率分布——但作用方式不同,这是区分度所在。
    2. temperature 是缩放整个分布:越低越尖锐、越确定;top_p 是截断——只保留累计概率达到 p 的那一小圈候选再采样。
    3. 由此推出实践建议:一般只调其中一个,两个同时调会互相干扰,出了问题分不清是谁造成的。
    4. 选值不按「创意程度」凭感觉,按「这一步的输出要不要可复现」来定:工具参数、分类判断、结构化输出必须可复现,用 0。
    5. 补一句 Agent 视角:Agent 的规划与工具调用环节几乎都用低温,只有最终面向用户的自然语言回复才考虑调高。

    Key points

    • temperature rescales the next-token distribution: lower is more deterministic, higher more random
    • top_p samples only from the smallest set whose cumulative probability reaches p; tune one, not both
    • Use ~0 for structured output, tool arguments and classification to keep results reproducible
    • Use 0.7–1.0 for creative writing; planning steps in production agents usually stay low

    答题要点

    • temperature 缩放下一个 token 的概率分布:越低越确定,越高越随机
    • top_p 只从累计概率达到 p 的候选里采样,是另一种截断随机性的方式;一般只调其中一个
    • 结构化输出、工具参数、分类判断用 0 或接近 0,保证可复现
    • 创意写作、头脑风暴用 0.7–1.0;生产 Agent 的规划步骤通常也偏低温