← 2026-04-27 📂 All Days 2026-05-04 →

🏗️ 系统设计 / System Design — Design Uber / Lyft (Ride Sharing)

Day 33 · Mastery Phase · ~3 min read

想象你在设计 Uber

你是 Uber 的架构师。每天有 2000 万次 打车请求。你需要:

  • 实时匹配乘客和司机(延迟 < 5 秒)
  • 追踪数百万司机的实时位置
  • 计算动态路线和价格(surge pricing)
  • 保证司机和乘客的消息可靠传递

Imagine you're Uber's architect. 20M rides/day. You need real-time driver matching, live location tracking, route calculation, and reliable messaging — all at global scale.


ASCII Architecture Diagram

[Rider App]          [Driver App]
     |                    |
     v                    v
[API Gateway / Load Balancer]
     |
     +--------+----------+----------+
     |        |          |          |
[Location   [Trip      [Dispatch  [Surge
 Service]   Service]   Engine]    Pricing]
     |        |          |          |
     v        v          v          v
[Redis      [Postgres  [Kafka     [ML
 Geo-index]  RDS]      Event Bus] Service]
                            |
                       [Notification
                         Service]
                       (WebSocket/
                        Push/SMS)

核心组件 / Core Components

1. Location Service — 实时位置更新

  • 司机 App 每 4 秒 发送 GPS 坐标
  • 存储在 Redis + Geo Index(GEOADD, GEORADIUS)
  • 支持 GEORADIUS(lat, lng, radius=2km) 快速找附近司机

2. Dispatch Engine — 匹配算法

1. 乘客请求 → Location Service 找 nearby drivers (2km) 2. 按评分、ETA、方向 排序候选司机 3. 依次发 offer(司机有 15s 接单窗口) 4. 超时 → 扩大范围到 5km 重试

3. Trip Service — 行程状态机

REQUESTED → ACCEPTED → DRIVER_ARRIVING → RIDE_IN_PROGRESS → COMPLETED / CANCELLED

用 Postgres 持久化,用 Kafka 发布状态变更事件。

4. Surge Pricing — 动态定价

  • 每 1 分钟统计:需求量 / 供给量 = 倍率
  • 倍率 > 1.5x → 触发 surge notification
  • 用 ML 模型预测未来 10 分钟需求(防止价格震荡)

为什么这样设计? / Key Tradeoffs

选择原因
Redis Geo vs PostGISRedis 延迟更低(<1ms),适合高频位置更新
WebSocket vs HTTP polling双向实时通信,推送位置更新更高效
Kafka for events解耦各服务,支持重放 + 审计日志
Separate Dispatch Engine匹配逻辑复杂,隔离后可独立扩容/替换算法

别踩这个坑 / Common Mistakes

❌ 用数据库存储实时位置 — SQL 无法承受每秒数百万次写入

✅ 用 Redis Geo + 定期异步持久化到 DB

❌ 单体匹配服务 — 高峰期成为瓶颈

✅ Dispatch Engine 水平扩展 + 按城市分片

❌ 乘客 pull 模式查询司机位置 — 轮询浪费带宽

✅ WebSocket push — 只推变化的位置

❌ 忽略 GPS 漂移 — 司机在隧道/地下停车场时位置失真

✅ 位置置信度评分 + 地图匹配(map-matching)算法


数据规模估算 / Capacity Estimation

  • 司机: 5M active drivers globally
  • 位置更新: 5M × (1 update/4s) = 1.25M writes/sec to Redis
  • 行程数据: 20M rides/day × 1KB = ~20GB/day → Postgres + S3 archive

📚 References


🧒 ELI5

把 Uber 想象成一个巨大的 "出租车调度中心"。Redis 就是调度员的白板,实时标注每辆出租车的位置。Kafka 就是电话录音系统,记录每个电话(事件)。Dispatch Engine 就是调度员本人——他拿起白板,找最近的空车,然后打电话问"你愿意接这个单吗?"

