diff --git a/README.md b/README.md index abfdfc4..bbe89eb 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,10 @@ materials/ ├── tools/ │ ├── check-portal.js # 自检:注册表里的每个入口在磁盘上是否真实存在 │ └── add-back-links.js # 给每个资料子页面注入 / 检查返回入口 -├── interview/ # 01 面试记录(目前为空,先放临时占位页) -│ └── index.html +├── interview/ # 01 面试记录(首页 = 汇总,进去就是默认打开的那一篇) +│ ├── index.html # 面经汇总:左侧面经导航 + 正文 + 右侧本页题目目录 +│ ├── assets/ # doc.css / doc.js / interviews.js(面经索引 = 左侧导航的数据源) +│ └── README.md # 结构说明与「新增一场面经」四步 ├── knowledge/ # 02 知识库(单点专题知识) │ ├── scenario/ # 系统设计场景题 │ ├── docker/ # Docker 专题知识库(14 章) @@ -37,8 +39,8 @@ materials/ | 路由 | 页面 | 说明 | |---|---|---| | `#/` | 首页 | 五个板块卡片、最近访问;按 12345 直达板块 | -| `#/interview` | 面试记录 | 空态:临时占位页入口 + 归档规划 | -| `#/interview/temp` | 占位页详情 | 登记在 `temp` 字段里的临时页也可路由 | +| `#/interview` | 面试记录 | 打开面经汇总 `interview/index.html`:默认第一篇 + 左侧面经导航(不再直接跳具体面经) | +| `#/interview/<面经>` | 面经汇总 | 同一页;读哪一篇由页面左侧的面经导航决定 | | `#/knowledge` | 知识库 | 5 份资料列表 | | `#/knowledge/<资料>` | 资料详情 | 简介、统计、目录结构、打开站点、复制路径 | | `#/sre` | SRE 工程师 | 1 份资料列表 | diff --git a/assets/portal.data.js b/assets/portal.data.js index 7e6fb33..90037b0 100644 --- a/assets/portal.data.js +++ b/assets/portal.data.js @@ -32,8 +32,8 @@ window.PORTAL_DATA = { accentSoft: '#fff4e3', tagline: '把每一场面经都变成可复用的题', desc: '存放收集到的面经、面试问题与复盘结论。按公司 / 岗位归档,题目可反哺到知识库与项目题库。', - status: 'building', - statusText: '筹备中', + status: 'active', + statusText: '1 份面经', tags: ['面经', '复盘', '题库'], todo: [ '按「公司 / 岗位 / 轮次」归档面经原文', @@ -41,12 +41,25 @@ window.PORTAL_DATA = { '答不上来的题打标,回流到知识库对应章节', '面试结束后 24h 内写复盘,避免记忆失真' ], - temp: { - path: 'interview/index.html', - name: '临时占位页', - desc: '板块还没内容时用这个页面顶着,后续替换为真正的面经列表。' - }, - entries: [] + entries: [ + { + id: 'dewu-2026-golang-1', + name: '得物 · Golang 开发 · 一面', + path: 'interview/index.html', + dir: 'interview', + desc: '面经汇总页默认打开的第一篇:2026-10-17 得物一面,15 题——InnoDB 的 MVCC 与幻读、建索引的判断标准、联合索引 (a, b, c) 的走法、覆盖索引与回表、为什么用 B+ 树、实习与项目追问、HTTP 与 gRPC 的场景划分、乐观锁与 CAS、一次 RAG 请求的完整路径、改写 / 召回 / 融合 / 重排、手撕「树的子结构」。左侧是该系列的面经导航,右侧是本题目录,答案折叠待补。', + tags: ['面经', '得物', 'Golang', '后端'], + badges: ['15 题 · 答案待补', '首页默认打开'], + stats: [['15', '题'], ['6', 'MySQL 题'], ['1', '场']], + files: [ + ['index.html', '面经汇总 + 默认打开的第一篇:15 题折叠、右侧题目目录'], + ['assets/interviews.js', '面经索引 window.INTERVIEWS,左侧导航由它渲染'], + ['assets/doc.css', '三栏布局样式(琥珀主色,与知识站点同一套设计变量)'], + ['assets/doc.js', '左侧导航、右侧目录、折叠计数、主题、打印展开'], + ['README.md', '结构说明与「新增一场面经」四步'] + ] + } + ] }, /* ------------------------------------------------------------------ 02 */ diff --git a/interview/README.md b/interview/README.md new file mode 100644 index 0000000..75d5c47 --- /dev/null +++ b/interview/README.md @@ -0,0 +1,62 @@ +# 面试记录(interview) + +面经汇总站:**左侧是全部面经,中间是当前这篇的正文,右侧是本页题目目录**。纯静态,双击 +`index.html` 就能看,不需要起服务。 + +## 结构 + +```text +interview/ +├── index.html # 汇总页 + 默认打开的第一篇(得物 Golang 一面) +├── assets/ +│ ├── interviews.js # 面经索引 window.INTERVIEWS —— 左侧导航由它渲染 +│ ├── doc.css # 三栏布局与折叠问答样式(与知识站点同一套设计变量) +│ └── doc.js # 左侧导航、右侧目录、折叠计数、主题、打印展开 +└── 2026-10-17-某公司-岗位-二面.html # 之后新增的面经,文件名带日期 +``` + +为什么第一篇是 `index.html` 而不是带日期的文件:这是用户要的「进面经模块默认就看第一篇」,同时避免同一份 +内容在汇总页和独立页里各存一份。新增的面经统统用带日期的文件名,不再往 `index.html` 里塞第二篇。 + +## 页面布局 + +| 区域 | 内容 | 来源 | +|---|---|---| +| 左侧 `.sidebar` | 面经导航(日期块 + 公司 · 岗位 + 轮次 / 题量 / 状态) | `assets/interviews.js` 的 `window.INTERVIEWS` | +| 中间 `.main-col > article` | 页头元数据、题目列表(`details.q`,答案折叠) | 页面自身的 HTML | +| 右侧 `.qtoc` | 本页题目微型目录,滚动高亮;宽度 ≤ 1340px 时隐藏 | 由 `doc.js` 从 `details.q` 生成 | + +窄屏(≤ 1080px)左侧导航变成抽屉,顶栏「☰ 面经」打开。打印 / 导出 PDF 时答案自动全部展开。 + +## 命名规范 + +- **首页**:`index.html`,放默认打开的那一篇(当前是得物一面),`` 指向 + `interviews.js` 里对应条目的 `id`。 +- **其余面经**:`YYYY-MM-DD-公司-岗位-轮次.html`,日期补齐到年,与页面 `.meta` 里的「时间」一致; + 公司、岗位用中文正名(`得物`、`Golang 开发`),轮次写「一面 / 二面 / 三面 / HR 面」。 + +## 新增一场面经(四步) + +1. 复制 `index.html` 为 `YYYY-MM-DD-公司-岗位-轮次.html`,放进 `interview/`。 +2. 改页头:``、`<meta name="description">`、`<body data-interview="新 id">`、面包屑、 + `.hero` 标题与概述、`.meta` 六项(时间 / 公司 / 岗位 / 轮次 / 题量 / 状态)。 +3. 换题目:把 `.qlist` 里的 `details.q` 整段替换,`id` 从 `q1` 连续编(题号一律从 1 开始, + 原记录的编号不抄进来),每题的考点标签写在 `.q-tags` 里;答案先写 + `<p class="ph"><b>答案待补。</b>…</p>` 占位。 +4. 登记索引:在 `assets/interviews.js` 的 `window.INTERVIEWS` 里加一项 + (`id` / `file` / `date` / `company` / `role` / `round` / `questions` / `status`), + 再在 `assets/portal.data.js` 的 `interview.entries` 里补一条,最后跑: + +```bash +node tools/check-portal.js +node tools/add-back-links.js --check +``` + +`index.html` 里的「加一场新面经」一节就是这四步的页面版,改流程时两边一起改。 + +## 校验 + +- `node tools/check-portal.js`:注册表里每个 path 是否真实存在。 +- `node tools/add-back-links.js --check`:子页面是否都能回到资料库(interview 页面自带 + `../index.html#/interview` 链接,会被跳过)。 +- 改完 `doc.js` 后 `node --check interview/assets/doc.js` 快速验语法。 diff --git a/interview/assets/doc.css b/interview/assets/doc.css new file mode 100644 index 0000000..23668c1 --- /dev/null +++ b/interview/assets/doc.css @@ -0,0 +1,228 @@ +/* ========================================================================== + interview · 面经站共用样式 + -------------------------------------------------------------------------- + 三栏阅读布局:左侧「面经导航」、中间正文、右侧「本页题目」微型目录。 + 与仓库内其它知识站点同一套设计变量,主色注入面经的琥珀色。 + ========================================================================== */ + +:root{ + --bg:#f4f6fa; --card:#ffffff; --ink:#17212e; --muted:#5f6f83; --line:#e3e8f0; --soft:#f7f9fc; + --brand:#b45309; --brand-soft:#fff4e3; --brand-ink:#8a3f06; + --ok:#0f9d6e; --ok-bg:#e9f8f2; --ok-line:#c3e9d9; + --warn:#b45309; --warn-bg:#fff8ec; --warn-line:#f5e2c0; + --danger:#c0392b; --danger-bg:#fdf0ee; --danger-line:#f4cfc9; + --tip:#0e7490; --tip-bg:#eef9fc; --tip-line:#c4e6f0; + --code-bg:#f7f9fc; --code-head:#eef2f8; --code-line:#e2e8f1; --code-ink:#2b3a52; + --accent:#d97706; + --shadow:0 4px 16px rgba(20,32,60,.07); --shadow-lg:0 14px 38px rgba(20,32,60,.12); + --mono:ui-monospace,SFMono-Regular,"JetBrains Mono",Menlo,Consolas,"Courier New",monospace; +} +html[data-theme="dark"]{ + color-scheme:dark; + --bg:#0e131a; --card:#161d27; --ink:#e7edf6; --muted:#93a3b8; --line:#25303d; --soft:#1a222c; + --brand:#fbbf24; --brand-soft:#2a2011; --brand-ink:#fcd34d; + --ok:#34d399; --ok-bg:#10291f; --ok-line:#1e4636; + --warn:#fbbf24; --warn-bg:#241f12; --warn-line:#3d3218; + --danger:#f87171; --danger-bg:#2a1614; --danger-line:#4a2420; + --tip:#67e8f9; --tip-bg:#0f2730; --tip-line:#1c4551; + --code-bg:#111823; --code-head:#18202c; --code-line:#26313f; --code-ink:#cfdcee; + --shadow:0 4px 16px rgba(0,0,0,.35); --shadow-lg:0 14px 38px rgba(0,0,0,.5); +} + +*{box-sizing:border-box} +html{scroll-behavior:smooth} +body{margin:0;background:var(--bg);color:var(--ink); + font:18px/1.8 -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif; + -webkit-font-smoothing:antialiased} +a{color:var(--brand);text-decoration:none} +a:hover{text-decoration:underline} + +/* ---------------- 顶栏 ---------------- */ +.topbar{position:sticky;top:0;z-index:50;background:color-mix(in srgb,var(--card) 93%,transparent); + backdrop-filter:blur(12px);border-bottom:1px solid var(--line)} +.tb-in{padding:11px 22px;display:flex;align-items:center;gap:12px;flex-wrap:wrap} +.brand{display:flex;align-items:center;gap:10px;font-weight:800;font-size:18px;color:var(--ink)} +.brand:hover{text-decoration:none} +.brand .logo{width:40px;height:40px;border-radius:11px;display:grid;place-items:center;color:#fff;font-size:17px; + font-weight:800;background:linear-gradient(135deg,#d97706,#b45309); + box-shadow:0 4px 12px rgba(180,83,9,.35);flex:0 0 auto} +.brand small{display:block;font-weight:500;font-size:13.2px;color:var(--muted);letter-spacing:.2px} +.spacer{flex:1} +.crumbs{font-size:15.6px;color:var(--muted);display:flex;align-items:center;gap:7px;flex-wrap:wrap} +.crumbs b{color:var(--ink);font-weight:700} +.crumbs .sep{opacity:.5} +.btn{font:inherit;font-size:15.6px;padding:9px 14px;border:1px solid var(--line);border-radius:10px; + background:var(--card);color:var(--ink);cursor:pointer;transition:.15s;white-space:nowrap; + text-decoration:none;display:inline-block} +.btn:hover{border-color:var(--brand);color:var(--brand);text-decoration:none} +.btn.primary{background:var(--brand);border-color:var(--brand);color:#fff} +.btn.primary:hover{filter:brightness(1.06);color:#fff} +.btn.mini{font-size:14.6px;padding:6px 11px;border-radius:9px} +#tocToggle{display:none} + +/* ---------------- 布局:面经导航 · 正文 · 本页题目 ---------------- */ +.layout{display:flex;align-items:flex-start;gap:22px;padding:22px 22px 90px} +.mask{display:none} + +.sidebar{flex:0 0 276px;width:276px;position:sticky;top:76px;max-height:calc(100vh - 100px);overflow:auto; + background:var(--card);border:1px solid var(--line);border-radius:15px;box-shadow:var(--shadow);padding:13px 11px} +.nav-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin:2px 7px 8px} +.nav-head h2{margin:0;font-size:13.2px;letter-spacing:.7px;text-transform:uppercase;color:var(--muted);font-weight:800} +.nav-head .n{font-size:12.6px;color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap} +.nav-hint{margin:0 7px 10px;font-size:12.8px;color:var(--muted);line-height:1.6} +.ivnav{display:flex;flex-direction:column;gap:3px} +.ivnav-a{display:flex;gap:9px;align-items:flex-start;padding:8px 9px;border-radius:9px; + border:1px solid transparent;color:var(--ink);line-height:1.45} +.ivnav-a:hover{background:var(--soft);border-color:var(--line);text-decoration:none} +.ivnav-a.active{background:var(--brand-soft);border-color:color-mix(in srgb,var(--brand) 32%,var(--line))} +.ivnav-a .d{flex:0 0 38px;text-align:center;border:1px solid var(--line);border-radius:7px; + background:var(--soft);padding:3px 0;line-height:1.3} +.ivnav-a .d b{display:block;font-size:12.6px;font-variant-numeric:tabular-nums;font-weight:800} +.ivnav-a .d small{display:block;font-size:10.4px;color:var(--muted)} +.ivnav-a.active .d{background:var(--brand);border-color:var(--brand)} +.ivnav-a.active .d b,.ivnav-a.active .d small{color:#fff} +.ivnav-a .m{flex:1;min-width:0} +.ivnav-a .m b{display:block;font-size:14.4px;font-weight:700;line-height:1.45} +.ivnav-a .m small{display:block;font-size:12.2px;color:var(--muted);margin-top:1px;line-height:1.5} +.ivnav-a.active .m b{color:var(--brand-ink)} +.side-foot{margin-top:11px;padding-top:10px;border-top:1px dashed var(--line); + display:flex;flex-direction:column;gap:7px} +.side-foot .btn{text-align:center;font-size:14.4px;padding:9px 8px} + +.main-col{flex:1 1 auto;min-width:0;display:flex;justify-content:center} +article{width:100%;max-width:980px;background:var(--card);border:1px solid var(--line); + border-radius:18px;padding:30px 38px 40px;box-shadow:var(--shadow)} +article > *:first-child{margin-top:0} + +/* ---------------- 右侧「本页题目」 ---------------- */ +.qtoc{flex:0 0 196px;width:196px;position:sticky;top:76px;max-height:calc(100vh - 100px);overflow:auto; + background:var(--card);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow);padding:12px 9px} +.qtoc-h{display:flex;align-items:baseline;justify-content:space-between;gap:6px;margin:0 6px 8px; + font-size:12.4px;letter-spacing:.6px;text-transform:uppercase;color:var(--muted);font-weight:800} +.qtoc-h b{color:var(--brand);font-size:13.4px;font-variant-numeric:tabular-nums} +.qtoc nav{display:flex;flex-direction:column;gap:1px} +.qtoc a{display:flex;gap:7px;align-items:flex-start;padding:4px 7px;border-radius:7px; + border-left:2px solid transparent;color:var(--muted);font-size:13.2px;line-height:1.5;font-weight:500} +.qtoc a .n{flex:0 0 17px;text-align:right;font-size:12.2px;font-weight:800; + font-variant-numeric:tabular-nums;color:var(--muted)} +.qtoc a .t{flex:1;min-width:0;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2; + -webkit-box-orient:vertical} +.qtoc a:hover{background:var(--soft);color:var(--brand);text-decoration:none} +.qtoc a.active{background:var(--brand-soft);color:var(--brand-ink);border-left-color:var(--brand)} +.qtoc a.active .n{color:var(--brand)} + +/* ---------------- 页头 / 元数据 ---------------- */ +.hero{background: + radial-gradient(900px 240px at 92% -30%,color-mix(in srgb,var(--accent) 20%,transparent),transparent), + radial-gradient(700px 220px at 4% -40%,color-mix(in srgb,var(--brand) 12%,transparent),transparent), + var(--card); + border:1px solid var(--line);border-radius:16px;padding:24px 26px;box-shadow:var(--shadow); + margin:0 0 20px;scroll-margin-top:82px} +.hero h1{margin:0 0 8px;font-size:32px;letter-spacing:-.4px;line-height:1.32} +.hero .sub{margin:0;color:var(--muted);font-size:16.4px;max-width:92ch} +.hero .sub b{color:var(--ink)} + +.meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(148px,1fr));gap:1px;background:var(--line); + border:1px solid var(--line);border-radius:13px;overflow:hidden;margin:18px 0 0} +.meta > div{background:var(--card);padding:11px 15px} +.meta dt{font-size:12.6px;color:var(--muted);letter-spacing:.6px;text-transform:uppercase;font-weight:700;margin:0} +.meta dd{margin:3px 0 0;font-size:17px;font-weight:700;line-height:1.45} +.meta dd small{display:block;font-size:13.4px;font-weight:500;color:var(--muted)} + +/* ---------------- 正文 ---------------- */ +h2{font-size:27px;letter-spacing:-.3px;margin:42px 0 14px;padding-bottom:9px;border-bottom:2px solid var(--line); + scroll-margin-top:82px;line-height:1.35} +h3{font-size:21.5px;margin:32px 0 12px;scroll-margin-top:82px;letter-spacing:-.2px} +p{margin:0 0 13px} +ul,ol{margin:0 0 14px;padding-left:24px} +li{margin:0 0 7px} +li > ul,li > ol{margin-top:7px} +strong{color:var(--ink);font-weight:700} +hr{border:0;border-top:1px dashed var(--line);margin:30px 0} + +code{background:var(--code-bg);border:1px solid var(--code-line);border-radius:5px;padding:1.5px 5px; + font-family:var(--mono);font-size:15.2px;color:var(--code-ink);word-break:break-word} +pre{margin:0 0 18px;padding:15px 17px;overflow-x:auto;background:var(--code-bg);border:1px solid var(--code-line); + border-radius:12px;font-family:var(--mono);font-size:15.2px;line-height:1.75;color:var(--code-ink);tab-size:2} +pre code{background:none;border:0;padding:0;font-size:inherit;color:inherit;white-space:pre} + +/* 提示框 */ +.box{border:1px solid var(--line);border-left-width:4px;border-radius:11px;padding:14px 17px;margin:0 0 18px; + font-size:16.6px;background:var(--soft)} +.box > :last-child{margin-bottom:0} +.box .bt{display:block;font-weight:800;font-size:14.4px;letter-spacing:.5px;margin-bottom:6px;text-transform:uppercase} +.box p{margin:0 0 9px} +.box.note{background:var(--brand-soft);border-color:color-mix(in srgb,var(--brand) 30%,var(--line));border-left-color:var(--brand)} +.box.note .bt{color:var(--brand-ink)} +.box.warn{background:var(--warn-bg);border-color:var(--warn-line);border-left-color:var(--warn)} +.box.warn .bt{color:var(--warn)} +.box ol{margin-bottom:0} + +/* ---------------- 折叠问答 ---------------- */ +.qtool{display:flex;gap:9px;align-items:center;flex-wrap:wrap;margin:18px 0 14px} +.qtool .qcount{font-size:15px;color:var(--muted);font-weight:600} +.qtool .qcount b{color:var(--ink);font-variant-numeric:tabular-nums} + +.qlist{margin:0} +.q{border:1px solid var(--line);border-radius:14px;background:var(--card);margin:0 0 11px;overflow:hidden; + transition:border-color .15s,box-shadow .15s;scroll-margin-top:84px} +.q:hover{border-color:color-mix(in srgb,var(--brand) 40%,var(--line))} +.q[open]{border-color:color-mix(in srgb,var(--brand) 45%,var(--line));box-shadow:var(--shadow)} +.q > summary{list-style:none;cursor:pointer;padding:14px 17px;display:flex;gap:12px;align-items:flex-start; + transition:background .15s} +.q > summary::-webkit-details-marker{display:none} +.q > summary::marker{content:""} +.q > summary:hover{background:var(--soft)} +.q-no{display:inline-grid;place-items:center;min-width:30px;height:30px;padding:0 8px;flex:0 0 auto;margin-top:1px; + border-radius:9px;background:var(--brand-soft);border:1px solid color-mix(in srgb,var(--brand) 30%,var(--line)); + color:var(--brand-ink);font-size:14.4px;font-weight:800;font-variant-numeric:tabular-nums} +.q-main{flex:1;min-width:0} +.q-text{font-size:17.8px;font-weight:700;line-height:1.6;letter-spacing:-.1px} +.q > summary:hover .q-text{color:var(--brand)} +.q-tags{margin-top:5px;display:flex;gap:6px;flex-wrap:wrap} +.q-tag{font-size:12.6px;color:var(--muted);border:1px solid var(--line);background:var(--soft); + border-radius:999px;padding:0 9px;line-height:1.7} +.q-chev{flex:0 0 auto;margin-top:3px;width:22px;height:22px;display:grid;place-items:center;color:var(--muted); + font-size:18px;transition:transform .18s,color .18s} +.q[open] .q-chev{transform:rotate(90deg);color:var(--brand)} +.ans{padding:4px 17px 18px 59px;border-top:1px dashed var(--line);margin-top:2px;font-size:17.2px} +.ans > :first-child{margin-top:14px} +.ans > :last-child{margin-bottom:0} +.ans .ph{background:var(--soft);border:1px dashed var(--line);border-radius:10px;padding:12px 15px; + color:var(--muted);font-size:16.2px;line-height:1.8} +.ans .ph b{color:var(--warn)} + +/* ---------------- 页尾 ---------------- */ +.foot{margin-top:26px;text-align:center;font-size:14.6px;color:var(--muted);line-height:1.9} +#toTop{position:fixed;right:20px;bottom:20px;z-index:40;width:44px;height:44px;border-radius:50%; + border:1px solid var(--line);background:var(--card);color:var(--muted);box-shadow:var(--shadow-lg); + cursor:pointer;font-size:20px;display:none} +#toTop.show{display:grid;place-items:center} + +/* ---------------- 响应式 ---------------- */ +@media (max-width:1340px){ + .qtoc{display:none} +} +@media (max-width:1080px){ + .layout{display:block;padding:16px 14px 80px} + .sidebar{position:fixed;top:0;left:0;bottom:0;width:320px;max-height:none;border-radius:0;z-index:60; + transform:translateX(-104%);transition:transform .22s ease;padding-top:20px;overflow:auto} + .layout.toc-open .sidebar{transform:none} + .layout.toc-open .mask{display:block;position:fixed;inset:0;background:rgba(12,18,30,.42);z-index:55} + #tocToggle{display:inline-block} + article{padding:20px 16px 26px;border-radius:15px} + .hero{padding:18px 18px} + .hero h1{font-size:25px} + .q > summary{padding:12px 14px} + .q-text{font-size:16.6px} + .ans{padding:2px 14px 16px 14px} + .crumbs{display:none} +} +@media print{ + .topbar,.sidebar,.qtoc,.mask,#toTop,.qtool,.q-chev{display:none!important} + body{background:#fff;font-size:11.5pt} + .layout{display:block;padding:0} + article{border:0;box-shadow:none;padding:0;max-width:none} + .q{break-inside:avoid} + .box{break-inside:avoid} +} diff --git a/interview/assets/doc.js b/interview/assets/doc.js new file mode 100644 index 0000000..47376de --- /dev/null +++ b/interview/assets/doc.js @@ -0,0 +1,220 @@ +/* ========================================================================== + interview · 面经站交互 + -------------------------------------------------------------------------- + 1. 主题:与资料库导航页共用 localStorage 里的选择 + 2. 左侧面经导航:从 assets/interviews.js 渲染,高亮当前这篇 + 3. 右侧「本页题目」:从页面里的 details.q 生成,滚动时高亮 + 4. 折叠问答:展开计数、全部展开 / 收起、打印时全展开、#qN 直达 + ==========================================================================*/ +(function () { + "use strict"; + + var THEME_KEY = "materials.portal:theme"; + + function $(s, r) { return (r || document).querySelector(s); } + function $$(s, r) { return Array.prototype.slice.call((r || document).querySelectorAll(s)); } + function esc(s) { + return String(s == null ? "" : s).replace(/[&<>"]/g, function (c) { + return { "&": "&", "<": "<", ">": ">", '"': """ }[c]; + }); + } + + /* ------------------------- 主题 ------------------------- */ + function applyTheme(t) { + document.documentElement.setAttribute("data-theme", t); + var b = $("#themeBtn"); + if (b) b.textContent = t === "dark" ? "浅色" : "深色"; + try { localStorage.setItem(THEME_KEY, t); } catch (e) {} + } + + function initTheme() { + var t = document.documentElement.getAttribute("data-theme"); + if (t !== "light" && t !== "dark") t = "light"; + applyTheme(t); + var b = $("#themeBtn"); + if (b) { + b.addEventListener("click", function () { + applyTheme(document.documentElement.getAttribute("data-theme") === "dark" ? "light" : "dark"); + }); + } + } + + /* ------------------- 左侧:面经导航 ------------------- */ + function buildNav() { + var host = $("#ivnav"); + if (!host || !window.INTERVIEWS) return; + + var cur = document.body.getAttribute("data-interview") || ""; + var list = window.INTERVIEWS.slice().sort(function (a, b) { + return String(b.date).localeCompare(String(a.date)); + }); + + host.innerHTML = list.map(function (it) { + var date = String(it.date || ""); + var sub = [it.round, it.questions ? it.questions + " 题" : "", it.status || ""] + .filter(Boolean).join(" · "); + return '<a class="ivnav-a' + (it.id === cur ? " active" : "") + '" href="' + esc(it.file) + '"' + + (it.id === cur ? ' aria-current="page"' : "") + '>' + + '<span class="d"><b>' + esc(date.slice(5).replace("-", ".")) + '</b>' + + '<small>' + esc(date.slice(0, 4)) + '</small></span>' + + '<span class="m"><b>' + esc(it.company + " · " + it.role) + '</b>' + + '<small>' + esc(sub) + '</small></span>' + + '</a>'; + }).join(""); + + var n = $("#ivcount"); + if (n) n.textContent = list.length + " 篇"; + } + + /* ------------------- 右侧:本页题目 ------------------- */ + function buildToc() { + var box = $("#qtoc"); + var nav = $("#qtoc-nav"); + if (!box || !nav) return; + + var qs = $$("details.q"); + if (!qs.length) { box.hidden = true; return; } + + nav.innerHTML = qs.map(function (d) { + var no = d.querySelector(".q-no"); + var tx = d.querySelector(".q-text"); + return '<a href="#' + d.id + '"><span class="n">' + esc(no ? no.textContent.trim() : "") + '</span>' + + '<span class="t">' + esc(tx ? tx.textContent.trim() : "") + '</span></a>'; + }).join(""); + + var n = $("#qtoc-n"); + if (n) n.textContent = qs.length; + } + + /* ------------------------- 折叠问答 ------------------------- */ + function initQA() { + var qs = $$("details.q"); + if (!qs.length) return; + + var countEl = $("[data-open-count]"); + var totalEl = $("[data-total-count]"); + if (totalEl) totalEl.textContent = qs.length; + + function refreshCount() { + if (!countEl) return; + countEl.textContent = qs.filter(function (d) { return d.open; }).length; + } + + qs.forEach(function (d) { d.addEventListener("toggle", refreshCount); }); + refreshCount(); + + $$("[data-act]").forEach(function (btn) { + btn.addEventListener("click", function () { + var open = btn.getAttribute("data-act") === "expand"; + qs.forEach(function (d) { d.open = open; }); + refreshCount(); + }); + }); + + /* 打印 / 导出 PDF 时全部展开,打完恢复原本的展开状态 */ + var before = null; + window.addEventListener("beforeprint", function () { + before = qs.map(function (d) { return d.open; }); + qs.forEach(function (d) { d.open = true; }); + }); + window.addEventListener("afterprint", function () { + if (!before) return; + qs.forEach(function (d, i) { d.open = before[i]; }); + before = null; + }); + + /* 地址栏带 #q3 打开时,把那一条也展开 */ + function openFromHash() { + var h = location.hash.replace(/^#/, ""); + if (!h) return; + var d = document.getElementById(h); + if (d && d.tagName === "DETAILS") { d.open = true; refreshCount(); } + } + window.addEventListener("hashchange", openFromHash); + openFromHash(); + } + + /* ------------------- 右侧目录:滚动高亮 ------------------- */ + function spy() { + var links = $$("#qtoc-nav a[href^='#']"); + if (!links.length) return; + + var targets = links.map(function (a) { + return document.getElementById(a.getAttribute("href").slice(1)); + }).filter(Boolean); + if (!targets.length) return; + + var y = window.scrollY + 150; + var cur = targets[0]; + targets.forEach(function (el) { + if (el.getBoundingClientRect().top + window.scrollY <= y) cur = el; + }); + + links.forEach(function (a) { + var on = a.getAttribute("href") === "#" + cur.id; + a.classList.toggle("active", on); + if (on) centerActive(a); + }); + } + + function centerActive(a) { + var box = $("#qtoc"); + if (!box || box.scrollHeight <= box.clientHeight + 4) return; + var r = a.getBoundingClientRect(); + var b = box.getBoundingClientRect(); + if (r.top < b.top + 8 || r.bottom > b.bottom - 8) { + box.scrollTop += r.top - b.top - box.clientHeight * 0.35; + } + } + + /* ------------------------- 移动端抽屉 ------------------------- */ + function initDrawer() { + var layout = $("#layout"), mask = $("#mask"), toggle = $("#tocToggle"); + if (!layout) return; + if (toggle) { + toggle.addEventListener("click", function () { layout.classList.toggle("toc-open"); }); + } + if (mask) { + mask.addEventListener("click", function () { layout.classList.remove("toc-open"); }); + } + var sidebar = $(".sidebar"); + if (sidebar) { + sidebar.addEventListener("click", function (e) { + if (e.target.closest("a")) layout.classList.remove("toc-open"); + }); + } + } + + function initToTop() { + var btn = $("#toTop"); + if (!btn) return; + btn.addEventListener("click", function () { + window.scrollTo({ top: 0, behavior: "smooth" }); + }); + function onScroll() { btn.classList.toggle("show", window.scrollY > 480); } + window.addEventListener("scroll", onScroll, { passive: true }); + onScroll(); + } + + function init() { + initTheme(); + buildNav(); + buildToc(); + initQA(); + initDrawer(); + initToTop(); + spy(); + var ticking = false; + window.addEventListener("scroll", function () { + if (ticking) return; + ticking = true; + requestAnimationFrame(function () { ticking = false; spy(); }); + }, { passive: true }); + } + + if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", init); + } else { + init(); + } +})(); diff --git a/interview/assets/interviews.js b/interview/assets/interviews.js new file mode 100644 index 0000000..9055292 --- /dev/null +++ b/interview/assets/interviews.js @@ -0,0 +1,25 @@ +/* ============================================================================ + * 面经站 · 目录数据 + * ---------------------------------------------------------------------------- + * 左侧「面经导航」由本文件渲染(assets/doc.js 里的 buildNav())。 + * 新增一场面经:把页面文件放在本目录,再往这里加一项,侧栏和计数自动更新。 + * + * id 与页面 <body data-interview="…"> 一致,用来高亮当前这篇 + * file 相对 interview/ 的文件名(首页 index.html 也算一篇) + * date 面试日期,YYYY-MM-DD;侧栏按日期倒序排 + * round 一面 / 二面 / 三面 / HR 面 + * questions 题目数量;status 显示在侧栏的副标题里 + * ==========================================================================*/ +window.INTERVIEWS = [ + { + id: 'dewu-2026-golang-1', + file: 'index.html', + date: '2026-10-17', + company: '得物', + role: 'Golang 开发', + round: '一面', + title: '得物 · Golang 开发 · 一面', + questions: 15, + status: '答案待补' + } +]; diff --git a/interview/index.html b/interview/index.html index 3c2056c..a686844 100644 --- a/interview/index.html +++ b/interview/index.html @@ -3,71 +3,13 @@ <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> -<title>面试记录 · 筹备中(临时页) - - +面试记录 · 面经汇总 + + - +
-
- - - 面试记录interview / · 临时占位页 - +
-
-

