# Interview: MealPlan — 30min Candidate-Led Format

**Role:** Intermediate Developer (3–4 yr Android → Web)
**Mockup:** `interview-mockup.html` (open in browser)
**Duration:** 30–40 min

---

## 🏆 Scorecard (3-Second Overview)

| # | Dimension | −1 (Red Flag) | 0 (Neutral) | +1 (Good) | +2 (Strong) |
|---|-----------|--------------|-------------|-----------|-------------|
| 1 | **Data & Relationships** | Never asks how pieces connect | Asks 1 connection question after prompt | Traces Planner → Recipe → Shopping List chain unprompted | Asks about Saved Menus scope, inventory overlap, scaling edge cases |
| 2 | **Systems & Challenges** | Happy path only; no "what if" | Mentions 1 challenge (scaling or conflict) | Asks about dedup, unit normalization, OR multi-user conflict | Asks 2+ hard problems; debates trade-offs (e.g. lock vs CRDT) |
| 3 | **AI Features** | Assumes AI just works; no fallback | Asks "how does it work" surface level | Asks about hallucination, latency UX, cold start | Asks about LLM data privacy, streaming UX, partial match, quality boundaries |
| 4 | **UX & Interactions** | Only asks about UI widgets | Notices 1 UX gap (mobile or empty state) | 2+ UX improvements with rationale; mentions accessibility | Spots inconsistent behavior across states; ties changes to user persona |
| 5 | **Security & Auth** | Never touches; no reaction when probed | Asks about login method only | Asks about permission model OR invite link security | Asks about AI data privacy, EXIF stripping, token expiry, rate limiting — all unprompted |
| 6 | **Performance** | Never mentions speed, caching, queries | Says "it should be fast" vague | Asks about N+1 / batch loading OR AI streaming UX | Asks "how many users?" then designs caching strategy; debates compute-vs-read trade-offs |

### Quick Tally

| Score Band | Verdict |
|-----------|---------|
| **+6 to +12** | 🟢 Strong Hire — thinks comprehensively across all dimensions |
| **+2 to +5** | 🟡 Hire — good depth in some areas, gaps in others (challenge to close) |
| **–3 to +1** | 🟠 Weak — mostly surface-level; doesn't dig |
| **–6 to –4** | 🔴 No Hire — few questions, no curiosity, no system thinking |

**How to use:** As interview runs, jot +1/−1 per dimension based on strongest signal observed. Don't tally mid-interview — assign scores in last 2 minutes based on notes.

---

## Live Build Facilitation Guide (Candidate Talks + Builds)

This format: you show the mockup. Candidate both talks through their thinking AND starts building (with AI agent or pseudo-code). You interject to probe depth. Here's how to control the session.

### Phase Structure (30–40 min)

| Phase | Time | What candidate does | What you do |
|-------|------|--------------------|-------------|
| **1. Scout** | 0–5 min | Candidate studies mockup, asks clarifying questions | Answer from spec. Note what they ask vs miss. |
| **2. Scaffold** | 5–15 min | Candidate lays out architecture: sub-systems, data model, component tree | Listen for decomposition quality. Push: "Why that boundary?" "What owns this data?" |
| **3. Build one slice** | 15–25 min | Candidate picks ONE feature and builds it (AI agent or pseudo-code) — e.g. "the meal grid" or "shopping list generation" | Watch: do they start with data model or UI? Do they handle edge cases? Do they check AI output? |
| **4. Stress test** | 25–30 min | You throw a curveball: "User goes offline" or "Two people edit same slot" | Observe reaction. Do they adapt the design or punt to v2? |
| **5. Wrap** | Last 5 min | You probe missed areas (security, perf, AI edge cases) | Fill gaps. Ask "anything you'd do differently?" |

### How to Control the Pace

**Too fast — candidate jumps to code without thinking:**
> "Before you write anything — walk me through what pieces this app needs. Just name them."

**Too slow — candidate stuck in analysis paralysis:**
> "Pick one part — the meal grid — and start building. We can talk through the rest as we go."

**Candidate relies too much on AI without reviewing:**
> "The AI just generated this data model. Do you agree with it? What would you change?"

**Candidate only builds, never explains:**
> "Pause there. Why did you choose this approach over the alternative?"

