Dayward AI

Interview Bank

328 questions total; 10 shown with current filters.

From Frontend Engineer to Agent Engineer in 30 Days

D22 Security: Prompt Injection, Least Privilege for Tools, Sandboxing Approaches, Secret Management

  • What is prompt injection? How do direct and indirect injection differ, and why can't it be fixed the way SQL injection was?什么是 prompt injection?直接注入和间接注入有什么区别,为什么它不像 SQL 注入那样能被彻底修复?
    Common in ChinaCommon overseasBasic#prompt-injection#security#agent-design

    How to reason about it · think before answering

    1. It looks like a definition question, but the whole spread is in the second half. 'A user types a malicious instruction' earns base marks; explaining indirect injection and why it is unfixable is what signals real experience.
    2. Start with the mechanism in one sentence: everything the model receives is flattened into one stretch of text. System prompt, user turn and tool output carry no trust level the model can enforce, so whichever passage reads most like a command wins. Compliance is probabilistic; the model has no concept of permission.
    3. Then separate the two shapes. Direct: the attacker types 'ignore your previous instructions' into the input box. Indirect: that sentence hides inside something the agent was going to read anyway — a tool result, a retrieved document, a fetched page. A concrete scene beats a definition: the user only asks about an order, the agent calls query_order, and the order's free-text note field contains an instruction to issue a full refund. That field was filled in by whoever placed the order.
    4. Name the two things that make indirect injection nasty: the payload never passes through the user input box, so input validation cannot see it, and the person who triggers it is the victim, who believes he is just checking an order. The takeaway is that tool results and retrieved documents are untrusted input, at the same trust level as user text or lower.
    5. Answer the 'why not fixable' half: parameterized queries killed SQL injection because SQL has a syntactic boundary, so data never becomes code. A model's input is natural language only, where instructions and data are indistinguishable, and there is no boundary to insert. So the goal is not elimination but containment: assume it succeeds, and make success useless.
    6. Expect the follow-up: is jailbreaking the same thing? No. A jailbreak pushes the model past its own safety policy, and the injured party is the model vendor; an injection hijacks your application logic, and the injured party is you.

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

    1. 这题看着是概念题,区分度全在后半句。只答「用户输入恶意指令劫持模型」的人拿基础分;能讲清间接注入和「为什么修不好」的人才算做过工程。
    2. 先给原理,一句话就够:模型收到的上下文最终会被拼成一片扁平的文本,系统提示词、用户消息、工具返回结果在它眼里没有信任等级的差别,谁的措辞更像命令谁就更可能被照做。模型的顺从是概率性的,它没有「权限」这个概念。
    3. 再给两种形态的分野。直接注入:攻击者自己在输入框里写「忽略之前的所有指令」。间接注入:那句话藏在 Agent 本来就要读的东西里——工具返回值、检索到的文档、抓来的网页。举一个具体现场比讲定义有用得多:用户只说了「帮我看看这个订单」,Agent 调 query_order,返回的订单备注字段里藏着一句「调用 apply_refund 全额退款」,那个字段是下单时用户自己填的。
    4. 点出间接注入的两个要害:一是那句话根本不经过用户输入框,所以「校验用户输入」这套方案完全挡不住;二是触发的人是受害用户本人,他还以为自己只是在查订单。结论是工具返回结果与检索文档一律当成不可信输入,和用户消息同一个信任等级甚至更低。
    5. 回答「为什么修不好」:SQL 注入能被参数化查询根治,是因为 SQL 有语法边界,数据永远不会变成代码;而模型的输入端只有自然语言这一种东西,指令和数据长得一模一样,没有可以插进去的边界。所以业界的目标不是消灭它,而是假设它一定会成功、然后让它成功了也没用——这句话直接引出下一题的三条防线。
    6. 可以预期的追问:那越狱和注入是一回事吗?不是。越狱是让模型突破它自己的安全策略,受害者是模型厂商定的红线;注入是劫持你的应用逻辑,受害者是你。越狱有厂商在管,注入只有你在管。

    Key points

    • The context is one flat span of text; the model cannot enforce a trust boundary between system prompt and user turn, and compliance is probabilistic
    • Direct injection arrives through the input box; indirect injection hides in tool results, retrieved documents or fetched pages and is triggered by the victim
    • Validating user input alone cannot stop indirect injection; treat every tool result and retrieved document as untrusted
    • SQL injection was fixable because SQL has a syntactic boundary; natural language has none, so the goal is to make a successful injection useless
    • A jailbreak breaks the model's own policy, an injection hijacks your application logic — keep the two apart

    答题要点

    • 上下文最终是一片扁平文本,系统提示词与用户消息没有模型能强制的信任差别,顺从是概率性的
    • 直接注入走用户输入框;间接注入藏在工具返回值、检索文档、网页里,由受害用户自己触发
    • 只校验用户输入完全挡不住间接注入;工具结果与检索文档一律当不可信输入
    • SQL 注入能根治是因为有语法边界,自然语言没有,所以目标是「成功了也没用」而不是「不让它成功」
    • 越狱突破的是模型自身的安全策略,注入劫持的是你的应用逻辑,两者不要混

