Skip to content

场景面试题导航配置指南

概述

本文档说明如何将场景面试题集成到你的文档站点导航系统中。

目录结构

docs/scenario-questions/
├── index.md                          # 主索引页面
├── high-concurrency/                 # 高并发类
│   ├── index.md
│   ├── seckill-system.md
│   ├── red-packet-system.md
│   ├── ticket-system.md
│   ├── live-streaming-system.md
│   └── shopping-festival-system.md
├── geo-location/                     # 地理位置类
│   ├── index.md
│   ├── nearby-people.md
│   ├── circular-region-distance.md
│   ├── geofence-system.md
│   └── taxi-system.md
├── system-design/                    # 系统设计类
│   ├── index.md
│   ├── like-system.md
│   ├── comment-system.md
│   ├── recommendation-system.md
│   ├── short-url-system.md
│   └── user-relation-system.md
├── distributed-system/               # 分布式系统类
│   ├── index.md
│   ├── distributed-id-generator.md
│   ├── distributed-lock.md
│   ├── distributed-transaction.md
│   ├── distributed-cache.md
│   └── distributed-scheduler.md
├── algorithm-optimization/           # 算法优化类
│   ├── index.md
│   ├── rate-limiter.md
│   ├── consistent-hash.md
│   ├── bloom-filter.md
│   ├── top-k-optimization.md
│   ├── lru-cache.md
│   └── skip-list.md
├── data-processing/                  # 数据处理类
│   ├── index.md
│   └── ...
├── high-availability/                # 高可用类
│   ├── index.md
│   └── ...
├── search-recommendation/            # 搜索推荐类
│   ├── index.md
│   └── ...
├── security/                         # 安全风控类
│   ├── index.md
│   └── ...
└── messaging/                        # 消息通信类
    ├── index.md
    └── ...

VitePress配置示例

如果你使用VitePress,可以在.vitepress/config.ts中添加以下配置:

typescript
export default {
  themeConfig: {
    nav: [
      { text: '首页', link: '/' },
      { text: '技术栈', link: '/golang/' },
      { text: '场景面试题', link: '/scenario-questions/' },  // 新增
      { text: '系统设计', link: '/system-design/' }
    ],
    
    sidebar: {
      '/scenario-questions/': [
        {
          text: '场景面试题',
          items: [
            { text: '概述', link: '/scenario-questions/' },
            { text: '学习路径', link: '/scenario-questions/#学习路径' }
          ]
        },
        {
          text: '高并发类',
          collapsed: false,
          items: [
            { text: '概览', link: '/scenario-questions/high-concurrency/' },
            { text: '秒杀系统', link: '/scenario-questions/high-concurrency/seckill-system' },
            { text: '抢红包系统', link: '/scenario-questions/high-concurrency/red-packet-system' },
            { text: '抢票系统', link: '/scenario-questions/high-concurrency/ticket-system' },
            { text: '直播系统', link: '/scenario-questions/high-concurrency/live-streaming-system' },
            { text: '大促系统', link: '/scenario-questions/high-concurrency/shopping-festival-system' }
          ]
        },
        {
          text: '地理位置类',
          collapsed: false,
          items: [
            { text: '概览', link: '/scenario-questions/geo-location/' },
            { text: '附近的人', link: '/scenario-questions/geo-location/nearby-people' },
            { text: '圆形区域距离计算', link: '/scenario-questions/geo-location/circular-region-distance' },
            { text: '电子围栏', link: '/scenario-questions/geo-location/geofence-system' },
            { text: '打车系统', link: '/scenario-questions/geo-location/taxi-system' }
          ]
        },
        {
          text: '系统设计类',
          collapsed: false,
          items: [
            { text: '概览', link: '/scenario-questions/system-design/' },
            { text: '点赞系统', link: '/scenario-questions/system-design/like-system' },
            { text: '评论系统', link: '/scenario-questions/system-design/comment-system' },
            { text: '推荐系统', link: '/scenario-questions/system-design/recommendation-system' },
            { text: '短链系统', link: '/scenario-questions/system-design/short-url-system' },
            { text: '用户关系系统', link: '/scenario-questions/system-design/user-relation-system' }
          ]
        },
        {
          text: '分布式系统类',
          collapsed: true,
          items: [
            { text: '概览', link: '/scenario-questions/distributed-system/' },
            { text: '分布式ID生成器', link: '/scenario-questions/distributed-system/distributed-id-generator' },
            { text: '分布式锁', link: '/scenario-questions/distributed-system/distributed-lock' },
            { text: '分布式事务', link: '/scenario-questions/distributed-system/distributed-transaction' },
            { text: '分布式缓存', link: '/scenario-questions/distributed-system/distributed-cache' },
            { text: '分布式任务调度', link: '/scenario-questions/distributed-system/distributed-scheduler' }
          ]
        },
        {
          text: '算法优化类',
          collapsed: true,
          items: [
            { text: '概览', link: '/scenario-questions/algorithm-optimization/' },
            { text: '限流系统', link: '/scenario-questions/algorithm-optimization/rate-limiter' },
            { text: '一致性哈希', link: '/scenario-questions/algorithm-optimization/consistent-hash' },
            { text: '布隆过滤器', link: '/scenario-questions/algorithm-optimization/bloom-filter' },
            { text: 'TOP K优化', link: '/scenario-questions/algorithm-optimization/top-k-optimization' },
            { text: 'LRU缓存', link: '/scenario-questions/algorithm-optimization/lru-cache' },
            { text: '跳表', link: '/scenario-questions/algorithm-optimization/skip-list' }
          ]
        },
        {
          text: '数据处理类',
          collapsed: true,
          items: [
            { text: '概览', link: '/scenario-questions/data-processing/' }
          ]
        },
        {
          text: '高可用类',
          collapsed: true,
          items: [
            { text: '概览', link: '/scenario-questions/high-availability/' }
          ]
        },
        {
          text: '搜索推荐类',
          collapsed: true,
          items: [
            { text: '概览', link: '/scenario-questions/search-recommendation/' }
          ]
        },
        {
          text: '安全风控类',
          collapsed: true,
          items: [
            { text: '概览', link: '/scenario-questions/security/' }
          ]
        },
        {
          text: '消息通信类',
          collapsed: true,
          items: [
            { text: '概览', link: '/scenario-questions/messaging/' }
          ]
        }
      ]
    }
  }
}