这个板块还没有内容 筹备中

-
-

先用本页顶着,等第一份面经归档后替换成真正的面经列表。导航页里 interview 板块显示 - 「0 份资料」,就是因为它下面还没有登记条目。

-

当前目录:interview/(除本页外为空)。

-
+
+ +
-

建议的归档方式

-
-
interview/ -├── index.html # 面经总目录(未来替换本页) -├── 2025-字节-后端-一面.md -├── 2025-腾讯-Go-二面.md -└── questions.md
-
命名约定:YYYY-公司-岗位-轮次,一场面试一份文件 - (index.html 是总目录,questions.md 汇总抽出来的题目)。 - 正文按「流程 → 题目 → 我的答法 → 复盘结论」四段写,方便后续把答不上来的题回填到知识库。
-
+
+
+
+

得物 · Golang 开发 · 一面

+

2026-10-17 的一面,15 道题:前六问全在 InnoDB 里打转(MVCC、幻读、索引判断标准、 + 联合索引、覆盖索引、B+ 树),中间是实习与项目、HTTP 与 gRPC、乐观锁与 CAS, + 后半段转到 RAG 的检索链路,最后一题手撕「树的子结构」。左侧是全部面经,这里是默认打开的第一篇;答案先留占位,之后逐题补齐。

-