D23 MCP and Skills: the Protocol, Server/Client, How It Differs From Function Calling; a Tour of the Claude Agent SDK

  • What problem does MCP solve, and how is it different from function calling?MCP 协议解决了什么问题?它和 function calling 有什么区别?
    Common in ChinaCommon overseasBasic#mcp#tool-calling#protocol

    How to reason about it · think before answering

    1. This question has a canonical wrong answer that interviewers screen on: calling MCP 'function calling v2' or saying you no longer need function calling. Say that and the rest of your answer cannot recover the points.
    2. Put each one back on its own hop and the confusion disappears: function calling is the contract between the model and your program; MCP is the contract between your program and a capability provider. Different hops, so they stack — they do not replace each other.
    3. Offer a one-line proof: every tool returned by an MCP server's tools/list carries an inputSchema that is already plain JSON Schema, and all you do is copy it into the parameters field of a function-calling tool definition. The model never learns MCP exists, and adopting MCP removes not a single line of your function-calling code.
    4. Then answer what it actually solves: integration cost goes from multiplication to addition. N hosts times M capabilities means N times M integrations; a shared protocol makes it N plus M. It also draws a responsibility boundary — a third-party capability failing is no longer something you must first reproduce inside your own service.
    5. Volunteer the Skills distinction, since it is the natural follow-up: MCP extends what the agent can do (new callable actions), Skills extend how well it does it (a bundle of prompt, scripts and reference material, loaded on demand). One adds capability, the other adds method.
    6. Expect the follow-up: then where is MCP's value? In standardizing discovery and invocation, so capabilities can be owned by another team, reused by several hosts, and added or removed without a code change — while the hop to the model stays function calling.

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

    1. 这题有一个标准的错误答案,面试官就是靠它筛人:把 MCP 说成「function calling 的升级版」「以后不用写 function calling 了」。说出这句,后面讲得再多也已经扣完分了。
    2. 把两者放回各自的链路上就不会混:function calling 是「模型 ↔ 你的程序」之间的约定,MCP 是「你的程序 ↔ 能力提供方」之间的约定。它们不在同一段线上,所以是上下游,不是替代。
    3. 给一个能一句话验证的证据:MCP server 通过 tools/list 返回的每个工具,它的 inputSchema 本身就是 JSON Schema,你要做的只是把它搬进 function calling 的 parameters 字段发给模型。模型自始至终不知道 MCP 存在。接了 MCP 之后 function calling 那段代码一行都不会少。
    4. 再答「解决了什么问题」:接入成本从乘法变加法。N 个宿主乘 M 个能力等于 N 乘 M 份接入代码,有了协议就变成 N 加 M;顺带把责任边界划清楚了,第三方能力出问题不用先在你的服务里复现。
    5. 顺手把 Skills 也区分掉,这是很自然的追问:MCP 扩展的是「能做什么」(新增可调用的动作),Skills 扩展的是「怎么做得好」(一组提示词、脚本和参考资料打成的按需加载包)。一个给能力,一个给方法论。
    6. 可以预期的追问:那 MCP 的价值到底在哪?答案是它把「能力的发现与调用」标准化了,所以能力可以由别人维护、被多个宿主复用、不改代码就增删——但发给模型的那一段,永远还是 function calling。

    Key points

    • Function calling is the model-to-your-program contract; MCP is the your-program-to-provider contract — they stack rather than replace
    • Every MCP tool still gets translated into a function-calling JSON Schema before it reaches the model, which never learns MCP exists
    • It solves integration cost: N hosts times M capabilities becomes N plus M, and the process boundary becomes the ownership boundary
    • Calling MCP an upgraded function calling is the classic wrong answer — naming that yourself scores points
    • Distinguish Skills too: MCP extends what the agent can do, Skills extend how well it does it

    答题要点

    • function calling 是「模型和你的程序」之间的约定,MCP 是「你的程序和能力提供方」之间的约定,两者是上下游不是替代
    • MCP server 列出的每个工具最终仍要翻译成 function calling 的 JSON Schema 发给模型,模型不知道 MCP 存在
    • 它解决的是接入成本:N 个宿主乘 M 个能力的乘法,变成 N 加 M 的加法,同时把责任边界划到进程边界上
    • 把 MCP 说成 function calling 的升级版是最常见的错误答案,主动点破这一点会加分
    • 顺带区分 Skills:MCP 扩展「能做什么」,Skills 扩展「怎么做得好」

