diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..efe7e5f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.ref/ diff --git a/README.md b/README.md index 46e3cdc..fe5c4a5 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,78 @@ -# examination +# 🎯 CS 知识应试强化系统 +基于纯 HTML + CSS + JS 的计算机科学知识应试训练平台。 + +## 快速开始 + +```bash +cd /home/wonder/code/examination +python3 -m http.server 8080 +# 浏览器打开 http://localhost:8080 +``` + +## 项目结构 + +``` +├── index.html # 前端入口(单文件 SPA) +├── topics/ # 题目数据 +│ ├── index.json # 主题索引 +│ └── {topic-slug}/ +│ ├── meta.json # 主题元信息 +│ ├── fill_blank.json # 填空题 +│ └── single_choice.json # 单选题 +├── schema/ # JSON Schema 与模板 +│ ├── question.schema.json # 题目校验 Schema +│ ├── prompt-template.md # LLM 生成提示词模板 +│ └── templates/ # 各题型示例模板 +└── .ref/ # 参考数据(不提交 git) +``` + +## 数据格式 + +每个主题是一个独立目录,包含: +- **meta.json** — 主题描述、标签、统计数据 +- **{题型}.json** — 按题型拆分的题目文件 + +题目文件顶层结构: +```json +{ + "topic": "gc-jvm", + "type": "fill_blank", + "schema_version": "1.0.0", + "questions": [...] +} +``` + +详见 [schema/question.schema.json](schema/question.schema.json)。 + +## 支持的题型 + +| 题型 | 代码 | 说明 | +|------|------|------| +| 单选题 | sc | 4 选 1 | +| 多选题 | mc | 多选多 | +| 判断题 | tf | 对/错 | +| 填空题 | fb | 填写空白 | +| 简答题 | sa | 开放式回答 | +| 代码阅读 | cr | 阅读代码回答问题 | +| 场景分析 | sn | 分析技术场景 | + +## 添加新题目 + +1. 在 `topics/` 下创建 `{topic-slug}/` 目录 +2. 创建 `meta.json`(参考已有主题) +3. 按题型创建 JSON 文件(参考 `schema/templates/`) +4. 更新 `topics/index.json` +5. 刷新页面即可 + +## 使用 LLM 批量生成题目 + +参考 [schema/prompt-template.md](schema/prompt-template.md) 中的提示词模板。 + +## 自定义导入 + +在页面侧边栏点击"📥 导入题目",可粘贴 JSON 或上传文件临时导入。 + +## License + +MIT diff --git a/docs/architecture.md b/docs/architecture.md new file mode 100644 index 0000000..974272a --- /dev/null +++ b/docs/architecture.md @@ -0,0 +1,356 @@ +# 架构文档 + +## 1. 系统总览 + +``` +┌─────────────────────────────────────────────────────┐ +│ 用户浏览器 │ +│ ┌───────────────────────────────────────────────┐ │ +│ │ index.html (单文件 SPA) │ │ +│ │ ┌─────────┐ ┌──────────┐ ┌─────────────┐ │ │ +│ │ │ 导航栏 │ │ 做题区域 │ │ 导入模态框 │ │ │ +│ │ └────┬────┘ └─────┬────┘ └──────┬──────┘ │ │ +│ └───────┼─────────────┼──────────────┼──────────┘ │ +└──────────┼─────────────┼──────────────┼─────────────┘ + │ fetch │ fetch │ JSON.parse + ▼ ▼ ▼ +┌─────────────────────────────────────────────────────┐ +│ topics/ (数据层) │ +│ ├── index.json ← 主题索引 │ +│ └── {topic-slug}/ │ +│ ├── meta.json ← 主题元信息(稳定) │ +│ ├── fill_blank.json ← 填空题集 │ +│ └── single_choice.json ← 单选题集 │ +└─────────────────────────────────────────────────────┘ + ▲ + │ git push / pull + ▼ +┌─────────────────────────────────────────────────────┐ +│ Agent / LLM (生成层) │ +│ ├── Claude Code Skill (generate / validate) │ +│ ├── LLM + 提示词模板 (schema/prompt-template.md) │ +│ └── JSON Schema 校验 (schema/question.schema.json) │ +└─────────────────────────────────────────────────────┘ +``` + +## 2. 目录结构 + +``` +examination/ +├── index.html # 前端入口(单文件 SPA) +├── topics/ # 题目数据 +│ ├── index.json # 主题索引 +│ └── {topic-slug}/ # 主题目录 +│ ├── meta.json # 主题元信息 +│ ├── fill_blank.json # 填空题 +│ ├── single_choice.json # 单选题 +│ ├── multiple_choice.json # 多选题(可选) +│ ├── true_false.json # 判断题(可选) +│ ├── short_answer.json # 简答题(可选) +│ ├── code_reading.json # 代码阅读题(可选) +│ └── scenario.json # 场景分析题(可选) +├── schema/ # Schema 与模板 +│ ├── question.schema.json # 题目 JSON Schema(Draft-07) +│ ├── prompt-template.md # LLM 生成提示词模板 +│ └── templates/ # 各题型示例 +│ ├── single_choice.json +│ ├── multiple_choice.json +│ ├── true_false.json +│ ├── fill_blank.json +│ ├── short_answer.json +│ ├── code_reading.json +│ └── scenario.json +├── docs/ # 文档 +│ ├── requirements.md # 需求文档 +│ └── architecture.md # 架构文档(本文件) +├── .gitignore # 排除 .ref/ +└── README.md +``` + +## 3. 数据模型 + +### 3.1 主题索引 — `topics/index.json` + +```json +{ + "version": "1.0.0", + "updated": "2026-09-02", + "topics": [ + { + "slug": "gc-jvm", + "name": "GC / JVM / 三色标记", + "description": "...", + "path": "topics/gc-jvm", + "stats": { + "total": 20, + "by_type": { "fill_blank": 10, "single_choice": 10 } + } + } + ] +} +``` + +前端加载此文件渲染主题列表,`stats` 字段用于展示题目数量。 + +### 3.2 主题元信息 — `topics/{slug}/meta.json` + +```json +{ + "slug": "gc-jvm", + "name": "GC / JVM / 三色标记", + "description": "JVM 堆内存模型、GC 算法、三色标记法、垃圾收集器", + "tags": ["jvm", "gc", "heap"], + "difficulty_range": [1, 5], + "schema_version": "1.0.0", + "question_files": ["fill_blank", "single_choice"], + "stats": { + "total": 20, + "by_type": { "fill_blank": 10, "single_choice": 10 } + } +} +``` + +- `question_files` 列出该主题包含的题型文件名(不含 `.json` 后缀) +- 前端根据此列表动态加载对应的题目文件 +- `stats` 在每次生成/追加题目后由 Agent 更新 + +### 3.3 题目文件 — `topics/{slug}/{type}.json` + +```json +{ + "topic": "gc-jvm", + "type": "fill_blank", + "schema_version": "1.0.0", + "generated": "2026-09-02T00:00:00Z", + "questions": [ /* 题目数组 */ ] +} +``` + +每种题型一个文件,支持多 Agent 并行写入不同题型文件而无冲突。 + +### 3.4 题目对象 + +#### 公共字段(所有题型必有) + +| 字段 | 类型 | 必填 | 说明 | +|------|------|------|------| +| `id` | string | ✅ | 格式 `{type_short}-{seq}`,如 `fb-001` | +| `type` | enum | ✅ | 题型标识 | +| `difficulty` | integer | ✅ | 1-5 | +| `tags` | string[] | ✅ | 细粒度知识点标签 | +| `question` | string | ✅ | 题干 | +| `explanation` | string | ✅ | 解析 | +| `source` | string | ❌ | 来源 | +| `related` | string[] | ❌ | 关联题目 id | + +#### 填空题 (`fill_blank`) + +```json +{ + "answer": ["老", "Old"], + "answer_rule": "any" +} +``` + +- `answer`: string[],可接受的答案列表 +- `answer_rule`: `"any"`(任一匹配) | `"all"`(全部匹配) | `"ordered"`(按序匹配) + +#### 单选题 (`single_choice`) + +```json +{ + "options": { "A": "选项A", "B": "选项B", "C": "选项C", "D": "选项D" }, + "answer": "B" +} +``` + +#### 多选题 (`multiple_choice`) + +```json +{ + "options": { "A": "...", "B": "...", "C": "...", "D": "..." }, + "answer": ["A", "C"] +} +``` + +#### 判断题 (`true_false`) + +```json +{ "answer": true } +``` + +#### 简答题 (`short_answer`) + +```json +{ + "answer": "参考答案文本", + "keywords": ["关键词1", "关键词2"], + "scoring_rubric": "评分标准说明" +} +``` + +#### 代码阅读题 (`code_reading`) + +```json +{ + "code": "int x = 1;\nprintf(\"%d\", x);", + "language": "c", + "sub_questions": [ + { "index": 1, "type": "single_choice", "question": "...", "options": {...}, "answer": "A", "explanation": "..." } + ] +} +``` + +#### 场景分析题 (`scenario`) + +```json +{ + "context": "一个电商系统在高峰期出现超卖问题...", + "code": null, + "sub_questions": [ + { "index": 1, "type": "short_answer", "question": "...", "answer": "...", "keywords": [...], "explanation": "..." } + ] +} +``` + +### 3.5 ID 编码规则 + +``` +{type_short}-{sequence} + fb - 001 +``` + +| type_short | 题型 | +|------------|------| +| `sc` | single_choice | +| `mc` | multiple_choice | +| `tf` | true_false | +| `fb` | fill_blank | +| `sa` | short_answer | +| `cr` | code_reading | +| `sn` | scenario | + +## 4. 前端架构 + +### 4.1 页面结构 + +``` +┌──────────────────────────────────────────┐ +│ Header: 🎯 CS 知识应试强化 │ +├────────────┬─────────────────────────────┤ +│ Sidebar │ Main Content │ +│ │ │ +│ 📚 主题 │ ┌─ Toolbar ──────────────┐ │ +│ · gc-jvm │ │ 进度 ✅ ❌ ⏳ 按钮组 │ │ +│ · ai-so │ └────────────────────────┘ │ +│ · ai-mm │ ┌─ Progress Bar ─────────┐ │ +│ · ai-he │ └────────────────────────┘ │ +│ · ai-at │ ┌─ Question Card ────────┐ │ +│ │ │ #1 填空 ★★★ │ │ +│ ──────── │ │ 题干 [____] │ │ +│ 📥 导入 │ │ [检查] [显示答案] │ │ +│ │ │ 💡 解析... │ │ +│ │ └────────────────────────┘ │ +│ │ ┌─ Question Card ────────┐ │ +│ │ │ ... │ │ +│ │ └────────────────────────┘ │ +└────────────┴─────────────────────────────┘ +``` + +### 4.2 数据流 + +``` +页面加载 + │ + ▼ +fetch topics/index.json ──→ 渲染侧边栏主题列表 + │ + │ 用户点击主题 + ▼ +fetch topics/{slug}/meta.json ──→ 获取 question_files 列表 + │ + ▼ +fetch topics/{slug}/{type}.json (并行) ──→ 合并 questions 数组 + │ + ▼ +renderQuiz() ──→ 按题型渲染题目卡片 + │ + │ 用户交互(选择/输入/检查/显示答案) + ▼ +answers 状态更新 ──→ re-render ──→ 更新统计 +``` + +### 4.3 状态管理 + +```javascript +let topics = []; // 从 index.json 加载的主题列表 +let currentTopic = null; // 当前选中的主题 slug +let currentQuestions = []; // 当前主题的所有题目(合并自多个题型文件) +let answers = {}; // qId → { value, correct, revealed } +let customQuestions = []; // 通过导入功能临时添加的题目 +``` + +### 4.4 题型渲染逻辑 + +| 题型 | 渲染方式 | 判定逻辑 | +|------|----------|----------| +| fill_blank | 题干中的 `______` 替换为 `` | `matchFillAnswer()` 根据 `answer_rule` 匹配 | +| single_choice | 选项列表,radio 样式 | `value === answer` | +| multiple_choice | 选项列表,checkbox 样式 | 数组比较 | +| true_false | 两个大按钮 | `value === answer` | +| short_answer | `` | 关键词匹配(辅助) | +| code_reading | 代码块 + 子题列表 | 按子题类型分别判定 | +| scenario | 场景描述 + 子题列表 | 按子题类型分别判定 | + +## 5. 生成工作流 + +### 5.1 非 Agent 环境(手动 LLM 对话) + +1. 打开 `schema/prompt-template.md`,复制提示词模板 +2. 替换 `{topic_name}`、`{question_type}`、`{count}` 等变量 +3. 将提示词发送给 LLM(ChatGPT / Claude 等) +4. 获取 JSON 输出后,粘贴到对应题型文件中 +5. 更新 `meta.json` 的 `stats` 字段 +6. 刷新前端页面 + +### 5.2 Agent 环境(Claude Code Skill) + +``` +/examination generate --topic gc-jvm --type fill_blank --count 10 +/examination validate --file topics/gc-jvm/fill_blank.json +/examination batch-generate --topic gc-jvm --types fill_blank,single_choice +``` + +Skill 内部流程: +1. 读取 `meta.json` 获取主题上下文 +2. 调用 LLM 生成题目(使用 schema 约束) +3. 校验输出是否符合 `question.schema.json` +4. 写入对应题型文件 +5. 更新 `meta.json` 和 `index.json` 的 `stats` + +### 5.3 多 Agent 并行生成 + +``` +Agent 1 ──→ topics/gc-jvm/fill_blank.json +Agent 2 ──→ topics/gc-jvm/single_choice.json +Agent 3 ──→ topics/gc-jvm/multiple_choice.json +``` + +由于每种题型写入独立文件,多个 Agent 可并行生成同一主题的不同题型而无写冲突。 + +## 6. 扩展指南 + +### 新增主题 + +1. 创建 `topics/{new-slug}/` 目录 +2. 创建 `meta.json` +3. 按题型创建题目 JSON 文件 +4. 更新 `topics/index.json` + +### 新增题型 + +1. 在 `schema/question.schema.json` 的 `definitions.question.type.enum` 中添加新类型 +2. 添加对应的 `allOf` 条件分支定义字段约束 +3. 在前端 `typeLabel()` 中添加映射 +4. 在前端 `renderQuestionCard()` 中添加渲染逻辑 +5. 在 `schema/templates/` 中添加示例模板 diff --git a/docs/requirements.md b/docs/requirements.md new file mode 100644 index 0000000..af90ceb --- /dev/null +++ b/docs/requirements.md @@ -0,0 +1,85 @@ +# 需求文档 + +## 1. 项目背景 + +在 CS 领域的学习工作流中,缺少一环通过应试化手段强化知识理解的工具。需要覆盖的知识范围包括但不限于: + +- 计算机网络、操作系统等基础领域 +- JVM、GC 等运行时机制 +- 中间件(Redis、Kafka 等) +- AI / Agent 架构与工程实践 +- 以及其他任何 CS 相关的大领域 + +## 2. 核心目标 + +构建一套完整的 **题目生成 → 数据存储 → 前端训练** 工作流: + +1. **前端页面**:纯 HTML + CSS + JS 的单页应用,部署到自有服务器 +2. **数据存储**:通过 Git 仓库存储题目 JSON,按主题组织,按题型拆分文件 +3. **题目生成**: + - 提供推荐提示词模板,用于在非 Agent 的 LLM 对话中便捷生成 + - 提供 JSON Schema 标准,确保生成数据可校验 + - 沉淀为 Claude Code Skill,可在 Agent 环境中复用 +4. **自定义导入**:支持前端直接粘贴/上传 JSON,临时导入使用 + +## 3. 功能需求 + +### 3.1 前端页面 + +| 功能 | 说明 | +|------|------| +| 主题浏览 | 侧边栏展示所有主题,含名称、描述、题目统计 | +| 做题交互 | 支持 7 种题型的渲染与交互 | +| 答案判定 | 检查答案对错,正确/错误视觉反馈 | +| 解析展示 | 显示正确答案和解析说明 | +| 全部显示 | 一键显示所有题目的答案 | +| 提交全部 | 一键判定所有题目的对错 | +| 重置 | 清除所有作答状态 | +| 进度统计 | 显示已答/正确/错误/待答数量和进度条 | +| 自定义导入 | 弹窗粘贴 JSON 或上传文件,临时加入当前会话 | + +### 3.2 题型支持 + +| 题型 | 代号 | 交互方式 | +|------|------|----------| +| 单选题 | sc | 4 选 1,点击选项 | +| 多选题 | mc | 多选多,点击选项 | +| 判断题 | tf | 对/错 按钮 | +| 填空题 | fb | 输入框,支持答案匹配规则 | +| 简答题 | sa | 文本域,关键词匹配 | +| 代码阅读 | cr | 代码块 + 嵌套子题 | +| 场景分析 | sn | 场景描述 + 嵌套子题 | + +### 3.3 数据管理 + +| 功能 | 说明 | +|------|------| +| Git 存储 | 题目以 JSON 文件形式存储在 Git 仓库 | +| 按主题组织 | 每个主题一个独立目录 | +| 按题型拆分 | 同一主题下,每种题型一个 JSON 文件 | +| 多 Agent 并行 | 不同题型文件独立,支持多 Agent 并行生成无写冲突 | +| Meta 稳定 | 主题元信息(meta.json)与题目内容分离,一次生成后稳定 | + +### 3.4 生成与校验 + +| 功能 | 说明 | +|------|------| +| 提示词模板 | 提供标准化的 LLM 提示词,用于非 Agent 环境生成题目 | +| JSON Schema | 定义完整的题目 JSON Schema,用于格式校验 | +| Skill 复用 | 沉淀为 Claude Code Skill,支持 generate / validate / batch-generate | + +## 4. 非功能需求 + +| 维度 | 要求 | +|------|------| +| 技术栈 | 纯前端(HTML + CSS + JS),无后端依赖 | +| 部署 | 可部署到任意静态文件服务器 | +| 兼容性 | 现代浏览器,响应式布局(桌面 + 移动端) | +| 数据安全 | `.ref/` 参考数据不提交 Git | +| 可扩展 | 支持新增主题、新增题型,无需修改前端核心逻辑 | + +## 5. 约束 + +- 不使用任何前端框架(React/Vue 等),保持单文件 SPA +- 不依赖后端服务,数据通过 `fetch` 从本地 JSON 文件加载 +- 题目 ID 格式统一为 `{type_short}-{sequence}`(如 `fb-001`、`sc-003`) diff --git a/index.html b/index.html new file mode 100644 index 0000000..dfd6154 --- /dev/null +++ b/index.html @@ -0,0 +1,535 @@ + + + + + +🎯 CS 知识应试强化 + + + + + + 🎯 CS 知识应试强化 + 选择主题,开始训练 + + + + + 📚 主题列表 + + + 📥 导入题目 + + + + + 👋 欢迎 + 从左侧选择一个主题开始练习 + + + + + + + + 📥 导入题目 + 粘符合规范的 JSON 数据(topics 格式) + + — 或者 — + + 📁 选择 JSON 文件 + + + + 取消 + 导入 + + + + + + + diff --git a/schema/prompt-template.md b/schema/prompt-template.md new file mode 100644 index 0000000..2d5cd9f --- /dev/null +++ b/schema/prompt-template.md @@ -0,0 +1,250 @@ +# 题目生成提示词模板 + +## 使用方法 + +将以下提示词中的 `{变量}` 替换为实际内容,发送给 LLM。 + +--- + +## 提示词 + +你是一个计算机科学教育专家。请根据以下要求生成题目: + +**主题**: {topic_name} +**领域**: {domain_name} > {subdomain_name} +**题型**: {question_type} +**数量**: {count} +**难度范围**: {min_difficulty}-{max_difficulty} +**知识点标签**: {tags} + +### 输出格式要求 + +请严格按照以下 JSON Schema 输出,不要添加任何额外内容: + +```json +{ + "topic": "{topic_slug}", + "type": "{question_type}", + "schema_version": "1.0.0", + "generated": "{ISO-8601 timestamp}", + "questions": [ + // 根据题型填写,参见下方题型说明 + ] +} +``` + +### 题型说明 + +#### 单选题 (single_choice) + +- 4 个选项,只有 1 个正确答案 +- 选项应具有合理的干扰性 +- 解析应说明为什么正确答案正确,其他选项为什么错误 + +```json +{ + "id": "domain-subdomain-topic-sc-001", + "type": "single_choice", + "difficulty": 3, + "tags": ["tag1", "tag2"], + "question": "题目内容?", + "options": { + "A": "选项 A", + "B": "选项 B", + "C": "选项 C", + "D": "选项 D" + }, + "answer": "A", + "explanation": "详细解析...", + "source": null, + "related": [] +} +``` + +#### 多选题 (multiple_choice) + +- 4-6 个选项,2-3 个正确答案 +- 解析应说明每个选项的对错原因 + +```json +{ + "id": "domain-subdomain-topic-mc-001", + "type": "multiple_choice", + "difficulty": 3, + "tags": ["tag1", "tag2"], + "question": "以下哪些是正确的?(多选)", + "options": { + "A": "选项 A", + "B": "选项 B", + "C": "选项 C", + "D": "选项 D" + }, + "answer": ["A", "C"], + "explanation": "A 正确因为...,B 错误因为...,C 正确因为...,D 错误因为...", + "source": null, + "related": [] +} +``` + +#### 判断题 (true_false) + +- 陈述一个明确的事实或概念 +- answer 为 true 或 false +- 解析应解释为什么对或错 + +```json +{ + "id": "domain-subdomain-topic-tf-001", + "type": "true_false", + "difficulty": 2, + "tags": ["tag1", "tag2"], + "question": "判断以下陈述是否正确:某概念的描述。", + "answer": true, + "explanation": "该陈述正确/错误,因为...", + "source": null, + "related": [] +} +``` + +#### 填空题 (fill_blank) + +- 题目中用 `______` 标记空白处 +- answer 数组可包含多个可接受的答案 +- answer_rule: "any"(任一匹配)、"all"(全部匹配)、"ordered"(按顺序匹配) +- 解析应说明答案的来源和上下文 + +```json +{ + "id": "domain-subdomain-topic-fb-001", + "type": "fill_blank", + "difficulty": 3, + "tags": ["tag1", "tag2"], + "question": "______ 协议工作在 OSI 模型的第 ______ 层。", + "answer": ["HTTP", "7"], + "answer_rule": "ordered", + "explanation": "HTTP 是应用层协议,工作在 OSI 模型的第 7 层(应用层)。", + "source": null, + "related": [] +} +``` + +#### 简答题 (short_answer) + +- 提出开放性问题 +- 提供参考答案和评分关键词 +- keywords 用于自动评分匹配 +- scoring_rubric 描述评分标准 +- 解析应包含完整的回答思路 + +```json +{ + "id": "domain-subdomain-topic-sa-001", + "type": "short_answer", + "difficulty": 4, + "tags": ["tag1", "tag2"], + "question": "请简述某概念的原理和应用场景。", + "answer": "参考答案内容...", + "keywords": ["关键词1", "关键词2", "关键词3"], + "scoring_rubric": "答对核心原理得 60 分;举出应用场景得 20 分;说明优缺点得 20 分。", + "explanation": "完整解析...", + "source": null, + "related": [] +} +``` + +#### 代码阅读题 (code_reading) + +- 提供完整的代码片段 +- 设置 2-3 个子问题(可以是任何题型) +- 解析应逐步分析代码执行过程 + +```json +{ + "id": "domain-subdomain-topic-cr-001", + "type": "code_reading", + "difficulty": 4, + "tags": ["tag1", "tag2"], + "question": "阅读以下代码,回答问题。", + "code": "// 代码片段", + "language": "python", + "sub_questions": [ + { + "index": 1, + "type": "single_choice", + "question": "子问题 1", + "options": { "A": "...", "B": "...", "C": "...", "D": "..." }, + "answer": "A", + "explanation": "解析..." + }, + { + "index": 2, + "type": "short_answer", + "question": "子问题 2", + "answer": "参考答案", + "keywords": ["关键词"], + "explanation": "解析..." + } + ], + "explanation": "整体代码解析...", + "source": null, + "related": [] +} +``` + +#### 场景分析题 (scenario) + +- 描述一个实际的技术场景 +- 设置 2-3 个分析性子问题 +- 解析应提供系统性的分析框架 + +```json +{ + "id": "domain-subdomain-topic-sn-001", + "type": "scenario", + "difficulty": 5, + "tags": ["tag1", "tag2"], + "question": "请分析以下技术场景。", + "context": "详细场景描述...", + "code": null, + "sub_questions": [ + { + "index": 1, + "type": "short_answer", + "question": "分析性问题 1", + "answer": "参考答案", + "keywords": ["关键词"], + "scoring_rubric": "评分标准", + "explanation": "解析..." + }, + { + "index": 2, + "type": "multiple_choice", + "question": "选择性问题 2", + "options": { "A": "...", "B": "...", "C": "...", "D": "..." }, + "answer": ["A", "C"], + "explanation": "解析..." + } + ], + "explanation": "整体场景分析...", + "source": null, + "related": [] +} +``` + +### ID 命名规则 + +题目 ID 格式:`{domain}-{subdomain}-{topic}-{type_code}-{number}` + +- domain: 领域缩写(如 os, net, db, algo, ai) +- subdomain: 子领域缩写 +- topic: 主题缩写 +- type_code: 题型代码(sc/mc/tf/fb/sa/cr/sn) +- number: 三位数字序号(001-999) + +### 注意事项 + +1. 每道题必须包含完整的 explanation(解析) +2. 难度等级 1-5:1=基础概念,2=理解应用,3=分析综合,4=评价设计,5=创新拓展 +3. tags 应包含具体知识点,便于后续统计和筛选 +4. source 字段可填 null,如有参考资料请填写 +5. related 字段可填空数组,如有相关题目 ID 请填写 \ No newline at end of file diff --git a/schema/question.schema.json b/schema/question.schema.json new file mode 100644 index 0000000..a52fa7e --- /dev/null +++ b/schema/question.schema.json @@ -0,0 +1,334 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Examination Question Set", + "description": "CS 知识应试强化系统 - 题目集 JSON Schema", + "type": "object", + "required": ["topic", "type", "schema_version", "questions"], + "properties": { + "topic": { + "type": "string", + "description": "主题 slug" + }, + "type": { + "type": "string", + "enum": ["single_choice", "multiple_choice", "true_false", "fill_blank", "short_answer", "code_reading", "scenario"], + "description": "题目类型" + }, + "schema_version": { + "type": "string", + "const": "1.0.0" + }, + "generated": { + "type": "string", + "format": "date-time" + }, + "questions": { + "type": "array", + "items": { + "$ref": "#/definitions/question" + } + } + }, + "definitions": { + "question": { + "type": "object", + "required": ["id", "type", "difficulty", "tags", "question", "explanation"], + "properties": { + "id": { + "type": "string", + "pattern": "^(sc|mc|tf|fb|sa|cr|sn)-[0-9]{3}$", + "description": "题目唯一标识,格式: typecode-number(如 fb-001, sc-003)" + }, + "type": { + "type": "string", + "enum": ["single_choice", "multiple_choice", "true_false", "fill_blank", "short_answer", "code_reading", "scenario"] + }, + "difficulty": { + "type": "integer", + "minimum": 1, + "maximum": 5 + }, + "tags": { + "type": "array", + "items": { "type": "string" } + }, + "question": { + "type": "string" + }, + "explanation": { + "type": "string" + }, + "source": { + "type": ["string", "null"], + "default": null + }, + "related": { + "type": "array", + "items": { "type": "string" }, + "default": [] + }, + "options": { + "description": "选项(选择题类型)或 null" + }, + "answer": { + "description": "答案(根据题型不同而不同)" + }, + "answer_rule": { + "type": "string", + "enum": ["any", "all", "ordered"], + "default": "any", + "description": "填空题答案匹配规则" + }, + "keywords": { + "type": "array", + "items": { "type": "string" }, + "description": "简答题评分关键词" + }, + "scoring_rubric": { + "type": "string", + "description": "简答题评分标准" + }, + "code": { + "type": ["string", "null"], + "description": "代码片段(代码阅读题和场景题)" + }, + "language": { + "type": "string", + "description": "编程语言(代码阅读题必填)" + }, + "context": { + "type": "string", + "description": "场景描述(场景分析题必填)" + }, + "sub_questions": { + "type": "array", + "items": { + "$ref": "#/definitions/sub_question" + }, + "description": "子问题列表(代码阅读题和场景分析题)" + } + }, + "allOf": [ + { + "if": { "properties": { "type": { "const": "single_choice" } } }, + "then": { + "required": ["options", "answer"], + "properties": { + "options": { + "type": "object", + "patternProperties": { + "^[A-Z]$": { "type": "string" } + }, + "additionalProperties": false, + "minProperties": 2 + }, + "answer": { + "type": "string", + "pattern": "^[A-Z]$" + } + } + } + }, + { + "if": { "properties": { "type": { "const": "multiple_choice" } } }, + "then": { + "required": ["options", "answer"], + "properties": { + "options": { + "type": "object", + "patternProperties": { + "^[A-Z]$": { "type": "string" } + }, + "additionalProperties": false, + "minProperties": 2 + }, + "answer": { + "type": "array", + "items": { "type": "string", "pattern": "^[A-Z]$" }, + "minItems": 1, + "uniqueItems": true + } + } + } + }, + { + "if": { "properties": { "type": { "const": "true_false" } } }, + "then": { + "required": ["answer"], + "properties": { + "answer": { "type": "boolean" } + } + } + }, + { + "if": { "properties": { "type": { "const": "fill_blank" } } }, + "then": { + "required": ["answer"], + "properties": { + "answer": { + "type": "array", + "items": { "type": "string" }, + "minItems": 1 + }, + "answer_rule": { + "type": "string", + "enum": ["any", "all", "ordered"], + "default": "any" + } + } + } + }, + { + "if": { "properties": { "type": { "const": "short_answer" } } }, + "then": { + "required": ["answer"], + "properties": { + "answer": { "type": "string" }, + "keywords": { + "type": "array", + "items": { "type": "string" } + }, + "scoring_rubric": { "type": "string" } + } + } + }, + { + "if": { "properties": { "type": { "const": "code_reading" } } }, + "then": { + "required": ["code", "language", "sub_questions"], + "properties": { + "code": { "type": "string" }, + "language": { "type": "string" }, + "sub_questions": { + "type": "array", + "items": { "$ref": "#/definitions/sub_question" }, + "minItems": 1 + } + } + } + }, + { + "if": { "properties": { "type": { "const": "scenario" } } }, + "then": { + "required": ["context", "sub_questions"], + "properties": { + "context": { "type": "string" }, + "code": { "type": ["string", "null"] }, + "sub_questions": { + "type": "array", + "items": { "$ref": "#/definitions/sub_question" }, + "minItems": 1 + } + } + } + } + ] + }, + "sub_question": { + "type": "object", + "required": ["index", "type", "question", "answer", "explanation"], + "properties": { + "index": { + "type": "integer", + "minimum": 1 + }, + "type": { + "type": "string", + "enum": ["single_choice", "multiple_choice", "true_false", "fill_blank", "short_answer", "code_reading", "scenario"] + }, + "question": { "type": "string" }, + "answer": {}, + "explanation": { "type": "string" }, + "options": { + "type": "object", + "patternProperties": { + "^[A-Z]$": { "type": "string" } + }, + "additionalProperties": false + }, + "keywords": { + "type": "array", + "items": { "type": "string" } + }, + "scoring_rubric": { "type": "string" } + }, + "allOf": [ + { + "if": { "properties": { "type": { "const": "single_choice" } } }, + "then": { + "required": ["options"], + "properties": { + "options": { + "type": "object", + "patternProperties": { + "^[A-Z]$": { "type": "string" } + }, + "additionalProperties": false, + "minProperties": 2 + }, + "answer": { + "type": "string", + "pattern": "^[A-Z]$" + } + } + } + }, + { + "if": { "properties": { "type": { "const": "multiple_choice" } } }, + "then": { + "required": ["options"], + "properties": { + "options": { + "type": "object", + "patternProperties": { + "^[A-Z]$": { "type": "string" } + }, + "additionalProperties": false, + "minProperties": 2 + }, + "answer": { + "type": "array", + "items": { "type": "string", "pattern": "^[A-Z]$" }, + "minItems": 1, + "uniqueItems": true + } + } + } + }, + { + "if": { "properties": { "type": { "const": "true_false" } } }, + "then": { + "properties": { + "answer": { "type": "boolean" } + } + } + }, + { + "if": { "properties": { "type": { "const": "fill_blank" } } }, + "then": { + "properties": { + "answer": { + "type": "array", + "items": { "type": "string" }, + "minItems": 1 + } + } + } + }, + { + "if": { "properties": { "type": { "const": "short_answer" } } }, + "then": { + "properties": { + "answer": { "type": "string" }, + "keywords": { + "type": "array", + "items": { "type": "string" } + }, + "scoring_rubric": { "type": "string" } + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/schema/templates/code_reading.json b/schema/templates/code_reading.json new file mode 100644 index 0000000..baedcc5 --- /dev/null +++ b/schema/templates/code_reading.json @@ -0,0 +1,42 @@ +{ + "topic": "example-topic", + "type": "code_reading", + "schema_version": "1.0.0", + "generated": "2026-01-01T00:00:00Z", + "questions": [ + { + "id": "dom-sub-top-cr-001", + "type": "code_reading", + "difficulty": 4, + "tags": ["example", "template", "javascript"], + "question": "阅读以下 JavaScript 代码,回答子问题。", + "code": "function fibonacci(n) {\n if (n <= 1) return n;\n let a = 0, b = 1;\n for (let i = 2; i <= n; i++) {\n [a, b] = [b, a + b];\n }\n return b;\n}\n\nconsole.log(fibonacci(6));", + "language": "javascript", + "sub_questions": [ + { + "index": 1, + "type": "short_answer", + "question": "这段代码的输出是什么?", + "answer": "8", + "explanation": "fibonacci(6) 的计算过程:f(0)=0, f(1)=1, f(2)=1, f(3)=2, f(4)=3, f(5)=5, f(6)=8。最终输出 8。" + }, + { + "index": 2, + "type": "single_choice", + "question": "该算法的时间复杂度是什么?", + "options": { + "A": "O(1)", + "B": "O(n)", + "C": "O(n^2)", + "D": "O(2^n)" + }, + "answer": "B", + "explanation": "该实现使用迭代方式,for 循环执行 n-1 次,每次操作是常数时间,因此时间复杂度为 O(n)。" + } + ], + "explanation": "这段代码实现了斐波那契数列的迭代求解。与递归实现相比,迭代版本避免了重复计算,时间复杂度从 O(2^n) 降低到 O(n),空间复杂度为 O(1)。", + "source": null, + "related": [] + } + ] +} \ No newline at end of file diff --git a/schema/templates/fill_blank.json b/schema/templates/fill_blank.json new file mode 100644 index 0000000..95f4cdb --- /dev/null +++ b/schema/templates/fill_blank.json @@ -0,0 +1,20 @@ +{ + "topic": "example-topic", + "type": "fill_blank", + "schema_version": "1.0.0", + "generated": "2026-01-01T00:00:00Z", + "questions": [ + { + "id": "dom-sub-top-fb-001", + "type": "fill_blank", + "difficulty": 3, + "tags": ["example", "template"], + "question": "HTTP 协议默认使用 ______ 端口,HTTPS 默认使用 ______ 端口。", + "answer": ["80", "443"], + "answer_rule": "ordered", + "explanation": "HTTP 默认端口为 80,HTTPS 默认端口为 443。这是网络编程的基础知识。answer_rule 设为 ordered 表示答案顺序必须与题目中的空白顺序一致。", + "source": null, + "related": [] + } + ] +} \ No newline at end of file diff --git a/schema/templates/multiple_choice.json b/schema/templates/multiple_choice.json new file mode 100644 index 0000000..67e4b58 --- /dev/null +++ b/schema/templates/multiple_choice.json @@ -0,0 +1,26 @@ +{ + "topic": "example-topic", + "type": "multiple_choice", + "schema_version": "1.0.0", + "generated": "2026-01-01T00:00:00Z", + "questions": [ + { + "id": "dom-sub-top-mc-001", + "type": "multiple_choice", + "difficulty": 3, + "tags": ["example", "template"], + "question": "以下哪些选项是正确的?(多选)", + "options": { + "A": "正确选项一", + "B": "错误选项", + "C": "正确选项二", + "D": "错误选项", + "E": "正确选项三" + }, + "answer": ["A", "C", "E"], + "explanation": "A、C、E 是正确答案。B 和 D 是错误选项,需要考生具备全面的知识理解才能准确作答。", + "source": null, + "related": [] + } + ] +} \ No newline at end of file diff --git a/schema/templates/scenario.json b/schema/templates/scenario.json new file mode 100644 index 0000000..c5b3133 --- /dev/null +++ b/schema/templates/scenario.json @@ -0,0 +1,57 @@ +{ + "topic": "example-topic", + "type": "scenario", + "schema_version": "1.0.0", + "generated": "2026-01-01T00:00:00Z", + "questions": [ + { + "id": "dom-sub-top-sn-001", + "type": "scenario", + "difficulty": 5, + "tags": ["example", "template", "system-design"], + "question": "请分析以下技术场景并回答问题。", + "context": "某电商平台在双十一大促期间,订单量突然增长 10 倍,导致系统出现以下问题:1) 数据库响应时间从 50ms 飙升到 5s;2) 部分用户看到下单成功但实际未扣减库存;3) 消息队列积压超过 100 万条消息。系统架构为:Nginx -> Spring Boot 应用 -> MySQL 主从 -> RabbitMQ。", + "code": null, + "sub_questions": [ + { + "index": 1, + "type": "short_answer", + "question": "针对数据库响应缓慢问题,请提出至少三种优化方案。", + "answer": "1) 引入 Redis 缓存热点数据,减少数据库查询;2) 对订单表进行分库分表,分散读写压力;3) 读写分离,将读请求路由到从库;4) 优化慢 SQL,添加合适索引;5) 使用连接池并调优参数。", + "keywords": ["缓存", "分库分表", "读写分离", "索引", "连接池"], + "scoring_rubric": "每提出一种合理方案得 20 分,最高 100 分。方案需具体可行,不能只说概念。" + }, + { + "index": 2, + "type": "multiple_choice", + "question": "关于库存超卖问题,以下哪些是有效的解决方案?", + "options": { + "A": "使用 Redis 分布式锁控制库存扣减", + "B": "在数据库层面使用乐观锁(版本号机制)", + "C": "使用消息队列异步处理订单", + "D": "增加应用服务器数量", + "E": "使用 Redis 原子操作 DECR 实现库存预扣减" + }, + "answer": ["A", "B", "E"], + "explanation": "A 正确:分布式锁可以保证同一时刻只有一个请求能修改库存。B 正确:乐观锁通过版本号防止并发更新冲突。C 不直接解决超卖:异步处理可能加剧超卖。D 不解决:增加服务器不能解决并发竞争问题。E 正确:Redis DECR 是原子操作,可以保证扣减的原子性。" + }, + { + "index": 3, + "type": "single_choice", + "question": "对于消息队列积压问题,最优先的处理方式是?", + "options": { + "A": "增加消费者实例数量", + "B": "丢弃部分消息", + "C": "临时扩容消费者并优化消费逻辑", + "D": "重启消息队列服务" + }, + "answer": "C", + "explanation": "C 是最佳方案:临时扩容可以快速提升消费能力,同时优化消费逻辑(如批量处理、减少 IO)可以从根本上提升吞吐量。A 不够全面;B 会导致数据丢失;D 不能解决积压问题。" + } + ], + "explanation": "这是一个典型的高并发系统问题场景。核心挑战包括:数据库瓶颈、并发一致性、消息堆积。解决思路需要从缓存、数据库优化、分布式一致性、消息队列调优等多个维度综合考虑。", + "source": null, + "related": [] + } + ] +} \ No newline at end of file diff --git a/schema/templates/short_answer.json b/schema/templates/short_answer.json new file mode 100644 index 0000000..6fb4b6f --- /dev/null +++ b/schema/templates/short_answer.json @@ -0,0 +1,21 @@ +{ + "topic": "example-topic", + "type": "short_answer", + "schema_version": "1.0.0", + "generated": "2026-01-01T00:00:00Z", + "questions": [ + { + "id": "dom-sub-top-sa-001", + "type": "short_answer", + "difficulty": 4, + "tags": ["example", "template"], + "question": "请简述 TCP 三次握手的过程及其作用。", + "answer": "TCP 三次握手过程:1) 客户端发送 SYN 报文,seq=x;2) 服务器回复 SYN+ACK 报文,seq=y, ack=x+1;3) 客户端发送 ACK 报文,seq=x+1, ack=y+1。三次握手的目的是确认双方的发送和接收能力正常,同步初始序列号。", + "keywords": ["SYN", "ACK", "seq", "三次握手", "序列号"], + "scoring_rubric": "答对三次握手的完整流程得 60 分;正确说明每步的标志位得 20 分;说明握手目的得 20 分。", + "explanation": "三次握手是 TCP 建立连接的核心机制。第一次握手:客户端发送 SYN;第二次握手:服务器回复 SYN+ACK;第三次握手:客户端确认 ACK。这确保了双方都能发送和接收数据。", + "source": null, + "related": [] + } + ] +} \ No newline at end of file diff --git a/schema/templates/single_choice.json b/schema/templates/single_choice.json new file mode 100644 index 0000000..863b31f --- /dev/null +++ b/schema/templates/single_choice.json @@ -0,0 +1,25 @@ +{ + "topic": "example-topic", + "type": "single_choice", + "schema_version": "1.0.0", + "generated": "2026-01-01T00:00:00Z", + "questions": [ + { + "id": "dom-sub-top-sc-001", + "type": "single_choice", + "difficulty": 3, + "tags": ["example", "template"], + "question": "以下哪项是单选题的正确示例?", + "options": { + "A": "这是一个正确选项", + "B": "这是一个干扰选项", + "C": "这也是一个干扰选项", + "D": "这还是一个干扰选项" + }, + "answer": "A", + "explanation": "A 是正确答案,因为它是预设的正确选项。B、C、D 均为干扰项,用于测试考生的辨别能力。", + "source": null, + "related": [] + } + ] +} \ No newline at end of file diff --git a/schema/templates/true_false.json b/schema/templates/true_false.json new file mode 100644 index 0000000..191a8d4 --- /dev/null +++ b/schema/templates/true_false.json @@ -0,0 +1,19 @@ +{ + "topic": "example-topic", + "type": "true_false", + "schema_version": "1.0.0", + "generated": "2026-01-01T00:00:00Z", + "questions": [ + { + "id": "dom-sub-top-tf-001", + "type": "true_false", + "difficulty": 2, + "tags": ["example", "template"], + "question": "判断以下陈述是否正确:这是一个判断题的示例陈述。", + "answer": true, + "explanation": "该陈述是正确的。这是一个用于演示判断题格式的示例。", + "source": null, + "related": [] + } + ] +} \ No newline at end of file diff --git a/topics/ai-hallucination/fill_blank.json b/topics/ai-hallucination/fill_blank.json new file mode 100644 index 0000000..8897c4f --- /dev/null +++ b/topics/ai-hallucination/fill_blank.json @@ -0,0 +1,188 @@ +{ + "topic": "ai-hallucination", + "type": "fill_blank", + "schema_version": "1.0.0", + "generated": "2026-09-02T00:00:00Z", + "questions": [ + { + "id": "fb-001", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "在 Critic 架构流程中,执行 Agent 产出结果后,Critic Agent 提供评分和反馈,若未达标则反馈回 Agent 进行______。", + "explanation": "Critic 流程中,未达标时反馈返回给 Agent 修改后重新评估。", + "source": null, + "related": [], + "answer": [ + "修改" + ], + "answer_rule": "any" + }, + { + "id": "fb-002", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "Critic 评估维度中,准确性(Accuracy)的权重是______。", + "explanation": "准确性(事实正确性)在所有评估维度中权重最高,为 0.3。", + "source": null, + "related": [], + "answer": [ + "0.3" + ], + "answer_rule": "any" + }, + { + "id": "fb-003", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "三层评估体系由自动评估、AI 评估和______评估组成。", + "explanation": "三层评估:自动(Schema/测试/Lint)、AI(Critic 评分)、人工(Code Review/验收)。", + "source": null, + "related": [], + "answer": [ + "人工" + ], + "answer_rule": "any" + }, + { + "id": "fb-004", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "评分实现中,加权总分的通过阈值是______。", + "explanation": "评分系统要求加权总分 ≥ 0.8 才算通过。", + "source": null, + "related": [], + "answer": [ + "0.8" + ], + "answer_rule": "any" + }, + { + "id": "fb-005", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "当 AI 生成与客观事实不符的内容(如编造不存在的 API),这叫做______幻觉。", + "explanation": "事实性幻觉指生成与客观事实不符的内容,如编造不存在的函数或 API。", + "source": null, + "related": [], + "answer": [ + "事实性" + ], + "answer_rule": "any" + }, + { + "id": "fb-006", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "Context Engineering 的核心思想是用精准、充分的上下文来减少模型的______空间。", + "explanation": "Context Engineering 旨在通过提供精准上下文来最小化模型的猜测空间。", + "source": null, + "related": [], + "answer": [ + "猜测" + ], + "answer_rule": "any" + }, + { + "id": "fb-007", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "上下文组成包括:System Prompt、Knowledge Base、History 和______。", + "explanation": "四大组件:系统提示、知识库、对话历史和检索到的上下文(RAG)。", + "source": null, + "related": [], + "answer": [ + "Retrieved Context" + ], + "answer_rule": "any" + }, + { + "id": "fb-008", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "Sub-agent Adversarial Verify 中使用______投票来决定是否接受输出。", + "explanation": "系统使用多数投票:多数验证 Agent 通过则接受,否则重新生成。", + "source": null, + "related": [], + "answer": [ + "多数" + ], + "answer_rule": "any" + }, + { + "id": "fb-009", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "验证提示要求 Agent 对每个声明给出的裁决是:CONFIRMED、REFUTED 或______。", + "explanation": "每个声明的裁决为三选一:CONFIRMED(确认)、REFUTED(反驳)、UNCERTAIN(不确定)。", + "source": null, + "related": [], + "answer": [ + "UNCERTAIN" + ], + "answer_rule": "any" + }, + { + "id": "fb-010", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "RAG 的全称是 Retrieval ______ Generation。", + "explanation": "RAG 全称 Retrieval Augmented Generation(检索增强生成)。", + "source": null, + "related": [], + "answer": [ + "Augmented" + ], + "answer_rule": "any" + } + ] +} \ No newline at end of file diff --git a/topics/ai-hallucination/meta.json b/topics/ai-hallucination/meta.json new file mode 100644 index 0000000..66349cc --- /dev/null +++ b/topics/ai-hallucination/meta.json @@ -0,0 +1,28 @@ +{ + "slug": "ai-hallucination", + "name": "AI 幻觉 / 目标评价 / 规范", + "description": "幻觉分类、Critic 架构、Context Engineering、评估体系", + "tags": [ + "ai", + "hallucination", + "critic", + "context-engineering", + "rag" + ], + "difficulty_range": [ + 1, + 5 + ], + "schema_version": "1.0.0", + "question_files": [ + "fill_blank", + "single_choice" + ], + "stats": { + "total": 20, + "by_type": { + "fill_blank": 10, + "single_choice": 10 + } + } +} \ No newline at end of file diff --git a/topics/ai-hallucination/single_choice.json b/topics/ai-hallucination/single_choice.json new file mode 100644 index 0000000..b52992b --- /dev/null +++ b/topics/ai-hallucination/single_choice.json @@ -0,0 +1,218 @@ +{ + "topic": "ai-hallucination", + "type": "single_choice", + "schema_version": "1.0.0", + "generated": "2026-09-02T00:00:00Z", + "questions": [ + { + "id": "sc-001", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "Critic 评估维度中,完整性(Completeness)的权重是多少?", + "explanation": "完整性的权重是 0.25。", + "source": null, + "related": [], + "options": { + "A": "0.15", + "B": "0.2", + "C": "0.25", + "D": "0.3" + }, + "answer": "C" + }, + { + "id": "sc-002", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "以下哪项不属于自动评估层?", + "explanation": "Critic Agent 评分属于 AI 评估层,不属于自动评估层。", + "source": null, + "related": [], + "options": { + "A": "Schema 校验", + "B": "单测通过率", + "C": "Critic Agent 评分", + "D": "Lint 零告警" + }, + "answer": "C" + }, + { + "id": "sc-003", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "当 AI 生成内容与输入上下文不一致时(如文档说 A,回答说 B),属于哪种幻觉?", + "explanation": "忠实性幻觉指生成内容与输入上下文不一致。", + "source": null, + "related": [], + "options": { + "A": "事实性幻觉", + "B": "忠实性幻觉", + "C": "推理性幻觉", + "D": "指令性幻觉" + }, + "answer": "B" + }, + { + "id": "sc-004", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "以下哪项不是上下文组成的组成部分?", + "explanation": "模型参数不是上下文组成部分。上下文由 System Prompt、Knowledge Base、History 和 Retrieved Context 组成。", + "source": null, + "related": [], + "options": { + "A": "System Prompt", + "B": "Knowledge Base", + "C": "Model Parameters(模型参数)", + "D": "Retrieved Context" + }, + "answer": "C" + }, + { + "id": "sc-005", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "Hook 机制中,自动化检查的正确顺序是?", + "explanation": "正确顺序:Pre-commit Hook(类型检查)→ Lint Hook → 单测 Hook → 合并。", + "source": null, + "related": [], + "options": { + "A": "Lint → 类型检查 → 单测 → 合并", + "B": "类型检查 → Lint → 单测 → 合并", + "C": "单测 → 类型检查 → Lint → 合并", + "D": "类型检查 → 单测 → Lint → 合并" + }, + "answer": "B" + }, + { + "id": "sc-006", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "注入领域知识作为 Skill 的目的是什么?", + "explanation": "Skill 在 AI 不了解项目特定技术栈或业务领域时注入领域知识。", + "source": null, + "related": [], + "options": { + "A": "加速模型推理", + "B": "减少 token 使用", + "C": "帮助不了解项目特定技术栈或业务领域的 AI", + "D": "替代人类开发者" + }, + "answer": "C" + }, + { + "id": "sc-007", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "RAG 流程中,嵌入和向量检索之后的下一步是什么?", + "explanation": "RAG 流程:问题 → 嵌入 → 向量检索 → Top-K 文档 → 上下文组装 → LLM → 回答。", + "source": null, + "related": [], + "options": { + "A": "LLM 生成回答", + "B": "Top-K 文档检索", + "C": "上下文组装", + "D": "基于文档的回答" + }, + "answer": "B" + }, + { + "id": "sc-008", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "CLAUDE.md 示例中,接口使用什么前缀命名?", + "explanation": "CLAUDE.md 示例规定接口使用 I 前缀命名。", + "source": null, + "related": [], + "options": { + "A": "_interface", + "B": "I", + "C": "Int", + "D": "Interface" + }, + "answer": "B" + }, + { + "id": "sc-009", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "统一返回类使用什么格式?", + "explanation": "项目规范统一使用 Result 包装:{code, message, data}。", + "source": null, + "related": [], + "options": { + "A": "{status, error, result}", + "B": "{success, message, payload}", + "C": "{code, message, data}", + "D": "{result, description, body}" + }, + "answer": "C" + }, + { + "id": "sc-010", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "hallucination", + "critic" + ], + "question": "在 AI 辅助的瀑布模型中,进入下一阶段前必须完成什么?", + "explanation": "每个阶段需要人工验收后才能进入下一阶段。", + "source": null, + "related": [], + "options": { + "A": "AI 自验证", + "B": "自动化测试", + "C": "人工验收", + "D": "同行评审" + }, + "answer": "C" + } + ] +} \ No newline at end of file diff --git a/topics/ai-memory/fill_blank.json b/topics/ai-memory/fill_blank.json new file mode 100644 index 0000000..8502e4d --- /dev/null +++ b/topics/ai-memory/fill_blank.json @@ -0,0 +1,188 @@ +{ + "topic": "ai-memory", + "type": "fill_blank", + "schema_version": "1.0.0", + "generated": "2026-09-02T00:00:00Z", + "questions": [ + { + "id": "fb-001", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "Agent 记忆分层架构的四种记忆类型是:工作记忆、情景记忆、语义记忆和______记忆。", + "explanation": "记忆分层由工作记忆(短期)、情景记忆(中期)、语义记忆(长期)和程序性记忆组成。", + "source": null, + "related": [], + "answer": [ + "程序性" + ], + "answer_rule": "any" + }, + { + "id": "fb-002", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "记忆的正确流转顺序是:工作记忆 → 情景记忆 → 语义记忆 → ______记忆。", + "explanation": "工作记忆在会话结束后转为情景记忆,提炼为语义记忆,最终指导程序性记忆。", + "source": null, + "related": [], + "answer": [ + "程序性" + ], + "answer_rule": "any" + }, + { + "id": "fb-003", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "LRU 缓存使用什么数据结构组合来实现 O(1) 的访问和淘汰?", + "explanation": "LRU 使用双向链表维护顺序,哈希表实现 O(1) 查找。", + "source": null, + "related": [], + "answer": [ + "双向链表 + 哈希表" + ], + "answer_rule": "any" + }, + { + "id": "fb-004", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "混合记忆淘汰策略的评分公式是:score = α × 时间衰减(t) + β × 频率(f) + γ × ______(i)。", + "explanation": "混合策略综合考虑时间衰减、访问频率和重要性三个维度。", + "source": null, + "related": [], + "answer": [ + "重要性" + ], + "answer_rule": "any" + }, + { + "id": "fb-005", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "混合策略中,时间衰减通常使用什么数学函数计算?", + "explanation": "时间衰减函数如 e^(-λt),其中 t 是距上次访问的时间。", + "source": null, + "related": [], + "answer": [ + "e^(-λt)" + ], + "answer_rule": "any" + }, + { + "id": "fb-006", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "记忆系统中,余弦相似度超过______时触发冲突检测。", + "explanation": "语义相似度的余弦值 > 0.8 时,记忆对进入冲突检测。", + "source": null, + "related": [], + "answer": [ + "0.8" + ], + "answer_rule": "any" + }, + { + "id": "fb-007", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "部分记忆冲突消解中,当评分差值小于______时无法自动消解,需要向用户澄清。", + "explanation": "当评分差值 < 0.1 时,系统无法自动判定,需主动向用户确认。", + "source": null, + "related": [], + "answer": [ + "0.1" + ], + "answer_rule": "any" + }, + { + "id": "fb-008", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "完全记忆冲突的风险等级分为两类:______(危险)和安全。", + "explanation": "Critical 包括医疗、金融、生产环境配置等;Safe 包括代码风格、文档格式等。", + "source": null, + "related": [], + "answer": [ + "Critical" + ], + "answer_rule": "any" + }, + { + "id": "fb-009", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "安全环境的 YAML 配置中,三条优先级规则的权重分别是:时间 0.4、来源 0.4、______ 0.2。", + "explanation": "安全环境使用时间(0.4)、来源优先级(0.4)和访问次数(0.2)。", + "source": null, + "related": [], + "answer": [ + "访问次数" + ], + "answer_rule": "any" + }, + { + "id": "fb-010", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "记忆冲突解决中,来源可信度的优先级顺序是:用户明确告知 > 从对话推断 > ______。", + "explanation": "用户明确告知的可信度最高,其次是对话推断,最后是自动生成。", + "source": null, + "related": [], + "answer": [ + "自动生成" + ], + "answer_rule": "any" + } + ] +} \ No newline at end of file diff --git a/topics/ai-memory/meta.json b/topics/ai-memory/meta.json new file mode 100644 index 0000000..0cd1470 --- /dev/null +++ b/topics/ai-memory/meta.json @@ -0,0 +1,28 @@ +{ + "slug": "ai-memory", + "name": "Agent 记忆管理 / 冲突处理", + "description": "记忆分层架构、淘汰策略、冲突检测与消解", + "tags": [ + "ai", + "memory", + "lru", + "lfu", + "conflict-resolution" + ], + "difficulty_range": [ + 1, + 5 + ], + "schema_version": "1.0.0", + "question_files": [ + "fill_blank", + "single_choice" + ], + "stats": { + "total": 20, + "by_type": { + "fill_blank": 10, + "single_choice": 10 + } + } +} \ No newline at end of file diff --git a/topics/ai-memory/single_choice.json b/topics/ai-memory/single_choice.json new file mode 100644 index 0000000..04321e0 --- /dev/null +++ b/topics/ai-memory/single_choice.json @@ -0,0 +1,218 @@ +{ + "topic": "ai-memory", + "type": "single_choice", + "schema_version": "1.0.0", + "generated": "2026-09-02T00:00:00Z", + "questions": [ + { + "id": "sc-001", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "哪种记忆类型代表历史交互记录?", + "explanation": "情景记忆(Episodic Memory)存储过去会话的历史交互记录。", + "source": null, + "related": [], + "options": { + "A": "工作记忆", + "B": "情景记忆", + "C": "语义记忆", + "D": "程序性记忆" + }, + "answer": "B" + }, + { + "id": "sc-002", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "LRU 淘汰策略的缺点是什么?", + "explanation": "LRU 不考虑访问频率——一次访问就能让条目「续命」。", + "source": null, + "related": [], + "options": { + "A": "实现复杂度高", + "B": "不考虑访问频率,一次访问就能「续命」", + "C": "历史热点问题", + "D": "O(n) 时间复杂度" + }, + "answer": "B" + }, + { + "id": "sc-003", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "「历史热点问题」与哪种策略相关?", + "explanation": "LFU 有历史热点问题:早期高频但后期不再使用的记忆难以被淘汰。", + "source": null, + "related": [], + "options": { + "A": "LRU 策略", + "B": "LFU 策略", + "C": "混合策略", + "D": "FIFO 策略" + }, + "answer": "B" + }, + { + "id": "sc-004", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "当两条记忆因上下文不同(如不同项目)而冲突时,应该使用哪种策略?", + "explanation": "上下文化策略:如果上下文不同(不同项目/时期),两条记忆都保留。", + "source": null, + "related": [], + "options": { + "A": "时间衰减", + "B": "来源可信度", + "C": "上下文化", + "D": "置信度加权" + }, + "answer": "C" + }, + { + "id": "sc-005", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "安全环境 YAML 配置中,来源优先级的权重是多少?", + "explanation": "来源优先级在安全环境配置中的权重是 0.4。", + "source": null, + "related": [], + "options": { + "A": "0.2", + "B": "0.3", + "C": "0.4", + "D": "0.5" + }, + "answer": "C" + }, + { + "id": "sc-006", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "在危险环境中,对于 Critical 级别的记忆冲突应该怎么做?", + "explanation": "危险环境中,系统停止自动决策,输出冲突记忆并等待人工决策。", + "source": null, + "related": [], + "options": { + "A": "按优先级规则自动采纳", + "B": "保留较新的记忆", + "C": "停止自动决策,输出两条冲突记忆,等待人工决策", + "D": "删除两条冲突记忆" + }, + "answer": "C" + }, + { + "id": "sc-007", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "除了余弦相似度,还有什么 NLP 技术用于冲突检测?", + "explanation": "NLI 矛盾检测与语义相似度一起用于冲突检测。", + "source": null, + "related": [], + "options": { + "A": "情感分析", + "B": "命名实体识别", + "C": "自然语言推理(NLI)矛盾检测", + "D": "词性标注" + }, + "answer": "C" + }, + { + "id": "sc-008", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "哪种记忆来源在冲突解决中可信度最高?", + "explanation": "用户明确告知(user_explicit)的可信度最高(importance=1.0)。", + "source": null, + "related": [], + "options": { + "A": "自动生成", + "B": "从对话推断", + "C": "用户确认过的推断", + "D": "用户明确告知" + }, + "answer": "D" + }, + { + "id": "sc-009", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "记忆存储结构中,哪个字段记录记忆被访问了多少次?", + "explanation": "access_count 字段记录记忆被访问的次数,用于频率计算。", + "source": null, + "related": [], + "options": { + "A": "last_accessed", + "B": "confidence", + "C": "access_count", + "D": "importance" + }, + "answer": "C" + }, + { + "id": "sc-010", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "memory", + "lru" + ], + "question": "在安全环境中,当优先级规则无法解决冲突时,回退策略是什么?", + "explanation": "安全环境中,优先级规则无法判定时的回退策略是 ask_user。", + "source": null, + "related": [], + "options": { + "A": "删除较旧的记忆", + "B": "保留两条记忆", + "C": "询问用户", + "D": "随机选择" + }, + "answer": "C" + } + ] +} \ No newline at end of file diff --git a/topics/ai-structured-output/fill_blank.json b/topics/ai-structured-output/fill_blank.json new file mode 100644 index 0000000..f38e361 --- /dev/null +++ b/topics/ai-structured-output/fill_blank.json @@ -0,0 +1,188 @@ +{ + "topic": "ai-structured-output", + "type": "fill_blank", + "schema_version": "1.0.0", + "generated": "2026-09-02T00:00:00Z", + "questions": [ + { + "id": "fb-001", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "JSON Mode 保证模型输出的内容是合法的 ______,但内容本身可能不正确。", + "explanation": "JSON Mode 强制输出合法 JSON,可靠性中等——格式正确但内容可能有误。", + "source": null, + "related": [], + "answer": [ + "JSON 格式" + ], + "answer_rule": "any" + }, + { + "id": "fb-002", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "Structured Output 基于什么技术来保证输出符合 Schema?", + "explanation": "Structured Output 使用受限解码,在每步 token 生成时屏蔽不合法的 token。", + "source": null, + "related": [], + "answer": [ + "受限解码(Constrained Decoding)" + ], + "answer_rule": "any" + }, + { + "id": "fb-003", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "在受限解码过程中,JSON Schema 首先被转换为有限状态自动机(FSA)或______。", + "explanation": "受限解码的第一步是将 JSON Schema 转换为 FSA 或 CFG 来追踪合法 token 状态。", + "source": null, + "related": [], + "answer": [ + "上下文无关文法(CFG)" + ], + "answer_rule": "any" + }, + { + "id": "fb-004", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "Agent 系统的核心循环是:用户输入 → 规划 → 执行 → ______ →(未完成则循环)→ 最终结果。", + "explanation": "Agent 核心循环:User Input → Planning → Execution → Observation → 循环 → Final Result。", + "source": null, + "related": [], + "answer": [ + "观察" + ], + "answer_rule": "any" + }, + { + "id": "fb-005", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "哪种 Agent 模式在执行后进行自我反思,失败时调整策略?", + "explanation": "Reflexion 模式在执行后自我反思,失败时调整策略,适合需要试错的任务。", + "source": null, + "related": [], + "answer": [ + "Reflexion" + ], + "answer_rule": "any" + }, + { + "id": "fb-006", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "ReAct 模式中,Agent 遵循的步骤序列是:思考 → 行动 → 观察 → 思考 → ... → ______。", + "explanation": "ReAct 交替进行推理和行动,直到得出最终回答(Answer)。", + "source": null, + "related": [], + "answer": [ + "回答" + ], + "answer_rule": "any" + }, + { + "id": "fb-007", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "工具链设计中,哪个原则确保相同输入无论调用多少次都产生相同结果?", + "explanation": "幂等性(Idempotency)意味着相同输入多次调用产生相同结果。", + "source": null, + "related": [], + "answer": [ + "幂等性" + ], + "answer_rule": "any" + }, + { + "id": "fb-008", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "对于删除、支付等敏感操作,Agent 工具链推荐使用什么机制?", + "explanation": "敏感操作应使用人工确认(Human-in-the-Loop)来防止意外的破坏性操作。", + "source": null, + "related": [], + "answer": [ + "Human-in-the-Loop(HITL)/ 人工确认" + ], + "answer_rule": "any" + }, + { + "id": "fb-009", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "哪种结构化输出方法灵活性最高但延迟也最高?", + "explanation": "分步生成(先生成骨架再填充)灵活性最高、可靠性高,但延迟最高。", + "source": null, + "related": [], + "answer": [ + "分步生成" + ], + "answer_rule": "any" + }, + { + "id": "fb-010", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "三种低延迟的结构化输出方法是:JSON Mode、Structured Output 和______。", + "explanation": "JSON Mode、Structured Output 和 Function Calling 都具有低延迟特性。", + "source": null, + "related": [], + "answer": [ + "Function Calling" + ], + "answer_rule": "any" + } + ] +} \ No newline at end of file diff --git a/topics/ai-structured-output/meta.json b/topics/ai-structured-output/meta.json new file mode 100644 index 0000000..0b49be5 --- /dev/null +++ b/topics/ai-structured-output/meta.json @@ -0,0 +1,29 @@ +{ + "slug": "ai-structured-output", + "name": "AI 结构化输出 / Agent 架构", + "description": "结构化输出方法、Agent 模式、受限解码", + "tags": [ + "ai", + "structured-output", + "agent", + "constrained-decoding", + "react", + "reflexion" + ], + "difficulty_range": [ + 1, + 5 + ], + "schema_version": "1.0.0", + "question_files": [ + "fill_blank", + "single_choice" + ], + "stats": { + "total": 20, + "by_type": { + "fill_blank": 10, + "single_choice": 10 + } + } +} \ No newline at end of file diff --git a/topics/ai-structured-output/single_choice.json b/topics/ai-structured-output/single_choice.json new file mode 100644 index 0000000..e956200 --- /dev/null +++ b/topics/ai-structured-output/single_choice.json @@ -0,0 +1,218 @@ +{ + "topic": "ai-structured-output", + "type": "single_choice", + "schema_version": "1.0.0", + "generated": "2026-09-02T00:00:00Z", + "questions": [ + { + "id": "sc-001", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "哪种结构化输出方法能 100% 保证符合 Schema?", + "explanation": "Structured Output 使用受限解码屏蔽非法 token,保证 100% 符合 Schema。", + "source": null, + "related": [], + "options": { + "A": "JSON Mode", + "B": "Structured Output(受限解码)", + "C": "后处理 + 重试", + "D": "分步生成" + }, + "answer": "B" + }, + { + "id": "sc-002", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "哪种 Agent 模式最适合需要全局规划后再执行的复杂任务?", + "explanation": "Plan-and-Execute 先制定完整计划,再逐步执行,适合需要全局规划的复杂任务。", + "source": null, + "related": [], + "options": { + "A": "ReAct", + "B": "Reflexion", + "C": "Plan-and-Execute", + "D": "Multi-Agent" + }, + "answer": "C" + }, + { + "id": "sc-003", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "哪种 Agent 模式最适合步骤不确定的通用任务?", + "explanation": "ReAct 交替进行推理和行动,灵活应对步骤不确定的通用任务。", + "source": null, + "related": [], + "options": { + "A": "Plan-and-Execute", + "B": "Reflexion", + "C": "Critic/Verifier", + "D": "ReAct" + }, + "answer": "D" + }, + { + "id": "sc-004", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "哪种结构化输出方法可靠性中等、灵活性高?", + "explanation": "JSON Mode 可靠性中等(格式对但内容可能错)、灵活性高、延迟低。", + "source": null, + "related": [], + "options": { + "A": "Structured Output", + "B": "Function Calling", + "C": "JSON Mode", + "D": "分步生成" + }, + "answer": "C" + }, + { + "id": "sc-005", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "哪种 Agent 模式包含两个独立的 Agent——一个执行、一个审查?", + "explanation": "Critic/Verifier 模式使用执行 Agent + 审查 Agent 来实现高可靠性。", + "source": null, + "related": [], + "options": { + "A": "ReAct", + "B": "Multi-Agent", + "C": "Critic/Verifier", + "D": "Reflexion" + }, + "answer": "C" + }, + { + "id": "sc-006", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "以下哪些结构化输出方法的可靠性为「高」?", + "explanation": "Structured Output、Function Calling 和分步生成可靠性都为「高」。", + "source": null, + "related": [], + "options": { + "A": "JSON Mode 和后处理+重试", + "B": "Structured Output、Function Calling 和分步生成", + "C": "仅 Structured Output", + "D": "所有五种方法" + }, + "answer": "B" + }, + { + "id": "sc-007", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "严格的 JSON Schema 应该包含哪些约束?", + "explanation": "最佳实践推荐使用 required、enum 约束和 additionalProperties: false。", + "source": null, + "related": [], + "options": { + "A": "additionalProperties: true,无 required 字段", + "B": "required、enum 和 additionalProperties: false", + "C": "仅 type 定义,无约束", + "D": "所有字段使用通配符" + }, + "answer": "B" + }, + { + "id": "sc-008", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "后处理+重试方法的可靠性等级是?", + "explanation": "后处理+重试可靠性中等——解析失败触发重试,但不能保证正确性,延迟也不确定。", + "source": null, + "related": [], + "options": { + "A": "高", + "B": "中", + "C": "低", + "D": "不确定" + }, + "answer": "B" + }, + { + "id": "sc-009", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "哪种 Agent 模式涉及多个 Agent 协作,各司其职?", + "explanation": "Multi-Agent 使用多个 Agent 协作,各自承担专门角色,适合复杂系统。", + "source": null, + "related": [], + "options": { + "A": "ReAct", + "B": "Reflexion", + "C": "Plan-and-Execute", + "D": "Multi-Agent" + }, + "answer": "D" + }, + { + "id": "sc-010", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "structured-output", + "agent" + ], + "question": "受限解码中,每步 token 生成时会发生什么?", + "explanation": "每步根据当前状态和 Schema 约束屏蔽非法 token,模型只能从合法 token 中采样。", + "source": null, + "related": [], + "options": { + "A": "模型生成任意 token 然后验证", + "B": "根据当前状态和 Schema 约束屏蔽非法 token", + "C": "模型输出完整 JSON 后校验", + "D": "独立的验证模型对每个 token 打分" + }, + "answer": "B" + } + ] +} \ No newline at end of file diff --git a/topics/ai-tooling/fill_blank.json b/topics/ai-tooling/fill_blank.json new file mode 100644 index 0000000..fe7ff48 --- /dev/null +++ b/topics/ai-tooling/fill_blank.json @@ -0,0 +1,188 @@ +{ + "topic": "ai-tooling", + "type": "fill_blank", + "schema_version": "1.0.0", + "generated": "2026-09-02T00:00:00Z", + "questions": [ + { + "id": "fb-001", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "Claude Code 是一个______ Agent,具有深度代码理解、工具调用和多文件编辑能力。", + "explanation": "Claude Code 是 CLI(命令行界面)Agent,专为复杂编码任务设计。", + "source": null, + "related": [], + "answer": [ + "CLI" + ], + "answer_rule": "any" + }, + { + "id": "fb-002", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "Harness 中的______管理器决定哪些操作需要用户确认,哪些可以自动执行。", + "explanation": "权限管理器(Permission Manager)控制哪些操作需要用户授权。", + "source": null, + "related": [], + "answer": [ + "权限(Permission)" + ], + "answer_rule": "any" + }, + { + "id": "fb-003", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "可靠性保障体系的三个层次是:预防、检测和______。", + "explanation": "可靠性体系由预防(Prevention)、检测(Detection)和纠正(Correction)三层组成。", + "source": null, + "related": [], + "answer": [ + "纠正" + ], + "answer_rule": "any" + }, + { + "id": "fb-004", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "Harness 中的______ Hook 在工具执行前检查参数合理性。", + "explanation": "preToolUse Hook 在工具执行前验证参数合理性。", + "source": null, + "related": [], + "answer": [ + "preToolUse" + ], + "answer_rule": "any" + }, + { + "id": "fb-005", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "根据面试笔记,AI 对重复性 CRUD 代码的提效倍数是______。", + "explanation": "AI 对 CRUD 代码的效率提升为 6 倍。", + "source": null, + "related": [], + "answer": [ + "6x" + ], + "answer_rule": "any" + }, + { + "id": "fb-006", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "Harness 中的______管理器维护对话历史、工具结果和文件状态。", + "explanation": "上下文管理器(Context Manager)维护完整的对话上下文。", + "source": null, + "related": [], + "answer": [ + "上下文(Context)" + ], + "answer_rule": "any" + }, + { + "id": "fb-007", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "工具选择原则中,______性意味着工具应具备良好的权限控制和审计能力。", + "explanation": "可控性(Controllability)强调工具应有良好的权限控制和审计能力。", + "source": null, + "related": [], + "answer": [ + "可控" + ], + "answer_rule": "any" + }, + { + "id": "fb-008", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "Harness 中的______ Hook 在代码提交前运行 lint、测试和类型检查。", + "explanation": "preCommit Hook 在代码提交前运行自动化检查。", + "source": null, + "related": [], + "answer": [ + "preCommit" + ], + "answer_rule": "any" + }, + { + "id": "fb-009", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "在 Harness 流程中,LLM 处理输入后,下一个组件是______管理器。", + "explanation": "流程为:LLM → 工具管理器 → 权限管理器 → 执行。", + "source": null, + "related": [], + "answer": [ + "工具(Tool)" + ], + "answer_rule": "any" + }, + { + "id": "fb-010", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "______工程的核心是为 AI 系统提供精准的上下文。", + "explanation": "Context Engineering(上下文工程)专注于为 AI 提供精准上下文以提升表现。", + "source": null, + "related": [], + "answer": [ + "Context" + ], + "answer_rule": "any" + } + ] +} \ No newline at end of file diff --git a/topics/ai-tooling/meta.json b/topics/ai-tooling/meta.json new file mode 100644 index 0000000..0a55aee --- /dev/null +++ b/topics/ai-tooling/meta.json @@ -0,0 +1,28 @@ +{ + "slug": "ai-tooling", + "name": "AI 工具 / Harness / 综合", + "description": "AI 工具选型、Harness 架构、可靠性保障、提效分析", + "tags": [ + "ai", + "tools", + "harness", + "claude-code", + "reliability" + ], + "difficulty_range": [ + 1, + 5 + ], + "schema_version": "1.0.0", + "question_files": [ + "fill_blank", + "single_choice" + ], + "stats": { + "total": 20, + "by_type": { + "fill_blank": 10, + "single_choice": 10 + } + } +} \ No newline at end of file diff --git a/topics/ai-tooling/single_choice.json b/topics/ai-tooling/single_choice.json new file mode 100644 index 0000000..e044087 --- /dev/null +++ b/topics/ai-tooling/single_choice.json @@ -0,0 +1,218 @@ +{ + "topic": "ai-tooling", + "type": "single_choice", + "schema_version": "1.0.0", + "generated": "2026-09-02T00:00:00Z", + "questions": [ + { + "id": "sc-001", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "哪个 AI 工具最适合复杂编码任务和项目级重构?", + "explanation": "Claude Code 专为复杂编码任务设计,具有深度代码理解和多文件编辑能力。", + "source": null, + "related": [], + "options": { + "A": "Cursor", + "B": "GitHub Copilot", + "C": "Claude Code", + "D": "ChatGPT" + }, + "answer": "C" + }, + { + "id": "sc-002", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "Harness 中状态管理器(State Manager)的核心功能是什么?", + "explanation": "状态管理器负责任务状态管理、进度追踪和错误恢复。", + "source": null, + "related": [], + "options": { + "A": "管理用户权限", + "B": "维护对话历史", + "C": "追踪任务状态、进度和错误恢复", + "D": "执行工具调用" + }, + "answer": "C" + }, + { + "id": "sc-003", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "可靠性保障体系的哪一层包含 Sub-agent 交叉验证和 Critic 评分?", + "explanation": "检测层包含 Sub-agent 交叉验证、Hook 自动检查和 Critic 评分。", + "source": null, + "related": [], + "options": { + "A": "预防层", + "B": "检测层", + "C": "纠正层", + "D": "监控层" + }, + "answer": "B" + }, + { + "id": "sc-004", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "Definition of Done(完成定义)建立的是什么?", + "explanation": "Definition of Done 定义任务「完成」的条件,避免主观判断。", + "source": null, + "related": [], + "options": { + "A": "何时终止 AI 系统", + "B": "任务开始前必须满足的完成条件", + "C": "错误处理流程", + "D": "性能基准" + }, + "answer": "B" + }, + { + "id": "sc-005", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "以下哪项不是 AI 工具选择的原则?", + "explanation": "工具选择原则为:能力匹配、可控性、可组合性、成本效益。速度优化不在其中。", + "source": null, + "related": [], + "options": { + "A": "能力匹配", + "B": "速度优化", + "C": "可组合性", + "D": "成本效益" + }, + "answer": "B" + }, + { + "id": "sc-006", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "AI 对代码 Review 的提效倍数是多少?", + "explanation": "AI 对代码 Review 的效率提升为 6 倍。", + "source": null, + "related": [], + "options": { + "A": "2x", + "B": "4x", + "C": "6x", + "D": "8x" + }, + "answer": "C" + }, + { + "id": "sc-007", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "权限管理器授权后,下一个执行的组件是什么?", + "explanation": "授权后执行操作,然后状态管理器更新状态。", + "source": null, + "related": [], + "options": { + "A": "上下文管理器", + "B": "工具管理器(执行)", + "C": "状态管理器", + "D": "Hook 管理器" + }, + "answer": "B" + }, + { + "id": "sc-008", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "「渐进式信任」方法的目的是什么?", + "explanation": "渐进式信任:从简单任务开始验证 AI 能力,随着信心增长逐步增加复杂度。", + "source": null, + "related": [], + "options": { + "A": "立即让 AI 处理所有任务", + "B": "从简单任务开始验证 AI 能力,逐步增加复杂度", + "C": "永久限制 AI 只做简单任务", + "D": "完全移除人工监督" + }, + "answer": "B" + }, + { + "id": "sc-009", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "哪个 AI 工具以广泛的语言支持和低延迟的代码补全著称?", + "explanation": "GitHub Copilot 以广泛的语言支持和低延迟著称。", + "source": null, + "related": [], + "options": { + "A": "Claude Code", + "B": "Cursor", + "C": "GitHub Copilot", + "D": "ChatGPT" + }, + "answer": "C" + }, + { + "id": "sc-010", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "ai", + "tools", + "harness" + ], + "question": "哪种方法论涉及将任务拆分为小的、可验证的子任务?", + "explanation": "Task Decomposition(任务拆解)将复杂任务拆分为小的、可验证的子任务。", + "source": null, + "related": [], + "options": { + "A": "Context Engineering", + "B": "Task Decomposition(任务拆解)", + "C": "Iterative Development", + "D": "Template Prompts" + }, + "answer": "B" + } + ] +} \ No newline at end of file diff --git a/topics/gc-jvm/fill_blank.json b/topics/gc-jvm/fill_blank.json new file mode 100644 index 0000000..639b717 --- /dev/null +++ b/topics/gc-jvm/fill_blank.json @@ -0,0 +1,188 @@ +{ + "topic": "gc-jvm", + "type": "fill_blank", + "schema_version": "1.0.0", + "generated": "2026-09-02T00:00:00Z", + "questions": [ + { + "id": "fb-001", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "JVM 堆内存分为两个主要代:新生代(Young Generation)和______代。", + "explanation": "JVM 堆主要分为新生代(包含 Eden 和 Survivor 空间)和老年代。", + "source": null, + "related": [], + "answer": [ + "老" + ], + "answer_rule": "any" + }, + { + "id": "fb-002", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "Eden、Survivor 0、Survivor 1 的默认比例是 ______。", + "explanation": "默认情况下,新生代按 8:1:1 的比例划分为 Eden、S0 和 S1。", + "source": null, + "related": [], + "answer": [ + "8:1:1" + ], + "answer_rule": "any" + }, + { + "id": "fb-003", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "新对象优先在新生代的 ______ 区分配。", + "explanation": "新对象优先在 Eden 区分配,Eden 区满时触发 Minor GC。", + "source": null, + "related": [], + "answer": [ + "Eden" + ], + "answer_rule": "any" + }, + { + "id": "fb-004", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "对象从新生代晋升到老年代的默认年龄阈值是 ______。", + "explanation": "经历 15 次 GC(默认)仍然存活的对象会被晋升到老年代。", + "source": null, + "related": [], + "answer": [ + "15" + ], + "answer_rule": "any" + }, + { + "id": "fb-005", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "当 Eden 区满时,会触发 ______ GC。", + "explanation": "Minor GC(也叫 Young GC)在 Eden 区满时触发。", + "source": null, + "related": [], + "answer": [ + "Minor" + ], + "answer_rule": "any" + }, + { + "id": "fb-006", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "三色标记法中,已被扫描但子对象尚未全部处理完成的对象标记为______色。", + "explanation": "灰色对象已被扫描,但其子对象仍需处理。", + "source": null, + "related": [], + "answer": [ + "灰" + ], + "answer_rule": "any" + }, + { + "id": "fb-007", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "三色标记法中,尚未被扫描、将被回收的对象标记为______色。", + "explanation": "白色对象尚未被扫描,是回收的候选对象。", + "source": null, + "related": [], + "answer": [ + "白" + ], + "answer_rule": "any" + }, + { + "id": "fb-008", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "CMS 垃圾收集器使用______更新(Incremental Update)来解决并发标记期间的漏标问题。", + "explanation": "CMS 通过写屏障(Write Barrier)使用增量更新来追踪黑色对象新增对白色对象的引用。", + "source": null, + "related": [], + "answer": [ + "增量" + ], + "answer_rule": "any" + }, + { + "id": "fb-009", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "G1 垃圾收集器使用______(Snapshot At The Beginning)来解决漏标问题。", + "explanation": "G1 使用 SATB,在引用被覆盖前记录旧值。", + "source": null, + "related": [], + "answer": [ + "SATB" + ], + "answer_rule": "any" + }, + { + "id": "fb-010", + "type": "fill_blank", + "difficulty": 2, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "CMS 的四个阶段是:初始标记 → ______标记 → 重新标记 → 并发清除。", + "explanation": "CMS 四阶段:Initial Mark(STW)→ Concurrent Mark → Remark(STW)→ Concurrent Sweep。", + "source": null, + "related": [], + "answer": [ + "并发" + ], + "answer_rule": "any" + } + ] +} \ No newline at end of file diff --git a/topics/gc-jvm/meta.json b/topics/gc-jvm/meta.json new file mode 100644 index 0000000..26de3c7 --- /dev/null +++ b/topics/gc-jvm/meta.json @@ -0,0 +1,30 @@ +{ + "slug": "gc-jvm", + "name": "GC / JVM / 三色标记", + "description": "JVM 堆内存模型、GC 算法、三色标记法、垃圾收集器", + "tags": [ + "jvm", + "gc", + "heap", + "three-color-marking", + "cms", + "g1", + "zgc" + ], + "difficulty_range": [ + 1, + 5 + ], + "schema_version": "1.0.0", + "question_files": [ + "fill_blank", + "single_choice" + ], + "stats": { + "total": 20, + "by_type": { + "fill_blank": 10, + "single_choice": 10 + } + } +} \ No newline at end of file diff --git a/topics/gc-jvm/single_choice.json b/topics/gc-jvm/single_choice.json new file mode 100644 index 0000000..67824df --- /dev/null +++ b/topics/gc-jvm/single_choice.json @@ -0,0 +1,218 @@ +{ + "topic": "gc-jvm", + "type": "single_choice", + "schema_version": "1.0.0", + "generated": "2026-09-02T00:00:00Z", + "questions": [ + { + "id": "sc-001", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "以下哪个不是 JVM 的 GC 类型?", + "explanation": "三种主要 GC 类型是 Minor GC、Major GC 和 Full GC,没有 Super GC。", + "source": null, + "related": [], + "options": { + "A": "Minor GC", + "B": "Major GC", + "C": "Full GC", + "D": "Super GC" + }, + "answer": "D" + }, + { + "id": "sc-002", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "新生代通常使用哪种垃圾回收算法?", + "explanation": "新生代使用复制算法(Copying),高效处理短生命周期对象。", + "source": null, + "related": [], + "options": { + "A": "标记-清除", + "B": "标记-整理", + "C": "复制算法", + "D": "引用计数" + }, + "answer": "C" + }, + { + "id": "sc-003", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "哪个垃圾收集器以低停顿为目标,并使用增量更新?", + "explanation": "CMS(Concurrent Mark Sweep)以低停顿为目标,使用增量更新(Incremental Update)。", + "source": null, + "related": [], + "options": { + "A": "Serial", + "B": "Parallel Scavenge", + "C": "CMS", + "D": "G1" + }, + "answer": "C" + }, + { + "id": "sc-004", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "哪个垃圾收集器在 JDK 9 成为默认收集器,并支持停顿时间预测?", + "explanation": "G1(Garbage First)在 JDK 9 成为默认收集器,支持可预测的停顿时间。", + "source": null, + "related": [], + "options": { + "A": "Serial", + "B": "CMS", + "C": "G1", + "D": "ZGC" + }, + "answer": "C" + }, + { + "id": "sc-005", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "ZGC 的设计目标是停顿时间低于______。", + "explanation": "ZGC 设计目标是停顿时间低于 10ms,适合延迟敏感的应用。", + "source": null, + "related": [], + "options": { + "A": "100ms", + "B": "50ms", + "C": "10ms", + "D": "1ms" + }, + "answer": "C" + }, + { + "id": "sc-006", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "以下哪个属于 GC Root?", + "explanation": "静态字段是 GC Root。其他 GC Root 还包括虚拟机栈局部变量、final static 常量、JNI 引用、synchronized 持有的对象。", + "source": null, + "related": [], + "options": { + "A": "堆中的局部变量", + "B": "静态字段(static fields)", + "C": "Eden 区中的对象", + "D": "Survivor 区中的对象" + }, + "answer": "B" + }, + { + "id": "sc-007", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "并发标记期间,当一个白色对象被黑色对象新增引用时,会产生什么问题?", + "explanation": "这叫漏标(Missed Marking),存活对象可能因未被标记而被错误回收。", + "source": null, + "related": [], + "options": { + "A": "内存泄漏", + "B": "漏标", + "C": "栈溢出", + "D": "死锁" + }, + "answer": "B" + }, + { + "id": "sc-008", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "老年代使用哪种算法可以避免内存碎片,但 STW 时间更长?", + "explanation": "标记-整理(Mark-Compact)通过移动对象消除碎片,但移动操作导致更长的 STW。", + "source": null, + "related": [], + "options": { + "A": "复制算法", + "B": "标记-清除", + "C": "标记-整理", + "D": "引用计数" + }, + "answer": "C" + }, + { + "id": "sc-009", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "哪个垃圾收集器支持 Mixed GC 并使用 SATB?", + "explanation": "G1 支持 Mixed GC(同时收集新生代和老年代),并使用 SATB 进行并发标记。", + "source": null, + "related": [], + "options": { + "A": "Serial", + "B": "CMS", + "C": "G1", + "D": "Parallel Scavenge" + }, + "answer": "C" + }, + { + "id": "sc-010", + "type": "single_choice", + "difficulty": 3, + "tags": [ + "jvm", + "gc", + "heap" + ], + "question": "CMS 的初始标记(Initial Mark)阶段做什么?", + "explanation": "CMS 初始标记阶段(需要 STW)枚举 GC Roots 的直接引用,标记为灰色,建立起始快照。", + "source": null, + "related": [], + "options": { + "A": "回收所有垃圾", + "B": "枚举 GC Roots 直接引用并标记为灰色", + "C": "移动对象以压缩内存", + "D": "清除不可达对象" + }, + "answer": "B" + } + ] +} \ No newline at end of file diff --git a/topics/index.json b/topics/index.json new file mode 100644 index 0000000..0f945c2 --- /dev/null +++ b/topics/index.json @@ -0,0 +1,71 @@ +{ + "version": "1.0.0", + "updated": "2026-09-02", + "topics": [ + { + "slug": "gc-jvm", + "name": "GC / JVM / 三色标记", + "description": "JVM 堆内存模型、GC 算法、三色标记法、垃圾收集器", + "path": "topics/gc-jvm", + "stats": { + "total": 20, + "by_type": { + "fill_blank": 10, + "single_choice": 10 + } + } + }, + { + "slug": "ai-structured-output", + "name": "AI 结构化输出 / Agent 架构", + "description": "结构化输出方法、Agent 模式、受限解码", + "path": "topics/ai-structured-output", + "stats": { + "total": 20, + "by_type": { + "fill_blank": 10, + "single_choice": 10 + } + } + }, + { + "slug": "ai-memory", + "name": "Agent 记忆管理 / 冲突处理", + "description": "记忆分层架构、淘汰策略、冲突检测与消解", + "path": "topics/ai-memory", + "stats": { + "total": 20, + "by_type": { + "fill_blank": 10, + "single_choice": 10 + } + } + }, + { + "slug": "ai-hallucination", + "name": "AI 幻觉 / 目标评价 / 规范", + "description": "幻觉分类、Critic 架构、Context Engineering、评估体系", + "path": "topics/ai-hallucination", + "stats": { + "total": 20, + "by_type": { + "fill_blank": 10, + "single_choice": 10 + } + } + }, + { + "slug": "ai-tooling", + "name": "AI 工具 / Harness / 综合", + "description": "AI 工具选型、Harness 架构、可靠性保障、提效分析", + "path": "topics/ai-tooling", + "stats": { + "total": 20, + "by_type": { + "fill_blank": 10, + "single_choice": 10 + } + } + } + ] +} \ No newline at end of file
选择主题,开始训练
从左侧选择一个主题开始练习
粘符合规范的 JSON 数据(topics 格式)