Interview Bank
328 questions total; 1 shown with current filters.
CourseAllFrom Frontend Engineer to Agent Engineer in 30 DaysPrompt Engineering From Scratch in 5 DaysMastering Claude: From Conversation to Claude Code in 5 DaysMastering Codex and the OpenAI Agents SDK in 5 DaysMCP in 7 Days: Wire Tools Into Any AgentAgent Skills in 7 Days: Turn Experience Into Reusable CapabilityContext Engineering in 5 DaysRAG in 14 Days: From Retrieval to Trustworthy AnswersBuild an AI Short-Drama Production Pipeline With Agents in 14 Days
Tag
All#context-assembly1#evaluation15#chunking6#cost6#embeddings5#agentic-rag4#architecture4#hybrid-search4#ingestion4#abstention3#data-quality3#access-control2
92 more tagsShow fewer tags
#citation-verification2#contextual-retrieval2#cost-tradeoff2#debugging2#failure-modes2#golden-set2#long-context2#multi-hop2#observability2#query-rewriting2#ranking2#recall2#refusal2#retrospective2#system-design2#api-design1#bi-encoder1#bm251#caching1#citations1#content-hash1#coreference1#cost-optimization1#cross-encoder1#dimensions1#embedding-migration1#engineering-judgement1#error-propagation1#evidence1#failure-analysis1#faithfulness1#fallback1#filter-pushdown1#filtering1#fine-tuning1#graph-rag1#grounding1#hallucination1#hnsw1#hyde1#incremental-sync1#index-maintenance1#index-routing1#indexing1#information-retrieval1#intent-routing1#invalidation1#iterative-scan1#ivfflat1#latency1#latency-budget1#llm-as-judge1#metadata1#model-selection1#modularity1#multi-tenancy1#multi-turn1#normalisation1#ocr1#ordering1#overlap1#parent-child1#pdf-parsing1#prioritization1#production-readiness1#prompt-caching1#prompt-engineering1#prompting1#quantization1#query-transformation1#rag1#rag-basics1#rank-fusion1#reliability1#rerank1#retrieval1#retrieval-failure1#retrieval-metrics1#retrieval-quality1#risk-assessment1#rollout1#scaling1#self-reflection1#similarity1#stakeholder-communication1#streaming1#thresholds1#tool-design1#trade-offs1#vector-database1#vector-index1#zero-downtime1
RAG in 14 Days: From Retrieval to Trustworthy Answers
D6 The Generation Side: Ordering Context, Labeling Citations, When You Must Refuse to Answer, and Streaming Responses
Does the ordering of retrieved passages in the context affect answer quality? If so, how would you order them?上下文里材料的排列顺序会影响回答质量吗?如果会,你会怎么排?
Common in ChinaCommon overseasBasic#context-assembly#prompt-engineering#orderingHow to reason about it · think before answering
- This is a warm-up question, but 'sort by relevance descending' only earns half the credit. The interviewer wants to know whether you treat position itself as a variable.
- State the conclusion first: it does matter. Models attend more reliably to material at the start and the end of the context, and are most likely to miss what sits in the middle. Plain descending order therefore parks your second-best passage in the worst spot.
- Give the ordering: rank one first, rank two last, rank three second, rank four second-to-last, folding inward. Whatever ends up in the middle is by construction the least important, so the cost of it being skipped is smallest.
- Round it out with the other assembly steps, which shows you have written this code: a deterministic tiebreaker (otherwise block numbers drift between runs and your logs stop matching), dedupe on normalised text, and a token budget that skips rather than stops when a block does not fit.
- Expected follow-up: how would you verify this? Do not guess. Hold the question set fixed, vary only the ordering, and measure. Position effects differ by model and context length, so treat it as a parameter to measure on your own data rather than a universal law.
分析过程 · 先想清楚再作答
- 这是一道送分题,但答成「按相关性从高到低排」就只拿到一半分。面试官想听的是你知不知道位置本身是个变量。
- 结论先说:会影响。模型对上下文开头和结尾的材料明显更敏感,正中间的最容易被读漏。所以简单按分数从高到低顺排,等于把第二重要的材料放进了最不容易被读到的位置。
- 给出排法:第 1 名放开头、第 2 名放结尾、第 3 名放第二位、第 4 名放倒数第二位,依次往里收。这样按分数排下来越靠中间的块本来就越不重要,被读漏的代价最小。
- 顺带把排序之外的三道手续说全,显得你真的写过这段代码:同分要有决胜键(否则块编号会在两次运行之间飘,日志对不上)、要按归一化文本去重(同一段话常在手册和问答里各出现一次)、要有 token 预算并且塞不下时不要直接停。
- 可预期的追问:这个结论怎么验证?答案是别猜——固定一批问题,只改排列顺序跑对照,看指标差多少。位置效应在不同模型、不同上下文长度上强弱不一样,把它当成一个要在自己数据上量的参数,而不是一条普适定律。
Key points
- Yes: material at the head and tail is used more reliably, the middle is most often skipped.
- Put the strongest at both ends: rank one first, rank two last, rank three second, folding inward.
- Assembly also needs a deterministic tiebreaker for stable numbering, dedupe on normalised text, and a token budget that skips oversized blocks instead of stopping.
- The strength of the effect varies by model and context length, so measure it on your own data instead of quoting it as a law.
答题要点
- 会影响:开头和结尾的材料更容易被用上,正中间的最容易被读漏。
- 排法是最重要的放两端:第 1 名开头、第 2 名结尾、第 3 名第二位,依次往里收。
- 组装还要做三件事:同分给决胜键保证编号稳定、按归一化文本去重、控 token 预算且塞不下时跳过而不是终止。
- 位置效应的强弱因模型与上下文长度而异,要在自己的数据上做对照实验量出来,不能当普适定律照搬。