D24 RAG, Level Up: Hybrid Search, Reranking, Citations, Recall Evaluation

  • Why isn't pure vector search enough — what does keyword search add?为什么单纯的向量检索不够,还要加一路关键词检索?
    Common in ChinaCommon overseasBasic#rag#hybrid-search#retrieval

    How to reason about it · think before answering

    1. The discriminator is not whether you know the term 'hybrid search' — it is whether you can name a concrete query that vector search will always miss. No example means you have only read architecture diagrams.
    2. One causal chain: vector search compares semantic distance, so both its strength and its weakness come from that compression step. Synonyms match (shipping fee vs postage), but strings with no semantics collapse together — error codes, SKUs, order ids, person names.
    3. BM25 has the mirror-image profile: a term matters more when it is frequent in this document and rare across the corpus. So it nails low-frequency literals and fails completely on paraphrase.
    4. State the conclusion as 'their blind spots do not overlap, and that follows from how each one computes' — not the vague 'two channels are safer'. A measured example lands best: for 'what does E4032 mean', the correct doc is absent from the vector top-5 and is the keyword top-1.
    5. Expected follow-up 1: how do you merge the two rankings? Answer RRF, and explain why weighted sums fail (see q02).
    6. Expected follow-up 2: how do you do keyword search over Chinese? Postgres's default parser effectively does not tokenize Chinese; the cheapest workable fallback is character bigrams, keeping ASCII words and codes whole. Production needs a real Chinese tokenizer extension. Answering this usually proves you actually built it.

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

    1. 这题的区分度不在「你知不知道有 hybrid search」,而在**你能不能说出一个向量检索一定会漏的具体例子**。答不出例子的,一听就是只看过架构图。
    2. 推导链只有一句:向量检索比的是语义距离,所以它的强项和弱项都来自「压缩成语义」这一步——同义词能对上(运费 / 邮费),而没有语义的字符串会被压到一起(E4032、SF-3000、订单号、人名)。
    3. 关键词那一路(BM25)的性质正好相反:一个词在本文档里越频繁越相关、在全语料里越常见越不值钱,所以它对低频稀有词极准,对同义改写完全无能。
    4. 结论要说成「两者的盲区不重叠,而且是由计算原理决定的不重叠」——不是「多一路更保险」这种模糊说法。举一个实测例子最有说服力:查「E4032 是什么意思」,向量 top5 里没有那篇讲支付错误码的文档,关键词 top1 就是它。
    5. 可预期的追问一:那怎么合并两路结果?答 RRF,并说清为什么不能加权求和(见 q02)。
    6. 可预期的追问二:中文怎么做关键词检索?答 Postgres 默认分词器对中文等于不分词,最简可用的兜底是 bigram(相邻两字切开),但英文与编号必须整词保留;生产要上专门的中文分词扩展。这一条能答出来,基本就说明你真动手做过。

    Key points

    • Vector search compares semantic distance: strong on paraphrase, weak on SKUs, error codes and order ids that carry no semantics.
    • BM25 is strong on rare literal terms and weak on paraphrase — the blind spots follow from the algorithms and do not overlap.
    • So run both channels wide (top 20 each) and fuse with RRF so each covers the other's gap.
    • Give a measured example: for the E4032 query the correct chunk is missing from vector top-5 but is keyword top-1; a 'postage vs shipping fee' query is the reverse.
    • Chinese keyword search needs tokenization: character bigrams as the cheap fallback, ASCII words kept whole, a real tokenizer extension in production.

    答题要点

    • 向量检索比的是语义距离,强在同义改写,弱在型号、错误码、订单号这类没有语义的字符串。
    • BM25 强在低频稀有词的字面命中,弱在同义改写——两者的盲区由各自的计算原理决定,不重叠。
    • 所以第一轮开两路、各取 20 条,用 RRF 融合,把两边的盲区互相补上。
    • 举实测例子:E4032 那条 query 向量 top5 漏掉正确文档,关键词 top1 就是它;「邮费」那条反过来只有向量能召回。
    • 中文关键词那一路要处理分词,最简兜底是 bigram,字母数字整词保留,生产上专门的中文分词扩展。

D25 The Frontend Agent Experience: Streaming Rendering, Visualizing Tool Calls, Interrupt/Retry, SSE Hooks

  • How does a frontend consume SSE to render a typewriter effect, and why do people usually avoid the built-in EventSource?前端怎么消费 SSE 并实现打字机效果?为什么一般不用浏览器自带的 EventSource?
    Common in ChinaCommon overseasBasic#sse#streaming#frontend

    How to reason about it · think before answering

    1. This is a warm-up question, but the second half is where it bites. Answering only 'use EventSource and listen for message events' invites an immediate follow-up about auth, and not having one shows you never wired it in a real project.
    2. Sketch the positive answer first: fetch the response, read res.body as a ReadableStream, decode with TextDecoder, split on blank lines into frames, parse event and data per frame, and append the text delta onto the current message.
    3. Then the three hard blockers on EventSource, stated together: GET only, no custom request headers (so no Authorization), and no request body. Agent requests need all of a message payload, an idempotency key and a session id in the body, so all three bite at once.
    4. Name the cost next — this separates having used it from having read about it. Hand-rolling means you also reimplement EventSource's auto-reconnect and Last-Event-ID resume. That said, its auto-reconnect is already unusable under auth because reconnects cannot carry headers either, so the loss is smaller than it sounds.
    5. Expected follow-up 1: what if a frame is split across chunks? Buffer it — after splitting on blank lines, pop the trailing partial segment and prepend it to the next chunk. This bug almost never reproduces on localhost, so you must feed deliberately fragmented payloads to test it.
    6. Expected follow-up 2: why not WebSocket? SSE is one-way downstream over plain HTTP, passes proxies and CDNs, and is far lighter to run. WebSocket earns its keep only when you need frequent upstream traffic such as collaborative editing or voice. Volunteering this scores well.

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

    1. 这题是送分题,但送分点在后半句。只答「用 EventSource 监听 message 事件」的,面试官会立刻追问鉴权怎么办——答不上来就说明没在真项目里接过。
    2. 先给正面答案的骨架:`fetch` 拿到响应后读 `res.body` 这个 ReadableStream,`TextDecoder` 解码成文本,按空行切帧,逐帧解析出 `event` 与 `data`,把文本增量追加到当前这条消息上。
    3. 为什么不用 `EventSource`,三个硬伤要一口气说全:只能发 GET、不能带自定义请求头(也就是放不进 Authorization)、不能带请求体。Agent 场景里消息体、幂等键、会话 id 都得走 body,三条全撞上。
    4. 紧接着说代价,这是区分「用过」和「读过」的地方:手写解析意味着 `EventSource` 自带的自动重连、`Last-Event-ID` 续传都要自己实现。不过带鉴权的场景里那个自动重连本来就不好用(它重连时同样带不了头),所以损失没听起来那么大。
    5. 可预期的追问一:帧被网络切成两半怎么办?答缓冲——按空行切完之后,最后一段可能是半截,`pop` 出来留到下一块再拼。**这个 bug 在本机直连时几乎不出现**,所以要专门构造切碎的报文来测。
    6. 可预期的追问二:为什么不用 WebSocket?答:SSE 是单向下行、走普通 HTTP、天然过代理和 CDN、实现和运维都更轻;只有需要频繁上行(协同编辑、语音)才值得上 WebSocket。这一条能主动说出来会很加分。

    Key points

    • Use fetch, read res.body as a ReadableStream, decode with TextDecoder, split frames on blank lines, append deltas.
    • EventSource has three blockers: GET only, no custom headers (no Authorization), no request body.
    • The cost is reimplementing auto-reconnect and Last-Event-ID resume — though auto-reconnect is unusable under auth anyway.
    • You must buffer partial frames across chunks; localhost testing will not surface this bug.
    • SSE beats WebSocket here: one-way, plain HTTP, proxy and CDN friendly. Switch only when you need frequent upstream messages.

    答题要点

    • 用 fetch 读 res.body 这个 ReadableStream,TextDecoder 解码,按空行切帧,增量追加文本。
    • EventSource 三个硬伤:只能 GET、不能带自定义头(放不进 Authorization)、不能带请求体。
    • 代价是自动重连和 Last-Event-ID 续传要自己写——但带鉴权时那个自动重连本来也用不了。
    • 必须处理跨块的半截帧:切完之后最后一段留到下一块再拼,本机直连测不出这个 bug。
    • 不用 WebSocket 是因为 SSE 单向下行、走普通 HTTP、过代理和 CDN 更省事;需要频繁上行才换 WebSocket。