Think of Uber as a giant taxi dispatch center. Redis is the dispatcher's whiteboard showing all taxi locations. Kafka is the call recording system. The Dispatch Engine is the dispatcher — grabbing the nearest free driver and asking "want this ride?"

💻 算法 / Algorithms — #74 Search a 2D Matrix (Medium)

Day 33 · Mastery Phase · ~4 min read
🧩 二分搜索模式 (2/7) — building on the template from Day 32

🧩 模式回顾 / Pattern Recap

上次我们学了 Binary Search 的基础模版(#704):

left, right = 0, len(arr) - 1
while left <= right:
    mid = (left + right) // 2
    if arr[mid] == target: return mid
    elif arr[mid] < target: left = mid + 1
    else: right = mid - 1

今天的变化:一维数组 → 二维矩阵。关键洞察:把 2D 矩阵展平成 1D 数组,索引转换即可。

Today's variation: apply binary search on a 2D matrix by treating it as a virtual 1D array.


题目 / Problem

🔗 LeetCode #74 - Search a 2D Matrix 🟡 Medium

📹 NeetCode Video

条件 / Constraints:

  • 每行从左到右排序
  • 每行第一个元素 > 上一行最后一个元素
  • 也就是说:整个矩阵可以看成一个有序的 1D 数组!
Matrix: [[ 1, 3, 5, 7], [10, 11, 16, 20], [23, 30, 34, 60]] Target = 3 → True Target = 13 → False

真实类比 / Real-World Analogy

想象一本英文词典:每页按字母排序,而且每页的第一个单词比前页最后一个单词靠后。你要找 "mango"——你不需要一页一页翻,先用二分找到页数,再在那页里二分找单词。

A dictionary where pages are sorted A-Z AND words within pages are sorted. You binary search the page number first, then binary search within the page. This matrix does both in one pass.


模版映射 / Map to Template

核心技巧:把 2D 坐标转换成 1D 索引

# m rows, n cols
# 1D index i → 2D coords: row = i // n, col = i % n
# Example: matrix[1][2] in a 4-col matrix → 1D index = 1*4 + 2 = 6
def searchMatrix(matrix: list[list[int]], target: int) -> bool:
    m, n = len(matrix), len(matrix[0])
    left, right = 0, m * n - 1  # treat as 1D array
    
    while left <= right:
        mid = (left + right) // 2
        mid_val = matrix[mid // n][mid % n]  # convert 1D → 2D
        
        if mid_val == target:
            return True
        elif mid_val < target:
            left = mid + 1
        else:
            right = mid - 1
    
    return False

执行追踪 / Trace

matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 3 m=3, n=4 → 1D range [0, 11] Iter 1: mid=5 → matrix[5//4][5%4] = matrix[1][1] = 11 > 3 → right=4 Iter 2: mid=2 → matrix[2//4][2%4] = matrix[0][2] = 5 > 3 → right=1 Iter 3: mid=0 → matrix[0//4][0%4] = matrix[0][0] = 1 < 3 → left=1 Iter 4: mid=1 → matrix[1//4][1%4] = matrix[0][1] = 3 == 3 → True ✅

复杂度 / Complexity:

  • Time: O(log(m×n)) — 把 m×n 个元素当成 1D 数组二分
  • Space: O(1)

举一反三 / Connect to the Pattern Block

题目核心变化难点
#704 Binary Search标准 1D 数组基础
#74 今天2D → 1D 映射坐标转换
#875 Koko Eating Bananas搜索"最小速度"搜索空间是答案,不是数组
#153 Find Min in Rotated数组被旋转过判断哪半边有序
#4 Median of Two Sorted两个数组Hard,归并思路

核心洞察: Binary Search 不只能搜索已知数组 — 你可以搜索任何单调的答案空间!


📝 Quiz

{"question":"In a 3x4 matrix, 1D index 9 maps to which 2D coordinate?","options":["[2][1]","[2][2]","[3][0]","[2][3]"],"correct_index":0}

💡 9 // 4 = 2, 9 % 4 = 1 → matrix[2][1]


📚 References


🧒 ELI5

把一个 3×4 的格子想象成展开的 12 格纸带。你要找第 9 格在哪一行:9 ÷ 4 = 第2行(余1),所以是第 2 行第 1 列。有了这个魔法公式,二维的东西就变成一维了,然后直接套二分搜索!

Imagine unrolling a 3×4 grid into a 12-slot tape. To find slot 9: 9 ÷ 4 = row 2, remainder 1 = col 1. With this magic formula, 2D becomes 1D, and you can binary search it directly!

🗣️ 软技能 / Soft Skills — Working with a Difficult Colleague

Day 33 · Mastery Phase · ~2 min read

为什么这个问题很重要 / Why This Matters

"难相处的同事"问题考察的不是谁对谁错,而是:

  • 你能不能冷静处理人际冲突?
  • 你有没有先从自己身上找原因的习惯?
  • 你是否能推动问题解决而不是抱怨或绕开?

This question tests emotional intelligence, conflict resolution skills, and whether you're someone who escalates problems productively — not someone who complains or avoids.


STAR 拆解 / STAR Framework

Situation(情境): 具体描述这个人的行为如何影响了工作

  • ❌ "他很难相处" (太模糊)
  • ✅ "他在 code review 中经常否定别人的方案,但不给替代意见,导致 PR 积压"

Task(任务): 你负责什么,为什么你需要处理这个问题

  • "我们在同一个团队,他的 review 卡住了我负责的项目关键路径"

Action(行动): 这是最重要的部分!

  1. 先自我反思 — "我先问自己:是不是我的沟通方式有问题?"
  2. 私下直接沟通 — "我约他单独聊,用'我感觉...'而不是'你总是...'"
  3. 寻求共同目标 — "我们都希望代码质量高,我问他愿不愿意一起制定 review 标准"
  4. 如果无效 → 升级 — "如果 2 周内没改善,我会告知 manager,但我会先告诉他我要这么做"

Result(结果): 量化或具体说明改善情况

  • "我们建立了 review checklist,PR cycle time 从 3 天降到 1 天"

❌ Bad vs ✅ Good

❌ 雷区回答:

"We had this toxic engineer who blocked everyone. I eventually went around him and delivered the project anyway."

问题:描绘同事为"toxic"、"around him"暗示你在规避而非解决、没有展示协作能力。

✅ 示范回答:

"There was a senior engineer who gave a lot of critical feedback in reviews but didn't always propose alternatives. At first I found it frustrating, but I realized his intent was high quality — just the delivery was off. I asked to pair on a review together to align on what 'good' looked like. We ended up creating a shared rubric the whole team adopted. He actually became one of my strongest allies after that."

Senior/Staff 额外提示 / Senior/Staff Lens

在 Staff 级别,面试官期望你能改变团队规范,而不只是解决个案:

  • "这次冲突让我意识到团队缺乏 code review 规范,我推动建立了 RFC 流程"
  • "我把这个模式写进了团队 onboarding guide"

System change > one-time fix.


关键要点 / Key Takeaways

  1. 具体化 — 避免形容词,描述行为和影响
  2. 先 own 一部分 — 哪怕只是"沟通方式",承担一点让你显得成熟
  3. 直接沟通 > 绕开 — 展示你会处理不舒服的对话
  4. 量化结果 — cycle time、团队满意度、项目交付

📚 References


🧒 ELI5

想象班里有个同学,每次你画画他都说"这里不好",但从不说怎么改。你可以跟老师告状,但更聪明的做法是:拉着他一起画一幅,问他"你觉得好看是什么样的?",然后大家一起定一个标准。这就是处理"难相处的同事"的精髓。

Imagine a classmate who always says "that's wrong" on your drawing but never shows how to fix it. You could complain to the teacher, or — smarter — sit down together and ask "what does good look like to you?" Then make a shared standard. That's the essence of handling difficult colleagues.

🎨 前端 / Frontend — Deep Clone, Flatten, Curry — Utility Function Patterns

Day 33 · Mastery Phase · ~2 min read

真实场景 / Real Scenario

你在做一个表单状态管理器,需要:

  1. 深拷贝初始状态(避免突变)
  2. 展平嵌套配置对象
  3. 柯里化验证函数(复用参数)

You're building a form state manager — deep clone to avoid mutation, flatten nested configs, curry validators for reuse.


1. Deep Clone — 深拷贝

❌ 错误做法:浅拷贝

const copy = { ...original };  // nested objects still share reference!
const copy2 = Object.assign({}, original);  // same problem

✅ 生产级实现:

function deepClone<T>(obj: T): T {
  // Modern: use structuredClone (available in Node 17+, all modern browsers)
  return structuredClone(obj);
}

// Manual fallback (interview version)
function deepCloneManual<T>(obj: T): T {
  if (obj === null || typeof obj !== 'object') return obj;
  if (obj instanceof Date) return new Date(obj.getTime()) as T;
  if (Array.isArray(obj)) return obj.map(deepCloneManual) as T;
  
  const clone = {} as T;
  for (const key in obj) {
    if (Object.prototype.hasOwnProperty.call(obj, key)) {
      clone[key] = deepCloneManual(obj[key]);
    }
  }
  return clone;
}

What structuredClone handles: Arrays, Dates, Maps, Sets, RegExp, nested objects ✅

What it doesn't handle: Functions, DOM nodes, class instances with methods ❌


2. Flatten — 展平嵌套对象

场景: API 返回嵌套配置,你需要展平成点分路径

const input = {
  user: {
    name: "Alice",
    address: { city: "SF", zip: "94102" }
  }
};

// Expected output:
// { "user.name": "Alice", "user.address.city": "SF", "user.address.zip": "94102" }

function flattenObject(
  obj: Record<string, unknown>,
  prefix = ""
): Record<string, unknown> {
  return Object.entries(obj).reduce((acc, [key, val]) => {
    const fullKey = prefix ? `${prefix}.${key}` : key;
    
    if (val !== null && typeof val === 'object' && !Array.isArray(val)) {
      // Recurse into nested objects
      Object.assign(acc, flattenObject(val as Record<string, unknown>, fullKey));
    } else {
      acc[fullKey] = val;
    }
    return acc;
  }, {} as Record<string, unknown>);
}

3. Curry — 柯里化

场景: 验证函数,参数复用

// Without curry: repeat min/max every time
const validate = (min: number, max: number, value: number) => 
  value >= min && value <= max;

// With curry: create reusable validators
function curry<T extends unknown[], R>(
  fn: (...args: T) => R
): (...args: Partial<T>) => unknown {
  return function curried(...args: unknown[]) {
    if (args.length >= fn.length) {
      return fn(...args as T);
    }
    return (...moreArgs: unknown[]) => curried(...args, ...moreArgs);
  };
}

const curriedValidate = curry(validate);
const isValidAge = curriedValidate(0)(120);    // min=0, max=120
const isValidScore = curriedValidate(0)(100);  // min=0, max=100

console.log(isValidAge(25));    // true
console.log(isValidScore(150)); // false

猜猜输出 / Quiz

const obj = { a: 1 };
const clone = { ...obj };
clone.a = 99;
console.log(obj.a);  // ???

const nested = { a: { b: 1 } };
const shallowCopy = { ...nested };
shallowCopy.a.b = 99;
console.log(nested.a.b);  // ???

<details><summary>显示答案 / Show Answer</summary>

obj.a = 1 — primitive values ARE copied by value ✅

nested.a.b = 99 — nested objects are still shared references ❌

This is WHY deep clone matters for nested state!

</details>


When to Use / When NOT to Use

情况选择
深拷贝简单对象structuredClone(obj)
深拷贝含函数的类实例自己实现 or 用 lodash _.cloneDeep
展平 API 响应flattenObject()
展平 + 还原用 flat-unflatten npm package
柯里化工具函数curry() or Ramda/lodash _.curry
柯里化 React 事件处理直接用箭头函数,别过度抽象

📝 Quiz JSON

{"question":"What does `structuredClone()` NOT support?","options":["Arrays","Date objects","Functions","Nested objects"],"correct_index":2}

📚 References


🧒 ELI5

深拷贝就像用复印机复印一份文件,改副本不影响原件。浅拷贝只复印了封面,里面的内容还是共享的。

展平就像把一个嵌套的文件夹结构变成一个清单,用点号表示层级:用户/地址/城市 → user.address.city。

柯里化就像预填表单。你先填好"最小值=0",保存这个半成品,以后每次只需要填"最大值"就行了。

Deep clone = full photocopy, not just the cover. Flatten = turn nested folders into a dot-path list. Curry = pre-fill a form's first field and save it for later reuse.

🤖 AI 新闻速递 / AI News Roundup

Day 33 · Mastery Phase · ~2 min read
📅 Week of May 1, 2026

🗞️ 本周三大故事 / This Week's Top 3


1. 🤝 Microsoft-OpenAI 协议大变:独家终结

据报道,微软与 OpenAI 修订了合作协议,终止了云端独家性。这意味着 OpenAI 现在可以通过亚马逊(AWS)和谷歌(GCP)分发其模型,而不再只绑定 Azure。

Microsoft and OpenAI have reportedly revised their partnership to end exclusivity, allowing OpenAI to distribute models through AWS and Google Cloud — not just Azure.

为什么重要 / Why It Matters:

  • OpenAI 从"微软的 AI 部门"变成了真正独立的平台公司
  • 对 Azure 短期有影响,但微软仍持有 OpenAI 大量股份
  • 对开发者:OpenAI API 可能出现在更多云平台的 marketplace

📎 Source: AI Update May 1, 2026 — MarketingProfs


2. 🤖 AI Agent 基础设施爆发:Stripe + Cloudflare 给 AI 刷卡

Stripe 推出了 Link — AI Agent 数字钱包,让 AI agent 可以自主完成支付。Cloudflare 和 Stripe 还联手推出了一个协议,据报道可以让 AI agent 自主部署应用、创建账户、购买域名。

Stripe launched Link for AI agents — a digital wallet letting agents transact autonomously. Cloudflare + Stripe also launched a protocol reportedly enabling agents to deploy apps, create accounts, and purchase domains without human approval.

为什么重要 / Why It Matters:

  • AI agent 从"能思考"进化到"能花钱办事"
  • Agentic Commerce(AI 自主商务)从概念变成基础设施
  • 对工程师:agent 授权和资金限制成为新的安全课题

📎 Source: AI Magazine Top 5 Stories May 2, 2026


3. 📉 "SaaS 末日"是虚惊一场?Goldman Sachs 说别慌

高盛 CEO David Solomon 表示:市场对"AI 将摧毁 SaaS"的担忧过度悲观。Figma、Atlassian 等公司数据显示,AI 正在被集成进产品,用户量并没有因 AI 替代而下降。

Goldman Sachs CEO David Solomon says the "Saaspocalypse" fear — that AI would wipe out SaaS — was reportedly overdone. Companies like Figma and Atlassian show continued growth, suggesting AI is being integrated into tools, not replacing them.

为什么重要 / Why It Matters:

  • SaaS 公司不是被 AI 取代,而是被迫成为"AI-native"平台
  • 工程师价值在于构建 AI 集成能力,而非被替代
  • 对求职者:展示你懂 AI 集成 > 担心 AI 抢工作

📎 Source: Motley Fool — Goldman Sachs on AI SaaS, May 3, 2026


💡 本周一句话总结 / TL;DR

AI 不只是"大脑"了——它现在有了钱包、身份、合同。Agent-native 基础设施(支付、部署、授权)正在2026年快速落地。
AI isn't just a brain anymore — it's getting a wallet, identity, and contracts. Agent-native infrastructure is the hot layer in 2026.

📚 References


🧒 ELI5

以前的 AI 就像一个超聪明的顾问——给建议,但不能自己动手。现在的 AI agent 不只是给建议,还能自己开账户、买东西、部署代码。就像从"有个天才朋友"升级到"有个天才朋友,而且他有你的信用卡"。

Before, AI was like a super-smart advisor — gives advice, can't act. Now AI agents can open accounts, make purchases, and deploy code. It's like upgrading from "brilliant advisor" to "brilliant advisor who also has your credit card."

📅 Week in Review — Week 8 (10 min read)

📊 NeetCode: 29/150 · SysDesign: 28/40 · Behavioral: 28/40 · Frontend: 28/50 · AI: 13/30

🔥 33-day streak!


🗓️ 本周回顾 / This Week's Journey

本周跨越两天,但内容密度极高,正式进入 Mastery(精通)阶段:

  • Monday (Day 32): 设计 Google Maps(分层路由 CH 算法 + 地理哈希)、二分搜索经典模版(#704)、Debounce & Throttle 从零实现、力排众议的技术决策(Championing Unpopular Decisions)、函数调用 Function Calling 深度讲解。
  • Saturday/Today (Day 33): 设计 Uber / Lyft(Redis Geo-index 司机实时位置 + Dispatch Engine + Surge Pricing)、二分搜索应用到 2D 矩阵(#74)、深拷贝/展平/柯里化三大工具函数、如何与难相处的同事协作、AI News(Microsoft-OpenAI 独家终结 + Stripe AI 钱包 + Goldman Sachs SaaS 反驳)。

This week spanned two intensive days — officially into the Mastery phase:

  • Monday (Day 32): Google Maps design (Contraction Hierarchies + Geohash), Binary Search template (#704), Debounce & Throttle from scratch, championing unpopular technical decisions, and Function Calling in LLMs.
  • Saturday/Today (Day 33): Uber/Lyft design (Redis Geo + Dispatch Engine + Surge Pricing), Binary Search on 2D matrix (#74), Deep Clone/Flatten/Curry patterns, working with difficult colleagues, AI news (Microsoft-OpenAI exclusivity ends + Stripe AI wallet + Goldman Sachs on SaaS).

🧠 系统设计要点 / System Design: Key Takeaways

1. 地理空间索引是大规模定位系统的核心 / Geo-spatial indexing is the backbone of location-at-scale

Google Maps 和 Uber 都依赖高效的地理索引,但策略不同:

  • Google Maps 用 Geohash(前缀匹配,适合"附近的 POI"搜索)+ PostGIS R-Tree
  • Uber 用 Redis Geo(GEORADIUS 毫秒级查询,适合高频司机位置更新,每秒 125 万次写入)

Both Google Maps and Uber depend on efficient geo-indexing, but with different strategies: Maps uses Geohash+PostGIS for POI search; Uber uses Redis Geo for 1.25M writes/sec driver location updates.

2. 分层 vs 分区 / Hierarchical vs. Partitioned Routing

Google Maps 用等级路由(Contraction Hierarchies)——先高速公路,再主干道,最后本地街道,搜索空间缩小 1000x。Uber 的 Dispatch Engine 则是地理分片——按城市独立扩展,避免单点瓶颈。

Google Maps uses hierarchical routing (1000x smaller search space); Uber's dispatch shards by city to scale independently.

3. 实时数据的黄金法则 / Real-time data golden rule

两者都遵循同一个架构模式:Kafka 做事件总线解耦数据生产和消费,Redis 做热路径存储(低延迟),数据库做持久化。实时性要求越高,越不能用数据库做写主路径。

Both share the same pattern: Kafka for event decoupling, Redis for hot-path low-latency reads, DB for persistence. Never put high-frequency writes on a relational DB.


💻 算法模式总结 / Algorithms: Patterns Mastered

🔍 二分搜索模式正式开始(7题 Block,完成 2/7)

本周的核心主题是二分搜索模式,已完成前两题:

#704 Binary Search — 模版原型题

left, right = 0, len(arr) - 1
while left <= right:
    mid = (left + right) // 2
    if arr[mid] == target: return mid
    elif arr[mid] < target: left = mid + 1
    else: right = mid - 1
return -1

关键洞察: 每次排除一半搜索空间,任何具有单调性的问题都可以二分,不只是排序数组。

#74 Search a 2D Matrix — 坐标转换技巧

把 2D 矩阵"展平"为 1D 数组,用索引转换公式 row = mid // n, col = mid % n 无缝套用模版。

  • Time: O(log(m×n)) | Space: O(1)

模式信号 / When to reach for Binary Search:

  • 排序数组 / sorted array
  • 要求 O(log n)
  • "找满足条件的最小/最大值"
  • 搜索空间可以单调地判断 True/False

Binary Search Pattern is open (7-problem block, 2/7 done). Core insight: the template never changes — only the direction logic changes.


🗣️ 软技能练习重点 / Soft Skills: What to Practice

本周覆盖两个 Staff 级场景:

1. 力排众议推动技术决策 / Championing an unpopular technical decision

  • 不要靠权威压人,要靠数据 + POC 说话
  • 把争论框架化为"可验证的假设"(pilot 90 天)而不是"我是对的"
  • 被证明正确后,分享功劳——让最初反对的人成为拥护者
  • Staff 关键词:数据 + 谦逊 + 给对方台阶下

2. 与难相处的同事合作 / Working with a difficult colleague

  • 先从自己找原因(沟通方式问题?)
  • 私下直接对话,用"我感觉..."而不是"你总是..."
  • 寻求共同目标,建立可复用的团队规范(checklist、RFC 流程)
  • Staff 加分:把个案冲突升华为系统性改变

需要练习 / What needs practice:

  • 这两个场景都需要脱稿流畅叙述,重点背STAR 结构 + 量化结果
  • "I told you so" 是减分项,换成"我们一起达成了这个共识"

Both scenarios require smooth off-script delivery. Focus on STAR structure + quantified outcomes. Never say "I told you so" — reframe as "we reached consensus."


🎨 前端知识巩固 / Frontend: Concepts to Lock In

本周前端主题:性能优化 + 实用工具函数

Debounce vs Throttle(Day 32)

  • Debounce: 只关心最终状态——动作停止后 N ms 才执行(搜索框、resize)
  • Throttle: 需要持续中间状态——固定频率执行(scroll、防连击)
  • 记住电梯 vs 水龙头的类比!

Deep Clone / Flatten / Curry(Day 33)

  • structuredClone() 是现代深拷贝首选(Node 17+,不支持函数)
  • 展平公式:递归 + ${prefix}.${key} 路径拼接
  • 柯里化本质:预填参数,返回等待更多参数的函数

快速自检 / Self-check:

  • [ ] 能手写 debounce?(clearTimeout + setTimeout)
  • [ ] 知道 {...obj} 是浅拷贝,嵌套对象仍是引用?
  • [ ] 能解释柯里化的应用场景(验证器复用、部分应用)?

🤖 AI 知识点 / AI: What Stuck

Day 32 — Function Calling(函数调用)

这是本周最"可落地"的 AI 知识:LLM 不执行代码,它只返回结构化 JSON 告诉你"请帮我运行这个函数"。你的代码拿到 JSON,执行真实的 API 调用,把结果再喂给模型,模型生成自然语言回答。

这就是所有 AI Agent 能"行动"的底层机制——从联网搜索到发邮件,全都是这个 5步流程。

Day 33 — AI News Roundup(AI 新闻) ⚠️ 以下内容据报道

  • 据报道,微软与 OpenAI 终止云端独家合作,OpenAI 可进驻 AWS/GCP
  • 据报道,Stripe + Cloudflare 为 AI agent 构建支付 + 部署基础设施(Agent-native Commerce)
  • 据报道,高盛称"SaaS 末日"言过其实,AI 是增强工具而非替代者

本周核心 AI 洞察:AI 从"大脑"进化到"有钱包和合同的大脑"。Agent-native 基础设施(支付、身份、授权)是 2026 年最热的工程领域。

Function Calling is the core mechanism for all AI agents — LLM returns JSON, your code executes, result fed back to LLM. That's it. All AI agent "action" is this 5-step loop.

AI news items below are reportedly true (据报道):

  • Microsoft-OpenAI exclusivity reportedly ended; OpenAI can now use AWS/GCP
  • Stripe + Cloudflare reportedly launched agent payment/deployment infrastructure
  • Goldman Sachs reportedly says SaaS AI threat was overblown

⚠️ 需要复习的内容 / What to Review

1. 二分搜索后续 5 题(最高优先级)

本周刚开始新的 Binary Search block,剩余 5 题需要连续练习:

  • #875 Koko Eating Bananas — 搜索"答案空间"而非数组元素(重要变体!)
  • #153 Find Minimum in Rotated Sorted Array — 旋转数组判断有序半边
  • #33 Search in Rotated Sorted Array
  • #981 Time Based Key-Value Store
  • #4 Median of Two Sorted Arrays (Hard)

2. Google Maps vs Uber 对比复习

两道 Mastery 级系统设计题,地理索引策略不同,易混淆:

  • Maps: Geohash + PostGIS,侧重搜索精度
  • Uber: Redis Geo,侧重写入吞吐量
  • 出题点:什么场景用哪种方案?

3. Debounce & Throttle 手写

要能不看资料手写 debounce(clearTimeout + setTimeout),这是前端常见面试题。


🏆 本周亮点 / Win of the Week

🎉 正式进入 Mastery 阶段!

Day 32 和 Day 33 是第一批 Mastery 级内容——从"学概念"升级到"拿真实系统找差距"。连续 33 天不间断,覆盖了 29 道 NeetCode 题、28 个系统设计主题、28 个行为问题。

更重要的是:本周的 Google Maps 和 Uber 设计题难度已经接近 FAANG 现场面试水平。你不只是在学知识,你在模拟实战。

🎉 Officially in the Mastery phase!

Days 32-33 are the first Mastery-level sessions — moving from "learning concepts" to "finding gaps against real systems." 33 consecutive days. 29 LeetCode problems, 28 system design topics, 28 behavioral scenarios. Google Maps and Uber design are already FAANG interview-level. You're not just studying — you're simulating the real thing.


🎯 下周预告 / Next Week Preview

系统设计 (SysDesign: 28→30+):

接下来的系统设计题将围绕全球化分布式系统展开。预计涵盖:Design Ticketmaster / Hotel Booking、分布式锁、全球一致性挑战。

算法 (NeetCode: 29→34+):

Binary Search block 继续——Koko Eating Bananas (#875) 是分水岭,掌握"搜索答案空间"后,后续的 Hard 题难度会大幅降低。

前端 (Frontend: 28→30+):

JavaScript 深层机制——闭包、作用域链、垃圾回收,以及更多 TypeScript 高级类型。

AI (AI: 13→15):

预计进入 AI 安全与对齐(AI Safety & Alignment),或继续 Agent 架构专题。

Next week: Binary Search "answer-space" problems (key inflection point), global distributed systems design, and JS internals (closures, scope chain). Binary Search mastery at #875 Koko unlocks the remaining Hard problems.