后续规划

-
-
    -
  • 按「公司 / 岗位 / 轮次」归档面经原文,先记流水账,不求文采
  • -
  • 从面经里抽题,标注考点、自己的答法和面试官的反应
  • -
  • 答不上来的题打标,回流到 知识库 对应章节补齐
  • -
  • 面试结束后 24h 内写复盘,避免记忆失真
  • -
  • 高频题汇总成本板块的「必答题清单」,面试前 30 分钟速刷
  • -
-
+
+
时间
2026-10-17
+
公司
得物
+
岗位
Golang 开发
+
轮次
一面
+
题量
15 题
+
状态
答案待补0 / 15
+
+
-

怎么把本页换成真页面

-
-
    -
  • 把面经记录放进 interview/,写好 interview/index.html 列表页
  • -
  • 打开 assets/portal.data.js,往 interview 模块的 entries 里加一项: -
    { - id: 'byte-2025-backend', - name: '字节 · 后端一面复盘', - path: 'interview/2025-字节-后端-一面.html', - dir: 'interview', - desc: '一面 45 分钟:项目深挖 + Go 并发 + 一道场景题。', - tags: ['后端', 'Go'], - badges: ['已复盘'], - stats: [['1', '场面试'], ['12', '道题']] -}
    -
  • -
  • 跑 node tools/check-portal.js,确认登记的文件都真实存在
  • -
  • 本页可以保留为「空态说明」,也可以直接删掉
  • -