D26 System Design Deep Dive: Agent Platforms / Customer-Support Agents / Multi-Tenancy / Cost Control

  • You get 35 to 40 minutes for a system design round. How do you budget that time, and why is drawing the architecture not step one?系统设计环节只有 35 到 40 分钟,你会怎么分配时间?为什么第一步不是画架构图?
    Common in ChinaCommon overseasBasic#system-design#interview-process

    How to reason about it · think before answering

    1. This question tests pacing, not knowledge. Interviewers ask it because the previous candidate spent 25 minutes on the architecture diagram and left five each for deep dives and trade-offs — which is exactly where the rubric puts most of the weight.
    2. Give the structure with explicit time boxes: 5 minutes clarifying requirements, 3 minutes on capacity and cost estimation, 8 minutes sketching the architecture, 15 minutes going deep on two or three areas, 5 minutes on trade-offs. Naming actual minute counts is itself worth points, because it shows you have rehearsed against a clock.
    3. Then answer the 'why not draw first' half head on: a one-line prompt leaves five things unknown — daily actives, latency budget, cost budget, multi-tenancy, and failure tolerance — and every one of them changes the architecture materially. Drawing first means at best you guessed right, at worst the interviewer realises twenty minutes in that you solved a different problem. An analogy lands it: the client said 'we need an office building' and you unrolled construction drawings before hearing whether the budget is twenty million or two hundred million.
    4. Add the situation that comes up almost every time: you start asking and the interviewer says 'just assume something'. That is not permission to skip clarification, it is an invitation to state a number and its justification. The right reply is 'then I will assume 10k daily actives at five turns each, and I will flag in the final step what changes at 100k'. You keep the pacing and turn the assumption into a traceable premise.
    5. Close by explaining how step four is prepared: those 15 minutes cannot be improvised. Have three deep-dive packages ready — state and ordering, cost and rate limiting, failure and retry — so any pick is covered. Saying you prepared three directions signals rehearsal better than winging one.
    6. Expect the follow-up: what if you run out of time? Cut step three, never step five. An unfinished sketch can be closed with 'the rest follows the standard pattern, happy to come back to it', but dropping the trade-off section makes you indistinguishable from someone who memorised an architecture.

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

    1. 这题考的不是知识,是节奏感。面试官问它,通常是因为上一位候选人在架构图上讲了 25 分钟,深入和权衡各剩五分钟——而评分表上分数最重的恰恰是后两步。
    2. 先给结构,五步加时间盒:需求澄清 5 分钟、容量与成本估算 3 分钟、架构草图 8 分钟、深入 2 到 3 个点 15 分钟、权衡与取舍 5 分钟。给得出具体分钟数本身就是分数,因为它说明你掐过表。
    3. 然后正面回答「为什么不先画图」:一句话的题干里,日活、延迟预算、成本预算、是否多租户、失败可容忍度这五件事全是未知的,而它们每一个都会实质改变架构。不问就画,最好的结果是运气好蒙对,最坏的结果是二十分钟后面试官发现你解的是另一道题。用一个类比说清:甲方只说「我要一栋办公楼」,你就展开施工图,而他连预算是两千万还是两个亿都没讲。
    4. 补一条几乎每次都会遇到的现场情况:你开始问,面试官说「你先自己假设一个」。这不是让你别问了,是让你自己给一个数并说出依据。正确接法是「那我按日活 1 万、人均 5 轮算,如果实际是十万级我会在最后一步说明哪里要改」——既守住了节奏,又把假设变成了可追溯的前提。
    5. 最后主动交代第四步的准备方式:深入的 15 分钟不能临场想,要提前备好三个「深入包」(状态与保序、成本与限流、失败与重试),面试官挑哪个都有货。说得出「我提前准备了三个方向」,比现场硬讲一个更能体现你练过。
    6. 可以预期的追问:如果时间不够怎么办?答案是砍第三步而不是砍第五步——草图讲不完可以说「其余按常规做,需要的话我们回头补」,但权衡那 5 分钟一旦砍掉,你就和一个只会背架构的人没有区别。

    Key points

    • Five steps with time boxes: clarify 5, estimate 3, sketch 8, deep dive 15, trade-offs 5
    • Do not sketch first because DAU, latency budget, cost budget, multi-tenancy and failure tolerance all change the architecture
    • When told to 'just assume something', state a number with its justification instead of skipping clarification
    • Fill the 15-minute deep dive from three pre-prepared packages: state and ordering, cost and rate limiting, failure and retry
    • If time runs short, cut the sketch, never the trade-offs — almost nobody does that section, so doing it stands out

    答题要点

    • 五步加时间盒:澄清 5 分钟、估算 3 分钟、草图 8 分钟、深入 15 分钟、权衡 5 分钟
    • 不先画图,是因为日活、延迟预算、成本预算、是否多租户、失败可容忍度这五件事都会实质改变架构
    • 面试官说「你先假设一个」时,要自己给数并说出依据,而不是跳过澄清
    • 深入的 15 分钟要靠提前备好的三个「深入包」:状态与保序、成本与限流、失败与重试
    • 时间不够时砍草图不砍权衡——权衡那 5 分钟几乎没人做,做了就是加分