**Candidate goes down a rabbit hole (one feature too deep):**
> "Let's zoom out. You've spent 10 min on ingredient dedup. What else in the app is more important to get right first?"

### What to Watch in Each Phase

**Phase 1 — Scout:**
- Do they ask about multi-user? Offline? Scope?
- Do they notice missing pieces in the mockup? (no search bar, no date picker)
- Do they establish who the user is before designing?

**Phase 2 — Scaffold:**
- Sub-systems named with clear boundaries? Or just "frontend + backend + DB"?
- Data ownership: which service owns Recipe? Who queries it?
- Do they think about the hard parts first (shopping list aggregation) or the easy parts (CRUD)?

**Phase 3 — Build one slice:**
- Start with data model or UI? (data-first = backend-leaning, UI-first = frontend-leaning — neither is wrong, but note the pattern)
- Do they test the AI's output or accept it blindly?
- Do they handle loading, empty, error states?
- Do they mention how this slice connects to the rest?

**Phase 4 — Stress test:**
- Do they have a real answer or hand-wave?
- Do they admit "I don't know, here's how I'd find out" — that's a strong signal
- Do they retroactively fix their design or defend it reasonably?

**Phase 5 — Wrap:**
- Areas they never touched = blind spots. Note them.
- "What would you do differently?" reveals self-awareness.

### Sample Prompts to Move Between Phases

```
Phase 1 → 2: "You've seen the mockup. Before any code — what are the big pieces?"

Phase 2 → 3: "Good. Now pick one piece — whichever you think is hardest or most important — and let's build it. You can use AI."

Phase 3 → 4: "Let's say this is deployed. Two family members open the same week. One drags Tuesday dinner to Wednesday. The other deletes Tuesday dinner. What happens?"

Phase 4 → 5: "We have a few minutes left. You haven't mentioned [security / performance / offline]. Quick thoughts?"
```

### Red Flags in Live Build Mode

| Behavior | Signal |
|----------|--------|
| Jumps straight to "I'll use React + Firebase" without understanding the problem | Weak — solution-first, not problem-first |
| Spends entire time on UI, never mentions data or API | Weak — frontend tunnel vision |
| AI generates wrong data model, candidate doesn't notice | Weak — no review instinct |
| Gets defensive when you challenge a design choice | Red flag — can't take feedback |
| Says "AI will handle that" for every hard problem | Red flag — no critical thinking |
| Asks you "is this right?" constantly instead of reasoning | Weak — lacks confidence or capability |
| Pivots smoothly when you throw a curveball | Strong — adaptable |
| Catches AI mistakes and explains why they're wrong | Strong — deep understanding + review skill |
| Admits uncertainty, proposes how to validate | Strong — intellectual honesty |

---

## What You Measure

Candidate's questions reveal their mental model. Track:

**Area 1 — Data & Relationships**
Do they ask how things connect?
- Planner ↔ Recipe ↔ Shopping List relationship? (MealSlot binds Recipe → aggregate ingredients → list)
- Recipe source? (manual / AI / import)
- Saved Menus saves what? (entire week or single meal)
- Inventory ↔ Shopping List overlap? (already-owned items skip list)

**Area 2 — Systems & Challenges**
Do they surface hard problems?
- Recipe scaling (2-serving recipe for 4 people)
- Ingredient dedup across meals ("garlic 3 cloves" from 3 recipes)
- Unit normalization (1 head vs 3 cloves)
- Multi-user edit conflict (two family members same slot)

**Area 3 — AI Features**
How do they interrogate the AI tools?
- Ask about accuracy / hallucination / fallback?
- Ask about data sent to LLM? Privacy?
- Ask about latency UX?
- Ask about cold start (new user, no history)?

**Area 4 — UX & Interactions**
Do they think about the user?
- Mobile responsiveness noticed?
- Empty states ("What does first-time user see?")
- Overload / notification fatigue?
- Ask about onboarding flow?

**Area 5 — Security & Auth**
Do they consider data protection?
- Ask how login works? (Email + OAuth? Session management?)
- Ask about family sharing permission model? (Owner vs Member vs Guest)
- Ask about invite link security? (Token expiry? Revoke? One-time use?)
- Ask about AI data privacy? (Chat sent to LLM? Photos stored? For training?)
- Ask about photo storage? (EXIF data? Encryption? Deletion?)
- Ask about rate limiting? (AI chat or API abuse)