-
+
+ 关于题号 +

原始记录的编号从第 4 题开始(前 3 条没记下来),本页统一从 1 开始连续编号; + 题干保留原话,只整理了断句和标点。答案用 <details> 折叠, + 点标题展开——先自己说一遍,再对照答案。

+
-
导航页的三个板块:面试记录(本页所在)、 - 知识库(八股 / 路线 / 场景)、 - 工程项目(项目资料与题库)。
-
+
+ 已展开 0 / 15 题 + + + +
-
materials · interview/ 临时占位页 · 可直接双击 index.html 离线打开
+
+ +
+ + 1 +
+
InnoDB 的 MVCC 是如何实现的?
+
MySQL事务
+
+ +
+
+

答案待补。先把面试官的原话和当场答法记在这里,再补标准答案,最后压成 30 秒能说出口的版本。

+
+
+ +
+ + 2 +
+
可重复读是否完全消除了幻读?解决幻读要把数据库的隔离级别设置成什么?
+
MySQL隔离级别
+
+ +
+
+

答案待补。先把面试官的原话和当场答法记在这里,再补标准答案,最后压成 30 秒能说出口的版本。

+
+
+ +
+ + 3 +
+
建立索引的判断标准是什么?
+
MySQL索引设计
+
+ +
+
+