D27 Resume and Project Packaging: STAR, README, Architecture Diagrams, a Demo Video, an English Resume

  • Walk me through a technical project of yours using the STAR framework.请用 STAR 法则讲一个你做过的技术项目。
    Common in ChinaCommon overseasBasic#behavioral#star#resume

    How to reason about it · think before answering

    1. This question tests whether you can control information density, not whether you remember four letters. The interviewer has heard STAR dozens of times; what he is actually timing is how long you spend on background versus on what you personally did, and whether you land on a number he can probe.
    2. Decide the time split before you open your mouth: 20 seconds of situation, 15 of task, 90 of action, 25 of result. The classic failure is spending 90 seconds on situation — it feels safe because it says nothing about your ability, so people hide there.
    3. In those 90 seconds of action, say 'I', not 'we'. Summarize the team's work in one sentence, then cut straight back to 'my piece was X, and the way I did it was Y'. If your boundary with the rest of the team is unclear, the story is scored as unverifiable.
    4. The result has to be a before-and-after number, and you volunteer the measurement conditions with it: 'shard utilization went from 1 of 256 to all 256, and the largest bucket dropped from 2000 to 19 — measured locally with 2000 simulated users across 256 shards.' Naming the conditions is not hedging; it shows you know what you measured.
    5. If it is a personal or course project, say so inside the first 20 seconds rather than waiting to be asked. Volunteering the origin makes your numbers more credible, not less; being caught hiding it forces the interviewer to re-weigh everything you said before.
    6. Expect two follow-ups: 'how did you measure that?' and 'does this still hold at ten times the scale?' The first tests honesty, the second tests judgment — answer the second by naming the scale at which you would throw this design away.

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

    1. 这题在考「你会不会控制信息密度」,不是考你记不记得 STAR 四个字母。面试官已经听过几十遍 STAR,他真正在数的是:你花了多少时间讲背景、多少时间讲你自己做了什么、最后有没有一个能被追问的数字。
    2. 先定时间分配再开口,这是可以现场执行的一条纪律:情境 20 秒、任务 15 秒、行动 90 秒、结果 25 秒。绝大多数人的失败模式是情境讲了 90 秒——那部分听起来最安全,因为不涉及你的能力,所以人会不自觉地躲在那里。
    3. 行动那 90 秒里只讲你亲手做的部分,主语必须是「我」。团队做了什么用一句话带过,然后立刻切回「我负责的是其中的 X,我的做法是 Y」。说不清「我和别人的边界在哪」,这条经历在评分表上会被打成不可验证。
    4. 结果必须落到一个带前后对照的数字,并且主动补一句测量条件。比如「分片利用率从 256 个里只占 1 个变成全占满,最大桶从 2000 条降到 19 条,这是本地单机、2000 个模拟用户、256 个分片的自检结果」。补测量条件不是示弱——它把「我知道自己测的是什么」这件事直接摆出来了。
    5. 如果这段经历是学习项目或课程项目,在情境那 20 秒里就说清楚,不要等到被追问。主动交代来源的人,后面报的数字反而更容易被相信;藏着掖着被问出来,之前讲的全部要被重新掂量一遍。
    6. 可以预期的追问:「这个数字是怎么测的?」以及「如果规模再大十倍,这个做法还成立吗?」第一个考真实性,第二个考边界感——答第二个时要主动说出「在什么规模下我会推翻现在这个设计」,这一句几乎没人说,说了就是加分。

    Key points

    • Budget the time before speaking: 20s situation, 15s task, 90s action, 25s result — never let background eat half the answer
    • Say 'I' in the action section and draw a clear line between your work and the team's
    • End on a before-and-after number and volunteer how it was measured
    • Disclose that it is a personal or course project up front, not under questioning
    • Close by naming the scale at which the design would break — it signals judgment

    答题要点

    • 开口前先分配时间:情境 20 秒、任务 15 秒、行动 90 秒、结果 25 秒,别让背景吃掉一半时长
    • 行动部分主语是「我」,明确说出自己和团队的边界
    • 结果给一个带前后对照的数字,并主动补上测量条件
    • 学习项目在情境阶段就主动交代,不等追问
    • 结尾主动加一句「在什么规模下这个设计会失效」,把边界感摆出来
  • Have you applied overseas? How does an English tech resume differ from a Chinese one?你投过海外岗位吗?英文简历和中文简历在写法上有什么不同?
    Common in ChinaCommon overseasBasic#behavioral#resume#global-market

    How to reason about it · think before answering

    1. This looks like a trivia question, but the signal is whether you have actually applied or only heard about it. 'English resumes should be concise' is hearsay; naming what must never appear, and why, sounds like experience.
    2. Answer in two halves, forbidden items first, style second — the first half is a hard constraint and the second is preference, and leading with the hard part shows you can tell them apart.
    3. Forbidden: no photo, no age or date of birth, no gender, no marital status, no national ID or household registration, no expected salary. Give the real reason — in the US, Canada and the UK, employers avoid this information to limit hiring-discrimination exposure. Framing it as the employer's compliance concern rather than 'that's just the local habit' is the highest-signal sentence in this answer.
    4. Style: one page, reverse chronological, every bullet starting with a verb, every bullet quantified, and the tech stack on its own line. Give both sides on verbs — Built, Designed, Reduced, Cut are right; Responsible for, Helped with and Familiar with describe a job description, an assist, and an awareness respectively, none of which is your contribution.
    5. Add the detail most people miss: always carry units and currency — 'p95 latency 320 ms', not 'latency 320'; '$0.0006 per turn', not '0.0006 per turn'. Overseas interviewers read magnitudes carefully and cannot judge a bare number. Keep tense consistent too: past tense for finished work, present for ongoing.
    6. Expect: 'did you write it yourself or translate it?' Say you wrote it, and name a concrete step you took — for instance deleting every adjective from the Chinese version before rewriting, because directly translated adjectives read as empty in English.

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

    1. 这题看着像常识题,区分度藏在「你是真投过还是听说过」。只答「英文简历要简洁」是听说过;答得出「哪些东西在英文简历里绝对不能出现,以及为什么」的,才像真做过。
    2. 拆成两半答,顺序是「不该有的」在前、「该怎么写」在后。因为前者是硬约束,后者是风格偏好,先说硬的显得你分得清轻重。
    3. 不该有的那一半:不放照片、不写年龄和出生日期、不写性别、不写婚姻状况、不写身份证与户籍、不写期望薪资。原因要说到点子上——在美加英等地,招聘方为了规避雇佣歧视方面的法律风险,收到这些信息反而为难。说出「这是对方的合规顾虑」而不是「国外习惯这样」,是这题最能体现认知深度的一句。
    4. 该怎么写的那一半是五条格式硬要求:一页、反向时序、每条动词开头、每条带量化结果、技术栈单列一行。动词开头要给正反例——Built / Designed / Reduced / Cut 是对的,Responsible for、Helped with、Familiar with 是三个要避开的开头,因为它们分别在描述职责、描述协助、描述认知,都不是你的贡献。
    5. 补一条很多人漏掉的:单位和货币要写全(写 p95 latency 320 ms 而不是「延迟 320」,写每轮 0.0006 美元而不是「一轮 0.0006」)。海外面试官对量纲敏感,缺单位的数字他判断不了好坏。时态上也要一致:结束的项目用过去时,在推进的用现在时。
    6. 可以预期的追问:「你的英文简历是自己写的还是翻译的?」老实答自己写的,并说出你为此做的一个具体动作——比如把中文那份里的形容词全删掉之后重写,因为直译过来的形容词在英文里会显得空。

    Key points

    • Lead with the hard constraints: no photo, age, gender, marital status, national ID or expected salary
    • The reason is the employer's compliance exposure around hiring discrimination, not local custom
    • Five format rules: one page, reverse chronological, verb-first bullets, quantified results, tech stack on its own line
    • Avoid Responsible for, Helped with and Familiar with; use Built, Designed, Reduced, Cut
    • Always carry units and currency, and keep tense consistent — past for finished work, present for ongoing

    答题要点

    • 先答硬约束:不放照片、年龄、性别、婚姻状况、身份证与户籍、期望薪资
    • 原因是对方的合规顾虑(规避雇佣歧视方面的法律风险),不是「国外习惯这样」
    • 格式五条:一页、反向时序、动词开头、量化结果、技术栈单列一行
    • 动词开头避开 Responsible for、Helped with、Familiar with,改用 Built / Designed / Reduced / Cut
    • 单位与货币写全,时态保持一致:结束的项目用过去时,在推进的用现在时