**Area 6 — Performance & Scale**
Do they think about real-world constraints?
- Ask about Shopping List compute time? (Full week × 10+ meals → ingredient aggregation + dedup + categorization)
- Ask about meal grid load speed? (21 slots × recipe data × nutrition cache)
- Ask about AI chat latency? (LLM 3–10s response — streaming? Skeleton UI? Prefetch?)
- Ask about database query patterns? (N+1 when loading week view? How to batch?)
- Ask about ingredient search speed? (Full-text vs semantic vs tag-only — depends on 200 vs 2000 recipes)
- Ask about photo upload / processing? (File size limit, compression, AI processing pipeline)
- Ask about scaling assumptions? ("How many users? How many recipes per household?")
- Ask about caching strategy? (Nutrition data stale? Weather for outdoor meals? AI suggestions?)

---

## Strong vs Weak Response Patterns

| Observed Behavior | Signal |
|---|---|
| Asks 5+ questions spanning data, system, AI, UX | Strong — covers breadth, builds mental map |
| Questions follow a logical chain (Planner → Recipe → Shopping List → deduct inventory) | Strong — traces data flow |
| Asks "what happens when..." (offline, conflict, missing data) | Strong — tests assumptions |
| Notices AI badges in mockup and asks how AI suggestions are generated | Positive — curious about AI |
| Notices something in mockup missing (no date picker, no search bar) | Positive — detail-oriented |
| Asks only surface-level questions ("what does this button do") | Weak — not thinking about system |
| Asks only about UI / visual, never about data flow | Weak — frontend-heavy mindset |
| Never mentions offline, conflict, or error states | Weak — "happy path only" thinking |
| Asks about security / auth / multi-user permissions unprompted | Bonus — rare for 30min |
| Probes invite link security (expiry, revocation, one-time) | Strong — understands share-link risks |
| Asks about AI data privacy (chat logs, photo storage, training) | Strong — LLM-aware, privacy-minded |
| Asks about auth method but not permission model | Neutral — knows auth is needed, hasn't thought about resource-level authorization |
| Never touches any security topic, even when prompted | Weak — for household data app, this is a gap |
| Asks about query performance (N+1, batch loading) | Strong — thinking about DB + frontend interaction |
| Notices AI latency and asks about streaming / skeleton UI | Strong — considers full UX chain, not just API call |
| Asks "how many users / recipes" before designing | Strong — performance assumptions should bound design |
| Mentions caching strategy unprompted | Positive — systems-aware, not "always fetch from DB" |
| Never mentions load speed, query count, or caching | Neutral — acceptable for 30min but note gap |
| Notices only AI latency but not DB or grid loading | Neutral — partial performance awareness |

---

## Your Role as Interviewer

**Do:** Answer clearly. Give details if asked. Probe "What do you think?" when candidate asks a question you want to test their thinking on.

**Don't:** Volunteer spec. Let candidate discover gaps. If they don't ask about offline, that's data.

**Optional final probe (if time, 5 min):**
If candidate has covered 2–3 areas well, ask one you didn't hear:

> "One thing you didn't ask about — the AI Meal Assistant's first message says 'I noticed you have leftover spinach.' How do you think it knows that? What are the design implications?"

Or:

> "If two family members open the same week at the same time and one adds a meal — what happens on the other screen?"

**Security probe (if candidate never touched it):**

> "You didn't ask about login or security. For a family app with shared data and AI features — what's your baseline auth and security model?"

**Performance probe (if candidate never touched it):**

> "You haven't asked about performance. The meal grid loads 21 slots. Each slot needs recipe data, calories, tags. And the shopping list aggregates across all meals. Walk me through how you'd make sure this loads fast enough."

---

## Scoring (30-min condensed)

| Level | Criteria |
|-------|----------|
| **Strong Hire** | Asks 5+ questions across 3+ areas. At least one "what happens when" question. Can trace data flow correctly. Raises a hard problem (conflict/offline/normalization) unprompted. |
| **Hire** | Asks 3–4 questions in 2 areas. Understands data relationships when explained. Follow-up questions show engagement. |
| **Weak** | Mostly UI questions only. Doesn't dig into data or system logic. Accepts answers without follow-up. |
| **No hire** | Few questions, no curiosity, accepts everything, asks nothing about how it works. |