答案待补。先把面试官的原话和当场答法记在这里,再补标准答案,最后压成 30 秒能说出口的版本。

+
+
+ +
+ + 4 +
+
联合索引 (a, b, c):a=1 AND c=3 能用索引吗?a>1 AND b>2 呢?如果加一个 ORDER BY b 呢?
+
MySQL联合索引最左前缀
+
+ +
+
+

答案待补。先把面试官的原话和当场答法记在这里,再补标准答案,最后压成 30 秒能说出口的版本。

+
+
+ +
+ + 5 +
+
说一下覆盖索引和回表
+
MySQL索引
+
+ +
+
+

答案待补。先把面试官的原话和当场答法记在这里,再补标准答案,最后压成 30 秒能说出口的版本。

+
+
+ +
+ + 6 +
+
索引为什么用 B+ 树而不用其他数据结构?为什么不用跳表?
+
MySQL数据结构
+
+ +
+
+

答案待补。先把面试官的原话和当场答法记在这里,再补标准答案,最后压成 30 秒能说出口的版本。

+
+
+ +
+ + 7 +
+
实习相关
+
经历追问
+
+ +
+
+

答案待补。先把面试官的原话和当场答法记在这里,再补标准答案,最后压成 30 秒能说出口的版本。

+
+
+ +
+ + 8 +
+
HTTP 和 gRPC 使用场景怎么划分?protobuf 的定义如何管理?
+
网络RPC
+
+ +
+
+