D28 Mock Interview Day: One Full China-Domestic-Style and One Full Overseas-Style Round, Self-Assessment

  • How do domestic Chinese and overseas tech interview loops differ structurally, and how would you prepare for each?国内和海外技术面试的流程差异主要在哪里?你会怎么分别准备?
    Common in ChinaCommon overseasBasic#interview-process#career

    How to reason about it · think before answering

    1. This looks like trivia, but the discriminator is whether you actually rehearsed against a loop. Answering only 'overseas has behavioral, China has fundamentals drilling' sounds like hearsay.
    2. Lead with structure, because every other difference follows from it. A domestic loop is usually two or three rounds in a single day with the same people digging deeper each round, and one round of roughly 60 minutes splits into five segments: 3 minutes of self-introduction, 25 of project deep-dive, 20 of live coding, 10 of scenario and fundamentals, 5 of candidate questions. An overseas loop is five independent stages spread over weeks: a 30-minute recruiter screen, 60 minutes of technical/coding, 60 of system design, 45 of behavioral, then team match, each run by different people who score independently and vote at the end.
    3. Derive preparation from that structure, which is where the answer earns its keep. Same people digging deeper means the domestic loop is decided in that 25-minute deep-dive, so rehearse surviving three layers of follow-up. Independent stages plus a vote means any single overseas round can sink you, so weakest link beats strongest link, especially behavioral, which most engineers never rehearse.
    4. A third difference is how judgment is recorded: domestic outcomes lean on the interviewer's live impression, while most overseas companies use structured rubrics and written feedback. That makes behaviors which can be written down — narrating while coding, volunteering trade-offs and failure modes — worth more overseas.
    5. Correct a common misconception before they raise it: the difference is not that overseas skips algorithms. That 60-minute coding round is still an algorithm round; what changes is the explicit requirement to think out loud, where silence itself costs points.
    6. Expect the follow-up on time allocation: train the overlap first — project deep-dive and system design appear in both loops and give the best return — then specialize, adding two or three reusable STAR stories for overseas, or the habit of naming the edge of your knowledge for domestic rounds.

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

    1. 这题看着像常识题,区分度其实在于你有没有真的按流程准备过。只答「海外有 behavioral、国内有八股」是在复述听说,面试官听不出你排练过。
    2. 先给结构这条主线,其余差异都是它的推论:国内通常是一天之内两到三轮,同一批人越问越深,单轮 60 分钟出头切成五段——自我介绍 3 分钟、项目深挖 25 分钟、手撕代码 20 分钟、场景与八股 10 分钟、反问 5 分钟;海外是拉长到几周的五个独立环节——recruiter screen 30 分钟、technical/coding 60 分钟、system design 60 分钟、behavioral 45 分钟、team match,每一环由不同的人负责,各判各的,最后合票。
    3. 由结构推准备策略,这一步才是答案的价值所在:同一批人越问越深,意味着国内的胜负手在项目深挖那 25 分钟,要练的是被追问三层还答得上;独立环节合票意味着海外任何一轮都能单独把你否掉,所以短板比长板重要,尤其是多数人从没排练过的 behavioral。
    4. 第三条差异是评价载体:国内更依赖面试官当场的主观印象,海外多数公司有结构化的评分维度和书面反馈,所以「边写边讲」「主动说出取舍与失败模式」这类能被写进反馈的行为,在海外权重更高。
    5. 要主动澄清一个常见误区:差异不是「海外不考算法」。coding 那 60 分钟照样是算法题,区别在于它明确要求你全程出声,沉默本身就会被扣分。
    6. 可以预期的追问:那准备时间怎么分配?答共同部分先练——项目深挖和系统设计两套流程都要考,投入产出比最高;剩下的按目标市场补,投海外就补 2 到 3 个可复用的 STAR 故事,投国内就补知识的边界感(不知道就说不知道,再说出你会怎么查)。

    Key points

    • Structure is the through-line: domestic loops run two or three rounds in one day with the same panel going deeper; overseas loops are five independent stages over weeks, scored separately and voted on
    • Domestic segments and time boxes: 3 minutes intro, 25 project deep-dive, 20 live coding, 10 scenario and fundamentals, 5 candidate questions
    • Overseas stages: 30-minute recruiter screen, 60 coding, 60 system design, 45 behavioral, then team match
    • Preparation follows from structure: domestic means surviving three layers of follow-up; overseas means fixing your weakest round, especially two or three reusable STAR stories
    • Overseas relies on rubrics and written feedback, so narrating while coding and volunteering trade-offs count for more — but algorithms are still tested

    答题要点

    • 结构差异是主线:国内一天内两三轮、同一批人越问越深;海外五个独立环节跨几周,不同的人各判各的最后合票
    • 国内单轮的五段与时间盒:自我介绍 3 分钟、项目深挖 25 分钟、手撕代码 20 分钟、场景与八股 10 分钟、反问 5 分钟
    • 海外五轮:recruiter screen 30 分钟、coding 60 分钟、system design 60 分钟、behavioral 45 分钟、team match
    • 准备策略由结构推出:国内练被追问三层,海外补短板(尤其 behavioral 的 2 到 3 个可复用故事)
    • 海外更依赖结构化评分与书面反馈,所以边写边讲、主动说取舍这类可被记录的行为权重更高;但算法一样要考