Markdown文档内部链接

相对路径链接

在Markdown文档中使用相对路径链接到其他文档:

markdown
## 相关场景题

- [秒杀系统](../high-concurrency/seckill-system.md) - 高并发经典案例
- [分布式锁](../distributed-system/distributed-lock.md) - 并发控制
- [限流系统](../algorithm-optimization/rate-limiter.md) - 流量控制

绝对路径链接

也可以使用绝对路径(从docs根目录开始):

markdown
## 相关技术栈

- [Redis缓存](/redis/) - 高性能缓存
- [MySQL数据库](/mysql/) - 关系型数据库
- [分布式系统](/distributed-system/) - 分布式理论
- [高性能优化](/high-performance/) - 性能优化

技术文档关联示例

在场景题中添加技术栈链接:

markdown
## 三、技术选型

### 推荐技术栈

| 组件 | 技术选型 | 相关文档 |
|------|----------|----------|
| 缓存 | Redis | [Redis文档](/redis/) |
| 数据库 | MySQL | [MySQL文档](/mysql/) |
| 消息队列 | Kafka | [Kafka文档](/middleware/message-queue/kafka-deep-dive.md) |
| 限流 | Sentinel | [限流系统](../algorithm-optimization/rate-limiter.md) |

**扩展阅读**
- [Redis缓存策略](/redis/3_storage/) - 了解缓存穿透、击穿、雪崩
- [MySQL索引优化](/mysql/index/) - 优化查询性能
- [分布式锁实现](/distributed-system/distributed-lock-implementations.md) - 多种实现对比

导航菜单说明

一级导航

  • 场景面试题 - 主入口,包含所有类别的索引

二级导航(10大类别)

  1. 高并发类 - 秒杀、抢红包、抢票、直播、大促
  2. 地理位置类 - 附近的人、距离计算、电子围栏、打车
  3. 系统设计类 - 点赞、评论、推荐、短链、用户关系
  4. 分布式系统类 - 分布式ID、锁、事务、缓存、调度
  5. 算法优化类 - 限流、一致性哈希、布隆过滤器、TOP K、LRU
  6. 数据处理类 - 实时统计、数据去重、日志分析
  7. 高可用类 - 异地多活、降级、灰度、容灾
  8. 搜索推荐类 - 搜索引擎、推荐算法、排序
  9. 安全风控类 - 防刷、反爬、风控、权限
  10. 消息通信类 - IM、推送、弹幕、通知

搜索优化

文档元数据

在每个Markdown文件开头添加frontmatter:

yaml
---
title: 如何设计秒杀系统
description: 深入讲解秒杀系统的设计,包括限流、防超卖、高并发处理等核心技术
keywords: 秒杀, 高并发, 限流, Redis, 分布式锁
category: 场景面试题
tags: [高并发, 系统设计, 面试]
difficulty: 高级
---

内容关键词

在文档中合理使用关键词,提升搜索排名:

  • 问题关键词:秒杀、高并发、限流、分布式
  • 技术关键词:Redis、MySQL、Kafka、Nginx
  • 算法关键词:令牌桶、雪花算法、一致性哈希

快速访问

推荐路径

对于初学者

  1. 先看场景面试题概览了解整体结构
  2. 选择自己的岗位和级别,按推荐路径学习
  3. 从简单到复杂,循序渐进

对于面试准备

  1. 查看高频面试题
  2. 根据目标公司选择重点题目
  3. 动手实现核心代码,进行压测

对于技术提升

  1. 深入学习感兴趣的场景题
  2. 阅读相关技术栈文档
  3. 在实际项目中应用和优化

文档维护

添加新场景题

  1. 在对应类别目录下创建Markdown文件
  2. 使用统一的8章节模板
  3. 添加多语言代码实现
  4. 补充架构图和流程图
  5. 更新类别索引页面
  6. 更新导航配置

更新现有文档

  1. 保持8章节结构不变
  2. 补充新的技术方案
  3. 更新性能数据
  4. 添加相关资源链接
  5. 优化代码实现

反馈和贡献

如有问题或建议,欢迎:

  • 提交Issue
  • 提交Pull Request
  • 联系维护者

注意:本导航配置基于VitePress,如果你使用其他文档框架(如Docusaurus、GitBook等),请根据对应框架的配置方式调整。

正在精进