答案待补。先把面试官的原话和当场答法记在这里,再补标准答案,最后压成 30 秒能说出口的版本。

+
+
+ +
+ + 9 +
+
乐观锁的具体机制,和 CAS 有什么区别?
+
并发锁
+
+ +
+
+

答案待补。先把面试官的原话和当场答法记在这里,再补标准答案,最后压成 30 秒能说出口的版本。

+
+
+ +
+ + 10 +
+
项目相关
+
项目追问
+
+ +
+
+

答案待补。先把面试官的原话和当场答法记在这里,再补标准答案,最后压成 30 秒能说出口的版本。

+
+
+ +
+ + 11 +
+
描述项目中解决的你觉得困难或复杂的问题
+
项目复盘
+
+ +
+
+

答案待补。先把面试官的原话和当场答法记在这里,再补标准答案,最后压成 30 秒能说出口的版本。

+
+
+ +
+ + 12 +
+
说出一次 RAG 请求从输入到输出的完整路径
+
RAG链路
+
+ +
+
+

答案待补。先把面试官的原话和当场答法记在这里,再补标准答案,最后压成 30 秒能说出口的版本。

+
+
+ +
+ + 13 +
+
查询改写和召回都解决了什么问题?融合和重排呢?
+
RAG检索
+
+ +
+
+