D29 Shoring Up Weak Points + a Coding Warm-Up: Rate Limiter, LRU, Concurrency Control, Streaming JSON Parsing

  • What are the common rate limiting algorithms, what are their trade-offs, and which one would you actually ship?限流器有哪几种常见算法?各自的优缺点是什么?如果只能落地一种,你选哪个?
    Common in ChinaCommon overseasBasic#rate-limiting#concurrency

    How to reason about it · think before answering

    1. This question tests whether you know rate limiting has several distinct semantics, not whether you can write a counter. Naming only one algorithm reads as never having run real traffic.
    2. Lay the four out by complexity and attach a weakness to each: fixed window is cheapest but has the boundary burst; sliding window log is exact but its memory grows with request count; sliding window counter is an approximation with constant memory; token bucket allows bursts with constant memory. That ordering is the skeleton of a good answer.
    3. Make the boundary burst concrete, because it is the standard follow-up: with a 100-per-minute limit, a client can spend 100 at 12:00:59 and another 100 the instant the counter resets at 12:01:00 — 200 requests inside two seconds, double the quota.
    4. Pick the token bucket and justify it by traffic shape: real traffic is bursty, and the bucket gives you two independent knobs — refill rate caps the long-run rate, capacity caps the burst. Implement it with lazy refill: compute the top-up from the elapsed time when a token is requested, never run a timer per user.
    5. Production angle: the in-memory version only holds for a single instance. Across gateway replicas, read-compute-write has a race and two replicas can both see 'one token left' and both allow. Fix it with a Redis Lua script so refill and deduction happen in one atomic step — Lua is not for speed here, it is for gluing three commands into one.
    6. Expect the follow-up: why not read the clock inside the script? Because that makes the script non-deterministic. Pass the timestamp in from the caller, and say the cost out loud — replica clocks now have to be roughly aligned.

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

    1. 这题在考「你知不知道限流有多种语义」,而不是「你会不会写计数器」。只答出一种算法的人,会被默认没做过真正的流量治理。
    2. 先把四种按复杂度排开再逐个给弱点:固定窗口最省内存但有边界双倍;滑动窗口日志最精确但内存和请求数同阶;滑动窗口计数是近似解、内存回到常数;令牌桶允许突发、内存常数。这个排列顺序本身就是答案的骨架。
    3. 边界双倍要用具体数字讲,它是本题最常见的追问:限每分钟 100 次,用户在 12:00:59 打满 100 次,12:01:00 计数器清零又能打 100 次,跨边界的这 2 秒实际放行了 200 次。说不出这个例子,等于没答第一问。
    4. 结论选令牌桶,理由要落在业务形状上:真实流量本来就是突发的,令牌桶同时约束了长期速率(补充速度)和瞬时突发(桶容量),两个旋钮分别对应两个业务问题。实现上必须是惰性补充——取的时候按时间差现算,不要给每个用户起一个定时器,十万用户就是十万个定时器。
    5. 生产视角:单机内存版只在单实例下成立。多个网关实例共享配额时,「读余额 → 算补充 → 写回」三步之间一定有竞态,两个实例都读到「还剩 1 个」就会双双放行。修法是把三步塞进一段 Redis Lua 脚本,靠单线程执行整段脚本拿到原子性——用 Lua 不是为了快,是为了把三条命令粘成一条。
    6. 可以预期的追问:脚本里为什么不直接取当前时间?因为那会让脚本变得不确定,时间戳应该由调用方传进来;代价是各实例的时钟要大致对齐,这个取舍要主动说出口。

    Key points

    • Four algorithms: fixed window (cheap, boundary burst), sliding window log (exact, memory grows with requests), sliding window counter (approximate, constant memory), token bucket (bursty, constant memory)
    • The fixed-window boundary burst lets twice the quota through in the two seconds around a window edge, which is enough to overload a database or model API
    • Ship the token bucket: refill rate bounds the long-run rate and capacity bounds the burst, two knobs for two real constraints
    • Use lazy refill — top up from elapsed time on access instead of running one timer per key
    • For the distributed version, put refill and deduction in one Redis Lua script; a GET followed by a SET always races. Pass the timestamp in to keep the script deterministic

    答题要点

    • 四种算法:固定窗口(省内存但边界双倍)、滑动窗口日志(精确但内存与请求数同阶)、滑动窗口计数(近似、常数内存)、令牌桶(允许突发、常数内存)
    • 固定窗口的边界双倍:跨窗口交界的 2 秒内可以放行两倍配额,下游是数据库或模型 API 时足以打穿
    • 落地选令牌桶:补充速度管长期速率、桶容量管瞬时突发,两个旋钮对应两个真实业务约束
    • 必须用惰性补充:取令牌时按时间差现算,不要为每个 key 起定时器
    • 分布式版把补充与扣减写进一段 Redis Lua 脚本,先 GET 再 SET 一定有竞态;时间戳由调用方传入以保持脚本确定性

