面试题库
共 328 题,当前筛选 6 题。
14 天用 Agent 搭一条 AI 短剧生产线
D8 工作流引擎:把流水线做成可断点续跑的任务图
什么时候该自己写调度,什么时候该直接上现成的工作流引擎?When should you write your own scheduler, and when should you adopt an off-the-shelf workflow engine?
国内高频海外高频基础#architecture#build-vs-buy#workflow-engine分析过程 · 先想清楚再作答
- 这题考的是技术选型的成熟度。两个极端都会被扣分:什么都自己写显得不懂杠杆,什么都上框架显得没判断力。面试官想听的是你的切换信号是什么。
- 先给一条通用判据:自己写的收益是理解和贴合,框架的收益是省掉你还没遇到的那些问题。所以决策取决于「你现在需要的功能有多少落在框架的核心能力上」。
- 自己写划算的情形:单机、节点数是个位数、路径是你定死的、需要的只是拓扑排序加幂等加状态落盘这几件事。这时候自己写不到三百行,而且换来的理解是通用的——你会彻底搞懂幂等键为什么要包含依赖指纹、状态为什么必须每步落盘。
- 该换的三个信号:一是开始需要跨机器调度,自己实现分布式调度的复杂度是指数级上升的;二是开始需要人工介入节点,流程要挂起几小时甚至几天,状态必须外置到数据库而不是一个 JSON 文件;三是开始需要给非工程师看和操作,那你需要的其实是一个带界面的产品。
- 反过来说,过早引入重型框架的代价很具体:每一个业务改动都要先绕过它的抽象,而它的收益要等规模上来才兑现。这是典型的成本前置、收益后置。
- 可预期的追问是「自己写的那一套能不能平滑迁走」。答:能,前提是你从一开始就把节点定义成纯声明(依赖、输入、产物、执行体),调度和状态不侵入业务。这样迁移时改的是引擎,不是六个节点。
How to reason about it · think before answering
- This tests selection maturity. Both extremes lose points: building everything yourself shows no sense of leverage, adopting a framework for everything shows no judgment. The interviewer wants your switching signals.
- Give a general criterion: writing it yourself buys understanding and fit; a framework buys you past problems you have not hit yet. So the decision hinges on how much of what you need overlaps with the framework's core.
- Writing your own pays off when: single machine, a handful of nodes, a path you fixed yourself, and you only need topological ordering plus idempotency plus state persistence. That is under three hundred lines, and the understanding transfers to any engine you adopt later.
- Three signals to switch: you need cross-machine scheduling, where rolling your own scales in complexity exponentially; you need human-in-the-loop nodes, so runs suspend for hours or days and state must live in a database rather than a JSON file; or non-engineers need to see and operate it, in which case you need a product with a UI, not an engine.
- Conversely, adopting a heavy framework too early has a concrete cost: every business change must route around its abstractions, while its benefits only land at scale. Cost up front, payoff deferred.
- Expect the follow-up 'can you migrate off your own version cleanly'. Yes, if nodes were declarative from the start — dependencies, inputs, outputs, body — with scheduling and state kept out of the business code. Then migration replaces the engine, not the nodes.
答题要点
- 判据是你需要的功能与框架核心能力的重叠度,不是「自研还是选型」的立场。
- 自己写划算:单机、节点数少、路径固定,只需要拓扑排序加幂等加状态落盘。
- 该换的三个信号:跨机器调度、人工介入导致流程长时间挂起、非工程师要操作。
- 过早上重型框架的代价是每次业务改动都要绕过它的抽象,收益却要等规模。
- 把节点写成纯声明,调度与状态不侵入业务,将来迁移改的是引擎而不是节点。
Key points
- Decide by how much your needs overlap the framework's core, not by a build-versus-buy stance.
- Rolling your own wins on a single machine with few nodes and a fixed path, needing only topo order, idempotency and state persistence.
- Three switching signals: cross-machine scheduling, human-in-the-loop suspension, and non-engineers needing to operate it.
- Adopting a heavy framework early costs a detour around its abstractions on every change, with benefits deferred to scale.
- Keep nodes declarative and scheduling non-invasive so a later migration replaces the engine, not the nodes.
D9 并发与配额:多集同时开机,还不能把厂商额度打爆
优先级队列容易出现饿死,你会怎么防?Priority queues starve low-priority work. How do you prevent that?
国内高频海外高频基础#scheduling#priority-queue#fairness分析过程 · 先想清楚再作答
- 这题是送分题,但很多人只答一个「老化」就停了,拿不到区分度。区分度在两个补充条件上。
- 先说机制:老化,也就是等待越久有效优先级越高,每等过一个阈值就升一档。同档内按入队时间先来先服务。
- 第一个补充条件是升档要封顶,而且不许升进最高那一档。否则跑上半小时,队列里全是最高优先级,这一档就名存实亡了。本课的口径是低优先最多升到普通,最高档只留给人工插队。
- 第二个补充条件更容易被忽略:如果任务被派出去之后才开始等资源,优先级会静默失效——工作槽被一批低优先任务占着等资源,高优先任务连被取走的机会都没有。所以准入要在调度之前完成。
- 结论里要给出可观测量:按优先级统计平均等待与最长等待,再加一个升档次数。这两组数字能直接告诉你老化阈值配得对不对。
- 可预期的追问是「除了老化还有别的办法吗」。有:给低优先级预留一部分固定配额(比如每四次调度必须让一个低优先的过),这是加权公平调度的思路,比老化更可控但实现更啰嗦。
How to reason about it · think before answering
- This is the easy one, and most candidates stop after saying aging. The signal is in the two conditions they forget to attach.
- The mechanism first: aging, where effective priority rises with waiting time, one step per threshold crossed, with first-in-first-out inside a tier.
- Condition one: cap the promotion, and never let it reach the top tier. Otherwise after half an hour every queued job is top priority and the tier means nothing. Our rule is that low may rise to normal, and the top tier stays reserved for human escalation.
- Condition two is the one people miss: if a job waits for resources after dispatch, priority silently stops working, because worker slots are pinned by low-priority jobs waiting on quota and the urgent job is never picked up. Admission must happen before dispatch.
- Close with the observable: track average and maximum wait per tier plus a promotion counter. Those two numbers tell you directly whether the aging threshold is right.
- Expected follow-up: alternatives to aging. Reserved shares work too, where every fourth dispatch must go to a low-priority job. That is weighted fair queuing, more controllable but noisier to implement.
答题要点
- 用老化:等待时间越长有效优先级越高,同档内先来先服务。
- 升档要封顶,绝不能升进最高那一档,否则最高档形同虚设。
- 准入要放在调度之前,否则工作槽被低优先任务占着等资源,优先级会静默失效。
- 按优先级统计平均等待、最长等待与升档次数,用它来校准老化阈值。
- 备选方案是给低优先级预留固定份额的加权公平调度,比老化更可控但实现更复杂。
Key points
- Use aging: effective priority rises with wait time, first-in-first-out within a tier.
- Cap promotion and never let it reach the top tier, or the top tier stops meaning anything.
- Admit before dispatch, otherwise worker slots pinned on quota make priority silently useless.
- Track per-tier average wait, max wait and promotion count, and tune the aging threshold from those.
- The alternative is weighted fair queuing with a reserved share for low priority: more controllable, more code.
D10 审片室:能预览、能改词、能重生成单镜的人机协作后台
一条自动化流水线要插入人工审核,你会把卡点放在哪几步?为什么?Where would you place human review checkpoints in an automated pipeline, and why there?
国内高频海外高频基础#human-in-the-loop#pipeline-design#cost分析过程 · 先想清楚再作答
- 这题在考你有没有成本意识。答「每一步都让人看一眼」是没做过工程的回答——人是最贵的资源,卡点多了流水线就退化成手工作坊。
- 给一条可复用的判据:**卡点放在「下游最贵的那一步」之前**。判断某个位置该不该设卡,只问一句「如果这里错了,往后要白花多少钱」。
- 按这条判据落到生成式流水线上,会得到三个位置:剧本定稿之后(此时零成本,却决定了后面所有素材的方向)、首帧出来之后视频生成之前(首帧是最便宜的一档,视频是最贵的一档,同一个镜头差出一到两个数量级)、成片合成之后发布之前(这一道拦的不是质量而是合规风险)。
- 补一条生产视角:卡点不等于阻塞。第一和第二道可以做成「默认放行、超时自动继续」,只有第三道必须硬卡——合规问题不能靠超时放行。
- 结论里要点出一个反直觉的事实:最容易被跳过的恰恰是第一道,因为这时候还没有画面,看起来没什么可审的;但它是唯一一道改起来零成本的闸门。
- 可预期的追问是「人来不及审怎么办」。答案是分级:机器先打分,只把低分的推给人,人的时间花在机器拿不准的那部分上。
How to reason about it · think before answering
- This one tests cost awareness. Saying a human should look at every step marks someone who has not run this in production: humans are the expensive resource, and too many gates turn a pipeline back into handwork.
- Offer a reusable rule: put the gate immediately before the most expensive downstream step. To decide whether a position deserves a gate, ask how much money is wasted if something is wrong here.
- Applied to a generative pipeline that yields three positions: after the script is locked (free to change, yet it steers every asset that follows), after the first frame but before video generation (the frame is the cheapest step and the clip is the most expensive, one to two orders of magnitude apart), and after the final cut but before publishing (this one gates risk, not quality).
- Add the production view: a checkpoint is not necessarily blocking. The first two can auto-continue on timeout; only the compliance gate must hard-block, because you cannot let a legal check pass by timing out.
- State the counterintuitive part: the first gate is the one people skip, because there are no visuals yet and it looks like there is nothing to review, while it is the only gate where changes cost nothing.
- Expected follow-up: what if reviewers cannot keep up. Tier it. Machines score everything, humans only see the low scores, and human attention goes where the machine is unsure.
答题要点
- 判据是「卡点放在下游最贵的那一步之前」,问的是这里错了往后白花多少钱。
- 三个位置:剧本定稿后、首帧出来后视频生成前、成片合成后发布前。
- 首帧那一道性价比最高:首帧是最便宜的一档,视频是最贵的一档,同一个镜头差出一到两个数量级。
- 前两道可以默认放行加超时继续,只有合规那一道必须硬卡。
- 人力不够就分级:机器先打分,人只看低分的那些。
Key points
- Rule: place the gate right before the most expensive downstream step, judged by wasted spend if this step is wrong.
- Three positions: after script lock, after first frame and before video, after final cut and before publish.
- The first-frame gate pays best: the frame is the cheapest step and the clip the most expensive, one to two orders of magnitude apart.
- The first two gates can auto-continue on timeout; only the compliance gate hard-blocks.
- When reviewers are the bottleneck, tier it: machines score everything, humans only see low scores.
D11 质检与合规:机器审片、内容安全、生成内容标识与版权边界
内容安全审核放在生成前还是生成后?为什么两边都要有?Should content safety checks run before generation or after? Why both?
国内高频海外高频基础#content-safety#moderation#pipeline-design分析过程 · 先想清楚再作答
- 这题的正确答案是「两边都要」,但拿分的关键不在结论,而在你能不能说清两道关**防的是不同的事**。答成「双重保险更稳妥」就是没答。
- 前置那道查的是你要发出去的提示词,省的是钱和账号:违规提示词发过去会命中厂商审核被拒(MiniMax 这边返回 1026 或 1027),白等一轮,严重的会触发风控。它是一层本地词表加规则,几毫秒,拦一条省一次调用。
- 后置那道查的是厂商还给你的成片,它更重要,理由是**提示词干净不代表结果干净**——生成模型会自己加戏,你写便利店门口,它可能给你摆一整面货架的品牌包装。前置只保证你没主动要,后置才保证观众看到的没问题。
- 前置被拦下之后不能只抛异常,要给替代方案并让流程继续:把命中片段替换成安全表述、打印出来、记进报告,人回头能看到哪一句被改成了什么。
- 还要点破一个常见误解:**厂商的审核不能替代你的审核**。厂商审的是它自己的合规风险,边界跟你的业务不同;而且发布责任在你,出事找的是发布者。
- 可预期的追问是「后置发现问题怎么办」。按严重程度分流:能自动修的(比如字幕里的词)就修完重跑那一个节点,修不了的直接拦住不许发布并推给人工,绝不能因为已经花了钱就放行。
How to reason about it · think before answering
- The answer is both, but the marks come from explaining that the two gates defend against different things. Saying defence in depth is safer earns nothing.
- The pre-check inspects the prompt you are about to send, and it saves money and account standing: a violating prompt gets rejected by the vendor's own moderation (1026 or 1027 at MiniMax), wasting a round trip, and repeated hits can trip risk controls. It is a local word list plus rules, milliseconds, and each catch saves a call.
- The post-check inspects what the vendor returned, and it matters more, because a clean prompt does not imply a clean result. Generative models improvise: you ask for a convenience store and get a shelf of branded packaging. The pre-check only proves you did not ask for it; the post-check protects the viewer.
- When the pre-check fires, do not just throw. Offer a replacement and keep going: swap the matched fragment for safe wording, print it, and record it so a human can see which line was changed and how.
- Call out the common misconception: vendor moderation does not replace yours. The vendor moderates its own risk, with different boundaries, and publishing liability sits with you.
- Expected follow-up: what to do when the post-check fails. Triage by severity: auto-fixable issues get fixed and only that node reruns; anything else blocks publishing and goes to a human. Never wave it through because the money is already spent.
答题要点
- 两道都要,因为防的事不同:前置省钱与账号,后置保护观众与合规。
- 前置是本地词表加规则,几毫秒,拦下一条就省一次调用;命中要给替代写法而不是抛异常停线。
- 后置更重要:提示词干净不代表结果干净,模型会自己加戏。
- 厂商的审核只兜它自己的风险,不能替代你的,发布责任在你。
- 后置发现问题按严重度分流:能自动修的修完重跑该节点,修不了的硬拦并推人工。
Key points
- Both, because they defend different things: the pre-check saves spend and account standing, the post-check protects viewers and compliance.
- The pre-check is a local rule pass in milliseconds; on a hit, substitute safe wording instead of throwing and halting the line.
- The post-check matters more, because a clean prompt does not guarantee a clean result.
- Vendor moderation covers the vendor's risk, not yours; publishing liability stays with you.
- Triage post-check failures: auto-fix and rerun that node, or hard-block and escalate.
D12 成本与模型路由:按环节选模型、缓存、降级与预算熔断
一条内容生成流水线的成本要怎么拆?拆完你会先优化哪一环,为什么?How do you break down the cost of a content-generation pipeline, and which stage would you optimize first?
国内高频海外高频基础#cost-analysis#observability分析过程 · 先想清楚再作答
- 这题在考你有没有真的看过账单。凭感觉答「多用缓存、少调模型」的人一听就没做过;能说出「按什么维度拆、拆出来大概什么比例」的才是。
- 拆的维度要先立住:按环节(脚本、图像、视频、语音)、按计价单位(按秒、按张、按字符、按 token)、按是否计费(成功、命中缓存、失败未扣费)。三个维度缺一个,报表就会有一类花费永远看不见。
- 然后给数量级。多媒体生成这类流水线里视频按秒计价,一集十几秒就是几块钱;图像按张几分钱、语音按字符几厘钱、文本更低。结论是视频通常占九成以上,其余全是零头。
- 所以优化顺序不是「哪一环最容易优化」,而是「哪一环最贵」。先优化视频,手段按代价从低到高排:缓存与幂等(不重复调)、分档路由(草稿档用便宜规格)、降级(清晰度、时长、镜头数)、最后才是换厂商谈价。
- 补一句可信度:不确定的单价不要写进表。官方只给资源包价的档位要标明是折算值,官方没公开的档位就留空只统计用量——把估算值当官方价报上去,是这类项目最常见的翻车点。
- 可预期的追问是「那怎么证明优化生效了」。答案是同一份输入跑两遍,对照面板上按环节的金额与调用次数,而不是看月账单——月账单里混着别人的流量,归因不到你这次改动。
How to reason about it · think before answering
- This question checks whether you have actually read a bill. Answering with generic advice like use more caching signals you never ran this in production; naming the breakdown dimensions and rough ratios signals you did.
- Establish the dimensions first: by stage (script, image, video, speech), by billing unit (per second, per item, per character, per token), and by billable status (succeeded, cache hit, failed and not charged). Drop any one of them and a whole class of spend becomes invisible.
- Then give orders of magnitude. Video is billed per second, so a dozen seconds already costs a few yuan, while images are cents per item, speech is fractions of a cent per character, and text is lower still. Video typically dominates at over ninety percent.
- So the priority is driven by what is expensive, not by what is easy to change. Attack video first, cheapest lever to most expensive: caching and idempotency, tiered routing with a cheap draft tier, degradation across resolution, duration and shot count, and only then vendor negotiation.
- Add a credibility note: never put an unverified unit price in the table. Mark derived prices as estimates and leave unpublished ones blank while still counting usage. Reporting an estimate as an official price is how these projects lose trust.
- Expect the follow-up: how do you prove the optimization worked? Run the same input twice and compare the per-stage panel, not the monthly invoice, which mixes in traffic you did not cause.
答题要点
- 按三个维度拆:环节、计价单位、是否真的计费(成功 / 缓存命中 / 失败未扣费)
- 先给比例再给结论:视频按秒计价,通常占单集成本九成以上,其余是零头
- 优化顺序由贵到便宜:缓存与幂等、分档路由、降级、最后才谈价换厂商
- 拿不到的单价宁可留空只统计用量,折算出来的要标明是折算值
- 验证靠同一份输入跑两遍对照面板,不看混杂的月账单
Key points
- Break it down three ways: by stage, by billing unit, and by whether the call was actually charged
- Lead with the ratio: video is billed per second and usually exceeds ninety percent of per-episode cost
- Optimize expensive first: caching and idempotency, tiered routing, degradation, vendor negotiation last
- Leave unknown unit prices blank while still counting usage, and label derived prices as estimates
- Validate by running the same input twice and diffing the per-stage panel, not the monthly invoice
D14 一季五集:批量产出、作品集包装与短剧生产线面试专题
介绍一下你做的这条 AI 内容生产线,它最难的地方在哪?Walk me through the AI content pipeline you built. What was the hardest part?
国内高频海外高频基础#project-storytelling#system-design分析过程 · 先想清楚再作答
- 这是一道开放题,考的是收敛能力。把十四天的东西按时间顺序流水账讲一遍,面试官三分钟后就走神了;能在三十秒内给出一条主线,才算会讲项目。
- 开头两句要立住定位与规模:从一句话选题到多平台可发布成片的自动化流水线,一次运行产出一季五集,人只在需要判断的地方介入。数字先给,细节后给。
- 然后回答「最难」。这个词不该答成「调试很麻烦」,要答成一条能推出后续所有设计的判断:这条线上最贵、最慢、最容易失败的是视频生成,占单集成本九成以上,所以整套工程都是围着「怎么少调一次视频接口」转的。
- 接着一句话挂上推论链:幂等与缓存是为了不重复调,参考图复用是为了少试几次,草稿档路由是为了试错时用便宜规格,预算熔断是为了失控时能停住。这条链子证明你的技术选择不是攒来的最佳实践。
- 最后主动留一个可被追问的钩子,比如「异步任务的客户端比我预想的复杂得多」——把面试官引到你准备最充分的地方去,而不是等他随机挑一个你没想过的角落。
- 可预期的追问是「有真实数据吗」。所以复盘时必须留下四个数字:耗时、花费、失败率、人工介入次数。花费是估算的就要主动说明是估算,别让人以为你贴了张真实账单。
How to reason about it · think before answering
- This is an open question that tests convergence. Narrating two weeks of work chronologically loses the interviewer in three minutes; delivering one through-line in thirty seconds is what counts as telling a project well.
- Open with positioning and scale: an automated pipeline from a one-line premise to publish-ready vertical episodes, one run producing a five-episode season, with humans stepping in only where judgement is required. Numbers first, detail second.
- Then answer hardest. That word should not be spent on debugging pain; spend it on a judgement that generates every downstream decision: video generation is the most expensive, slowest and most failure-prone stage at over ninety percent of per-episode cost, so the whole design revolves around issuing one fewer video call.
- Attach the chain of consequences in one sentence: idempotency and caching avoid duplicate calls, reference-image reuse reduces retries, the draft tier makes experimentation cheap, and the budget breaker stops a runaway. The chain proves your choices are derived rather than collected.
- Leave a deliberate hook for follow-up, such as saying the async task client turned out far harder than expected. That steers the interviewer toward your strongest material instead of a corner you never considered.
- Expect the follow-up: do you have real numbers? Keep four from every run: wall time, spend, failure rate and manual interventions. If spend is estimated, say so, rather than letting them assume you pasted a real invoice.
答题要点
- 先定位再展开:从一句话到多平台成片,一次运行产出一季五集
- 把最难点答成一条判断:视频占单集成本九成以上且最慢最易失败
- 用推论链证明设计是导出来的:幂等缓存、参考图复用、草稿档、预算熔断
- 带上四个数字:耗时、花费、失败率、人工介入次数,估算值要主动标注
- 主动留一个追问钩子,把话题引向准备最充分的部分
Key points
- Position first: from a one-line premise to multi-platform episodes, one run per five-episode season
- Frame the hardest part as a judgement: video dominates cost and is the slowest, most failure-prone stage
- Show the derivation chain: idempotency and caching, reference reuse, draft tier, budget breaker
- Bring four numbers: wall time, spend, failure rate, manual interventions, flagging estimates as estimates
- Plant a follow-up hook that steers the conversation to your strongest area