答案待补。先把面试官的原话和当场答法记在这里,再补标准答案,最后压成 30 秒能说出口的版本。

+
+
+ +
+ + 14 +
+
手撕并口述思路:树的子结构(ACM 模式,要手动建树)
+
算法手撕
+
+ +
+
+

答案待补。先把面试官的原话和当场答法记在这里,再补标准答案,最后压成 30 秒能说出口的版本。

+
+
+ +
+ + 15 +
+
反问
+
反问
+
+ +
+
+

答案待补。把自己问出去的问题和面试官的回答记在这里,顺便标记哪个回答改变了你对这个岗位的判断。

+
+
+ +
+ +

复盘

+
+ 待补 +

哪些题当场答住了、哪些卡住了、哪几道其实只是背过没真懂;下一轮之前要补的三件事写在这里。 + 补齐答案的时候顺手把这里也填了——只记题目不记复盘,下次还会卡在同一处。

+
+ +

加一场新面经

+
+ 四步 +
    +
  1. 复制本页为 YYYY-MM-DD-公司-岗位-轮次.html,文件名里的日期与页头「时间」保持一致。
  2. +
  3. 改 .meta 的六个字段,把 details.q 换成新一场的题目,题号仍从 1 连续编。
  4. +
  5. 在 assets/interviews.js 里加一项:id / file / date / + company / role / round / questions / status。 + 左侧导航就是按这份数据渲染的。
  6. +
  7. 去 assets/portal.data.js 的 interview.entries 登记一场,跑 + node tools/check-portal.js 确认没有死链。
  8. +
+
+ +

得物 · Golang 开发 · 一面 · 2026-10-17 · 15 题 · 答案待补 · 首页默认打开这一篇

+ +
+ + + + + + +