面试题库
共 328 题,当前筛选 1 题。
课程全部30 天从前端工程师到 Agent 工程师5 天提示词工程零基础Claude 高效使用:从对话到 Claude CodeCodex 与 OpenAI Agents SDK 高效使用7 天 MCP:把工具接进任何 Agent7 天 Agent Skills:把经验做成可复用能力5 天上下文工程14 天 RAG:从检索到可信回答14 天用 Agent 搭一条 AI 短剧生产线
标签
全部#priority-queue1#pipeline-design7#consistency4#cost4#error-handling4#image-generation3#observability3#timeline3#workflow-engine3#architecture2#async-task2#caching2
还有 59 个标签收起标签
#ffmpeg2#idempotency2#media-pipeline2#provider-abstraction2#rate-limiting2#reproducibility2#retry2#scheduling2#tts2#agent-loop1#analytics1#architecture-review1#av-sync1#backoff1#budget-control1#build-vs-buy1#candidate-selection1#circuit-breaker1#compliance1#concurrency1#content-safety1#copyright1#cost-accounting1#cost-analysis1#cost-control1#dag1#data-modeling1#debugging1#degradation1#encoding1#evaluation1#fairness1#feedback-loop1#human-in-the-loop1#incremental-recompute1#integration1#labeling1#llm-output-quality1#moderation1#multimodal1#offline-testing1#pipeline-reliability1#project-storytelling1#prompt-assembly1#prompt-injection1#quality-check1#resume1#retry-strategy1#rollback1#schema-validation1#state-management1#state-persistence1#structured-output1#subtitles1#system-design1#task-graph1#test-strategy1#trade-offs1#versioning1
14 天用 Agent 搭一条 AI 短剧生产线
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.