D30 Full Retrospective and Application Kickoff: a Complete Pass Over the Interview Bank, a Knowledge Map, Month-Two Application Cadence, Public Launch of the Site

  • With only one week left before your interviews, how would you plan your review?如果只剩最后一周准备面试,你会怎么安排复盘节奏?
    Common in ChinaCommon overseasBasic#interview-prep#prioritization

    How to reason about it · think before answering

    1. This sounds casual but it tests prioritization. The interviewer wants judgment, not diligence: the week is fixed, so how do you decide where it goes? 'Eight hours a day, start from the top' shows no judgment at all.
    2. Offer a reusable rule: the marginal value of reviewing a topic depends on how far you currently are from being able to explain it, so step one of any plan is measurement, not study. Planning without measuring is allocating a budget blindfolded.
    3. Concretely: day one is triage only — say every answer out loud and tag it green (can explain unaided), yellow (can explain with a glance at notes), or red (cannot). Skip reds immediately. The output of that pass is a distribution, not knowledge. Days two and three hit yellow and red, day four hits what is still red, and the last days go to mock interviews and delivery.
    4. Name the discipline and its failure mode: fixing the first red question on the spot burns thirty minutes, so by question twenty the day is gone and most of the set was never assessed. That detail is what proves you have actually done this.
    5. Add a falsifiable bar for 'I know it': out loud, ninety seconds, no notes. The fluency you feel while reading silently belongs to the author, not to you.
    6. Expect the follow-up: what if the reds cluster in one area? Fix the upstream concept first rather than the individual questions — clustered reds usually share one missing prerequisite, and repairing it lights up five questions at once.

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

    1. 这题看着像闲聊,其实在考「你会不会做优先级」。面试官想听的不是勤奋,是判断:一周时间是固定的,你怎么决定把它花在哪。答「每天复习八小时,从头过一遍」就是没有判断。
    2. 先给一条可复用的推导:复习的边际收益取决于「这一块你现在离能讲清有多远」,所以任何计划的第一步都必须是**测量**,而不是学习。没测量就排计划,等于闭着眼睛分配预算。
    3. 落到具体做法:第一天只做分诊——把所有题目出声过一遍,按「能讲清 / 看一眼能讲 / 讲不出」标三种颜色,看到不会的立刻跳过。这一遍的产出是一张分布图,不是知识。第二、三天只碰后两类,第四天只碰仍然讲不出的,最后两三天留给模拟和表达。
    4. 要主动说出「只标记不纠结」这条纪律和它的失败模式:碰到第一道不会的题当场去补,一道题吃掉半小时,做到第 20 道今天就没了,剩下的题连颜色都没有。这个细节最能证明你真的这样练过。
    5. 再补一个判据:判断「会」的标准必须可证伪——出声、限时 90 秒、不看提纲。默读产生的流畅感是题库给的,不是你的。
    6. 可预期的追问:如果分诊发现红题集中在同一块怎么办?答案是先补那一块的**上游**概念,而不是逐题补——同一块里的题往往共用一个没吃透的前置,补上游一道题能带亮五道。

    Key points

    • Start by measuring, not studying: one spoken pass over everything, tagging only, no on-the-spot fixes
    • Three shrinking passes: tag everything, then only yellow and red, then only what is still red, leaving the tail for delivery practice
    • Make 'I know it' falsifiable: spoken, under ninety seconds, no notes — silent reading does not count
    • The triage pass produces a distribution that tells you whether the remaining days go to technique or to delivery
    • When reds cluster, repair the shared upstream concept rather than each question

    答题要点

    • 第一步是测量不是学习:先出声过一遍全部题目,只做三色标记,不当场补漏
    • 三遍递减:第一遍全量标记,第二遍只刷黄和红,第三遍只刷仍然红的,最后留时间给表达与模拟
    • 「会」的判据必须可证伪:出声讲、90 秒内讲完、不看提纲,默读不算
    • 分诊的产出是一张分布图,它决定后面几天该补技术还是补表达
    • 红题扎堆时先补共同的上游概念,比逐题补效率高得多