---

## Quick Reference: Key Answers (Spec Cheat Sheet)

Candidate likely asks these. Have ready:

| Question | Short Answer |
|----------|-------------|
| How are Shopping List generated? | Aggregate ingredients from assigned meals × servings, deduplicate, categorize. Manual add also possible. |
| Planner repeats every week? | No — each week is blank. User can copy a previous week or saved menu. |
| What is Saved Menus? | An entire week's meal plan (21 slots). Not single meal. |
| How does Recipe get into Planner? | Tap "+" → pick from saved recipes. Or AI Generate. Or Chat → "Add to meal plan". |
| How does AI Meal Assistant work? | Chat with context (dietary, inventory, history). Proactive if unused ingredients detected. Can't book or diagnose. |
| How does Snap a Recipe work? | Photo → AI identifies dish + estimated ingredients → user edits → saves to Recipe library. |
| How does What's in My Fridge work? | Photo → detect items → user confirms → match recipes by coverage → suggest + show missing ingredients. |
| Recipe ↔ MealSlot relationship? | 1 MealSlot = 1 Recipe (+ servings override). Not multi-recipe per slot. |
| Calorie source? | Ingredient-level aggregate from USDA DB. Falls back to AI estimate for unknown ingredients. Always shows confidence. |
| Inventory sync with reality? | Re-scan primary. Usage deduction secondary + manual. No auto-decrement on meal cook. |
| Multi-user editing? | Not fully specified. Consider last-write-wins with notification, or slot-level lock. |
| **How does login work?** | Email + password (bcrypt) or Google OAuth. JWT access + refresh token. |
| **Household sharing model?** | Owner creates household → invite link → member creates account. Roles: Owner (full control), Member (edit), Guest (read-only, temporary). |
| **Invite link security?** | One-time use + expiry + revocable. Token in hash fragment (#), not query param. |
| **AI data privacy?** | Chat content sent to LLM API. Disclose in privacy policy. Photo not stored after processing (opt-in for improvement). EXIF stripped on upload. |
| **Rate limiting?** | AI chat: 5–10 queries/day per household. API rate limit per IP/token. |
| **Meal grid loading performance?** | 21 slots × recipe name + cal + tags + source. N+1 risk. Batch-load recipe + nutrition in 1–2 queries. Cache nutrition snapshot per day. Target: <1s. |
| **Shopping list compute performance?** | Full week = ~21 recipes × avg 8 ingredients = ~168 lines. Aggregate + dedup + categorize + check inventory. Compute on meal change, cache result. Target <2s. |
| **AI chat latency?** | LLM takes 3–10s. Stream response token-by-token (SSE/WebSocket). Show skeleton bubbles + "Typing..." immediately. Cache frequent queries. |
| **Search recipes?** | 20–200 recipes per household. Full-text (pg_trgm / SQLite FTS) sufficient at this scale. V2: semantic search with embeddings for ingredient-match queries. |
| **Photo upload & processing?** | Compress to ≤4MB client-side before upload. Server-side compression fallback. AI processing async — show progress states. EXIF stripped server-side. |
| **Scaling assumptions?** | 10k households year 1, 100k year 2. Avg 100 recipes/household. DB: 1M recipes, 10M meal slots, 50M task instances. Index on (household_id, date, meal_type). |

---

---

# 面试：MealPlan — 30分钟候选人主导模式

**角色：** 中级开发（3–4年 Android → Web）
**Mockup：** `interview-mockup.html`（浏览器打开）
**时长：** 30–40 分钟

---

## 🏆 记分表（3秒一览）

| # | 维度 | −1（红旗） | 0（中性） | +1（好） | +2（强） |
|---|-------|-----------|----------|---------|---------|
| 1 | **数据与关系** | 从不问各部分怎么连接 | 被提示后才问 1 个连接问题 | 主动追溯 Planner → Recipe → Shopping List 链条 | 问 Saved Menus 范围、inventory 重叠、scaling edge case |
| 2 | **系统与挑战** | 只看 happy path；不问"如果" | 提 1 个挑战（缩放或冲突） | 问去重、单位归一化、或多人冲突 | 问 2+ 个难点；讨论权衡（如 lock vs CRDT） |
| 3 | **AI 功能** | 假设 AI 直接能用；无兜底 | 问"怎么工作"表层 | 问幻觉、延迟 UX、冷启动 | 问 LLM 数据隐私、streaming UX、部分匹配、质量边界 |
| 4 | **UX 与交互** | 只问 UI 控件 | 注意到 1 个 UX 缺口（移动或空状态） | 2+ 个 UX 改进且有理有据；提无障碍 | 发现跨状态行为不一致；把改进关联到用户画像 |
| 5 | **安全与登录** | 从不碰；被追问也不反应 | 只问登录方式 | 问权限模型 或 邀请链接安全 | 主动问 AI 数据隐私、EXIF 剥离、token 过期、限流 |
| 6 | **性能** | 从不提速度、缓存、查询 | 模糊说"应该要快" | 问 N+1 / batch 加载 或 AI streaming UX | 问"多少用户"然后设计缓存策略；讨论计算 vs 读取权衡 |

### 快速算分

| 得分区间 | 结论 |
|---------|------|
| **+6 至 +12** | 🟢 强烈录用 — 全维度综合思考 |
| **+2 至 +5** | 🟡 录用 — 某些领域有深度，其他有缺口（可弥补） |
| **–3 至 +1** | 🟠 弱 — 基本浮于表面；不深入 |
| **–6 至 –4** | 🔴 不录用 — 问题少，无好奇心，无系统思维 |

**使用方法：** 面试过程中根据观察到的最强信号在每维度记 +1/−1。不要在面试中算分——最后 2 分钟根据笔记打分。

---

## 现场搭建引导指南（候选人边讲边做）

这个模式：你展示 mockup，候选人一边讲思路一边搭建（用 AI agent 或伪代码）。你在关键节点追问深度。以下是如何控制节奏。

### 阶段结构（30–40 分钟）

| 阶段 | 时间 | 候选人做什么 | 你做什么 |
|------|------|-------------|----------|
| **1. 侦察** | 0–5 分钟 | 研究 mockup，问澄清问题 | 根据 spec 回答。注意他们问了什么、漏了什么。 |
| **2. 搭建骨架** | 5–15 分钟 | 梳理架构：子系统、数据模型、组件树 | 听分解质量。追问："为什么这样划边界？""这个数据谁拥有？" |
| **3. 做一个切片** | 15–25 分钟 | 选一个功能开始搭建（AI agent 或伪代码）— 比如"meal grid"或"shopping list 生成" | 观察：先做数据模型还是先做 UI？处理边界情况吗？检查 AI 输出吗？ |
| **4. 压力测试** | 25–30 分钟 | 你扔一个拐弯问题："用户离线了"或"两个人同时编辑同一个 slot" | 观察反应。是调整设计还是推到 v2？ |
| **5. 收尾** | 最后 5 分钟 | 追问遗漏的领域（安全、性能、AI 边界情况） | 填补盲区。问"有什么你想重做的？" |

### 如何控制节奏

**太快 — 候选人没思考就跳进代码：**
> "在写代码之前——先说说这个 app 需要哪些模块。就列名字。"

**太慢 — 候选人困在分析中不动手：**
> "挑一个部分——比如 meal grid——开始做。其他的边做边聊。"

**候选人过度依赖 AI 不 review：**
> "AI 刚生成了这个数据模型，你同意吗？你会改什么？"

**候选人只搭不说：**
> "暂停一下。为什么选这个方案而不是另一个？"

**候选人钻进一个功能太深出不来：**
> "我们拉远一点。你在 ingredient 去重上花了 10 分钟。app 里还有哪个部分更值得先做对？"

### 每个阶段观察什么

**阶段 1 — 侦察：**
- 问不问多用户？离线？范围？
- 注没注意到 mockup 缺了什么？（没搜索栏、没日期选择器）
- 设计之前有没有确认用户是谁？

**阶段 2 — 搭骨架：**
- 子系统有清晰边界？还是只是"前端 + 后端 + 数据库"？
- 数据归属：哪个服务拥有 Recipe？谁查询它？
- 先想难的部分（shopping list 聚合）还是先想简单的（CRUD）？

**阶段 3 — 做一个切片：**
- 先做数据模型还是先做 UI？（数据优先 = 后端倾向，UI 优先 = 前端倾向 — 都没错，但注意模式）
- 有没有测试 AI 的输出还是直接接受？
- 有没有处理 loading、空状态、错误状态？
- 有没有说这个切片怎么跟其他部分连接？

**阶段 4 — 压力测试：**
- 有真实的答案还是打马虎眼？
- 说"我不确定，但我会这样去找答案" — 这是强信号
- 是回头改设计还是合理辩护？

**阶段 5 — 收尾：**
- 他们从没碰过的领域 = 盲点。标注下来。
- "有什么你想重做的？" 测试自我认知。

### 切换阶段的提示语

```
阶段 1 → 2："你看了 mockup。在写代码之前——有哪些大模块？"

阶段 2 → 3："好。挑一个模块——你觉得最难或最重要的——开始做。可以用 AI。"

阶段 3 → 4："假设这个已经上线了。两个家庭成员同时打开同一周。一个人把周二晚餐拖到周三。另一个人删了周二晚餐。会发生什么？"

阶段 4 → 5："还剩几分钟。你还没提 [安全 / 性能 / 离线]。简单说说？"
```

### 现场搭建模式的红旗信号

| 行为 | 信号 |
|------|------|
| 没理解问题就跳进"我用 React + Firebase" | 弱 — 方案优先，不优先理解问题 |
| 全程只做 UI，从不提数据或 API | 弱 — 前端窄视野 |
| AI 生成了错误的数据模型，候选人没发现 | 弱 — 没有 review 本能 |
| 被你挑战设计选择时变得防御 | 红旗 — 不能接受反馈 |
| 每个难题都说"AI 会处理" | 红旗 — 没有批判性思维 |
| 不停问你"这样对吗"而不是自己推理 | 弱 — 缺乏信心或能力 |
| 被你扔拐弯问题时能平稳转向 | 强 — 适应力 |
| 能抓住 AI 的错误并解释为什么错 | 强 — 深度理解 + review 能力 |
| 承认不确定，提出验证方法 | 强 — 诚实的智力 |

---

## 你要观察什么

候选人的问题反映他们的思维模型。记录：

**领域 1 — 数据与关系**
他们问不问数据之间的联系？
- Planner ↔ Recipe ↔ Shopping List 的关系？（MealSlot 绑定 Recipe → 聚合 ingredients → 生成 list）
- Recipe 来源？（手动 / AI / 导入）
- Saved Menus 保存什么？（整个周还是单个 meal）
- Inventory 和 Shopping List 的重叠？（已拥有的物品不加入 list）

**领域 2 — 系统与挑战**
他们会不会主动暴露难点？
- Recipe 按人份缩放（2 人份菜谱做 4 人份）
- Ingredient 跨餐去重（3 道菜都用 garlic → "garlic 3 cloves"）
- 单位归一化（1 head vs 3 cloves）
- 多人同时编辑冲突（两个家庭成员改同一个 slot）

**领域 3 — AI 功能**
他们怎么追问 AI 功能？
- 问准确率 / 幻觉 / 兜底方案？
- 问发送到 LLM 的数据？隐私？
- 问延迟 UX？
- 问冷启动（新用户无历史）？

**领域 4 — UX 与交互**
他们想没想到用户？
- 注意到移动端适配问题？
- 空状态（"新用户第一次看到什么？"）
- 通知过载 / 疲劳？
- 问引导流程？

**领域 5 — 安全与登录**
他们考虑不考虑数据保护？
- 问登录方式？（Email + OAuth？Session 管理？）
- 问家庭共享权限模型？（Owner vs Member vs Guest）
- 问邀请链接安全？（Token 过期？撤销？一次性？）
- 问 AI 数据隐私？（Chat 发到 LLM？照片存储？用于训练？）
- 问图片存储？（EXIF 数据？加密？删除？）
- 问限流？（AI chat 或 API 滥用）

**领域 6 — 性能与规模**
他们想没想到真实世界的约束？
- 问 Shopping List 计算时间？（整周 × 10+ 个 meal → ingredient 聚合 + 去重 + 分类）
- 问 meal grid 加载速度？（21 个 slot × recipe 数据 × nutrition cache）
- 问 AI chat 延迟？（LLM 3–10s 响应 — streaming？Skeleton UI？Prefetch？）
- 问数据库查询模式？（加载一周视图时有 N+1 吗？怎么做 batch 加载？）
- 问 ingredient 搜索速度？（全文搜索 vs 语义搜索 vs 标签搜索 — 200 个 recipe 和 2000 个策略不同）
- 问图片上传 / 处理？（文件大小限制、压缩、AI 处理管道）
- 问规模假设？（"多少用户？每个家庭多少 recipe？"）
- 问缓存策略？（Nutrition 数据过期？户外活动的天气？AI 建议？）

---

## 能力强弱信号对照

| 观察到的行为 | 信号 |
|---|---|
| 问 5+ 个问题，跨数据、系统、AI、UX | 强 — 覆盖广度，构建思维地图 |
| 问题有逻辑链条（Planner → Recipe → Shopping List → 扣减 inventory） | 强 — 追踪数据流 |
| 问"如果...会怎样"（离线、冲突、数据缺失） | 强 — 测试假设 |
| 注意到 mockup 中的 AI 徽标，问 AI 建议怎么生成 | 正面 — 对 AI 好奇 |
| 注意到 mockup 里缺了什么东西（没有日期选择器、没有搜索栏） | 正面 — 注重细节 |
| 只问表层问题（"这个按钮是干嘛的"） | 弱 — 没有系统思维 |
| 只问 UI / 视觉，从不问数据流 | 弱 — 偏前端思维 |
| 从不提离线、冲突或错误状态 | 弱 — 只看 happy path |
| 主动问安全 / 登录 / 多用户权限 | 加分 — 30 分钟内少见 |
| 追问邀请链接安全（过期、撤销、一次性） | 强 — 理解分享链接风险 |
| 问 AI 数据隐私（聊天记录、图片存储、训练） | 强 — LLM 意识 + 隐私观念 |
| 问了登录方式但没问权限模型 | 中性 — 知道需要登录，但没想资源级授权 |
| 从不碰任何安全话题，即使被追问 | 弱 — 对家庭数据 app 来说是个缺口 |
| 问查询性能（N+1、batch 加载） | 强 — 思考 DB + 前端交互 |
| 注意到 AI 延迟，问 streaming / skeleton UI | 强 — 考虑完整 UX 链路，不只是 API 调用 |
| 在设计前问"多少用户 / recipe" | 强 — 性能假设应该决定设计边界 |
| 主动提缓存策略 | 正面 — 有系统意识，不是"总是从 DB 取" |
| 从不提加载速度、查询数或缓存 | 中性 — 30 分钟内可以接受，但注意缺口 |
| 只注意到 AI 延迟但没提 DB 或 grid 加载 | 中性 — 部分性能意识 |

---

## 你作为面试官的角色

**做：** 清晰回答。被问到就给细节。当候选人问了你想考察他们思考的问题时，反问"你怎么看？"

**不做：** 主动输出 spec 内容。让候选人自己发现缺口。如果他们不问离线，那就是数据。

**可选最终追问（如果时间允许，5 分钟）：**
如果候选人已经覆盖了 2–3 个领域且表现不错，挑一个你没听到的问：

> "有一点你没问——AI Meal Assistant 的第一条消息说'我注意到你上周有剩下的菠菜和甜椒'。你觉得它是怎么知道的？设计上有什么需要注意的？"

或者：

> "如果两个家庭成员同时打开同一周，一个人加了一道菜——另一个人的屏幕上会发生什么？"

**安全追问（如果候选人从未触及）：**

> "你没问登录或安全。这是一个家庭共享数据的 app，还有 AI 功能——你最基本的登录和安全模型是什么？"

**性能追问（如果候选人从未触及）：**

> "你没问性能问题。Meal grid 加载 21 个 slot，每个 slot 需要 recipe 数据、卡路里、标签。Shopping list 要聚合所有 meal。你来说说怎么保证它加载够快。"

---

## 评分（30 分钟浓缩版）

| 等级 | 标准 |
|------|------|
| **强烈录用** | 问 5+ 个问题覆盖 3+ 个领域。至少一个"如果...会怎样"问题。能正确追踪数据流。主动提出一个难点（冲突/离线/归一化）。 |
| **录用** | 问 3–4 个问题覆盖 2 个领域。解释数据关系后能理解。追问表现出参与度。 |
| **弱** | 主要只问 UI 问题。不深入数据或系统逻辑。接受答案后不追问。 |
| **不录用** | 问题很少，没有好奇心，接受一切，不问任何关于怎么工作的问题。 |

---

## 快速参考：关键答案 （Cheat Sheet）

候选人可能会问到这些。准备好：

| 问题 | 简短回答 |
|------|----------|
| Shopping List 怎么生成的？ | 聚合 assign 的 meals × 人份数的 ingredients，去重，分类。也可手动添加。 |
| Planner 每周重复吗？ | 不——每周是空白的。用户可以复制前一周或已保存的菜单。 |
| Saved Menus 保存什么？ | 保存整个星期的 meal plan（21 个 slot）。不是单顿 meal。 |
| Recipe 怎么进入 Planner？ | 点"+" → 从已保存 recipe 里选。或者 AI Generate。或者 Chat → "Add to meal plan"。 |
| AI Meal Assistant 怎么工作？ | 带上下文的 Chat（饮食偏好、库存、历史）。检测到未使用的食材时主动发起。不能订餐或诊断。 |
| Snap a Recipe 怎么用？ | 拍照 → AI 识别菜品 + 预估食材 → 用户编辑 → 保存到 Recipe 库。 |
| What's in My Fridge 怎么用？ | 拍照 → 检测物品 → 用户确认 → 按覆盖率匹配 recipe → 推荐 + 显示缺少的食材。 |
| Recipe 和 MealSlot 的关系？ | 1 个 MealSlot = 1 个 Recipe（+ 人份数覆盖）。不能多 recipe 在一个 slot。 |
| 卡路里来源？ | 从 USDA DB 按 ingredient 聚合。未知 ingredient 回退 AI 估算。总是显示置信度。 |
| Inventory 跟现实同步？ | 主要靠重新扫描。使用扣减是辅助 + 手动的。做饭时不会自动减少库存。 |
| 多人编辑？ | 没有完全确定。考虑 last-write-wins + 通知，或者 slot 级锁定。 |
| **登录怎么工作？** | Email + 密码（bcrypt）或 Google OAuth。JWT access + refresh token。 |
| **家庭共享模型？** | Owner 创建 household → 邀请链接 → member 创建账号。角色：Owner（完全控制）、Member（编辑）、Guest（只读、临时）。 |
| **邀请链接安全？** | 一次性 + 过期 + 可撤销。Token 放在 hash fragment（#）而不是 query param。 |
| **AI 数据隐私？** | Chat 内容发到 LLM API。在隐私政策中披露。处理后不存照片（可选择 opt-in 改进）。上传时剥离 EXIF。 |
| **限流？** | AI chat：每家庭每天 5–10 次查询。API 按 IP/token 限流。 |
| **Meal grid 加载性能？** | 21 个 slot × recipe 名称 + 卡路里 + 标签 + 来源。有 N+1 风险。用 1–2 个查询 batch 加载 recipe + nutrition。缓存每日 nutrition snapshot。目标 <1s。 |
| **Shopping list 计算性能？** | 整周 ≈ 21 个 recipe × 平均 8 种食材 ≈ 168 行。聚合 + 去重 + 分类 + 检查库存。meal 变更时计算，缓存结果。目标 <2s。 |
| **AI chat 延迟？** | LLM 需要 3–10s。用 SSE/WebSocket 逐 token 流式传输。立即显示 skeleton 气泡 + "正在输入..."。缓存频繁查询。 |
| **搜索 recipe？** | 每个家庭 20–200 个 recipe。全文搜索（pg_trgm / SQLite FTS）在这个规模足够。V2：用 embedding 做语义搜索来匹配 ingredient 查询。 |
| **图片上传与处理？** | 客户端压缩到 ≤4MB 再上传。服务端压缩兜底。AI 处理异步 — 显示进度状态。服务端剥离 EXIF。 |
| **规模假设？** | 第一年 1 万家庭，第二年 10 万。平均每个家庭 100 个 recipe。DB：1M recipes，10M meal slots，50M task instances。在 (household_id, date, meal_type) 上加索引。 |
