[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"site-settings":3,"wb-me":13,"wb-ai-stats":14,"interview-list|{\"topic\":\"\",\"kind\":\"\",\"difficulty\":\"\",\"sort\":\"hot\",\"keyword\":\"\",\"page\":1}":42,"interview-public-stats":270,"interview-public-hot":294,"interview-topics-filter":312},{"theme":4,"brandColor":5,"logoUrl":6,"faviconUrl":6,"footerText":6,"copyright":6,"icp":7,"stockEnabled":8,"loginEnabled":9,"commentEnabled":9,"name":10,"tagline":11,"description":12},"blue","#2563eb","","粤ICP备20013202号",true,false,"javascript技术分享","AI 驱动的现代化博客系统","javascript技术分享 — AI 驱动的现代化博客系统，分享技术、生活与思考",null,{"code":15,"message":16,"data":17,"timestamp":41},200,"success",{"total":18,"byType":19,"byPlatform":25,"platforms":31},1135,{"skill":20,"tool":21,"model":22,"prompt":23,"mcp":24},46,148,1,298,642,{"cursor":26,"claude-desktop":26,"Claude Code":27,"pi":28,"Cursor":29,"VS Code":30,"Codex CLI":22,"Ollama":22,"终端":22},29,13,11,8,7,[32,33,34,35,36,37,38,39,40],"cursor","claude-desktop","Claude Code","pi","Cursor","VS Code","Codex CLI","Ollama","终端",1796090253870,{"code":15,"message":16,"data":43,"timestamp":269},{"records":44,"total":267,"size":268,"current":22,"pages":212},[45,73,87,106,124,145,167,184,201,219,233,251],{"id":46,"slug":47,"companyId":48,"companyName":49,"companySlug":50,"position":51,"round":52,"difficulty":53,"questionType":54,"topicId":53,"topicName":55,"questionKind":56,"points":22,"title":57,"body":58,"answer":59,"followUps":60,"askedYear":63,"starCount":64,"viewCount":65,"status":66,"submitterId":22,"publishedAt":67,"createdAt":68,"updatedAt":69,"tags":70},33,"three-sum",2,"腾讯","tencent","algo","一面",3,"coding","算法","subjective","三数之和(15 题)","给定整数数组,找出所有和为 0 且不重复的三元组。\n示例:`[-1,0,1,2,-1,-4]` → `[[-1,-1,2],[-1,0,1]]`。","思路:**排序 + 双指针**,外层固定第一个数,内层左右指针收敛。\n- 排序后数组升序,若 `nums[i] > 0` 可直接终止;答案需**去重**:外层跳过重复的 i,内层命中后左右都跳过重复值。\n- 和小于 0 左指针右移,大于 0 右指针左移,等于 0 记录并同时收缩。\n复杂度:时间 **O(n²)**,空间 O(1)(不含结果)。\n坑:先排序是关键,否则无法用双指针;去重逻辑遗漏会导致结果集重复。",[61,62],"四数之和怎么推广?","两数之和为什么用哈希表更优?",2025,0,70,"published","2026-10-16T19:24:10.778881","2026-10-16T19:24:10.779024","2026-10-16T19:24:10.77906",[71,72],"双指针","数组",{"id":74,"slug":75,"position":76,"round":77,"difficulty":53,"questionType":76,"topicId":22,"topicName":78,"questionKind":79,"points":22,"title":80,"body":81,"answer":82,"followUps":83,"starCount":64,"viewCount":84,"status":66,"publishedAt":85,"createdAt":85,"updatedAt":85,"tags":86},507,"java-hashmap-1jq9q5","objective","笔试","Java 后端","single","HashMap 树化阈值","在 JDK 8 的 HashMap 中，当链表长度达到多少，并且数组容量不小于 64 时，会将该链表转换为红黑树？","正确答案：C",[],69,"2026-10-18T12:50:14.980487",[],{"id":26,"slug":88,"position":89,"round":52,"difficulty":53,"questionType":90,"topicId":48,"topicName":91,"questionKind":56,"points":22,"title":92,"body":93,"answer":94,"followUps":95,"askedYear":98,"starCount":64,"viewCount":99,"status":66,"submitterId":22,"publishedAt":100,"createdAt":101,"updatedAt":102,"tags":103},"cors-preflight","frontend","concept","前端","跨域与 CORS 预检请求","浏览器的同源策略限制了什么?简单请求和复杂请求的区别在哪?\n实际项目里怎么解决跨域?","同源要求**协议、域名、端口**三者一致,策略限制的是**读取响应**,请求本身通常已经发出去了。\n- **简单请求**:方法为 GET\u002FHEAD\u002FPOST 且头只含安全字段(Content-Type 仅限表单三种),直接发请求,浏览器检查 `Access-Control-Allow-Origin`。\n- **复杂请求**会先发 **OPTIONS 预检**,服务端需返回 `Allow-Origin\u002FAllow-Methods\u002FAllow-Headers`,可用 `Access-Control-Max-Age` 缓存预检结果。\n- 带 cookie 时必须同时设 `Allow-Credentials: true` 且 Origin **不能为通配符 `*`**。\n工程方案:开发用 Vite\u002FNginx 代理,生产同域部署或网关统一处理 CORS。",[96,97],"JSONP 的原理和局限?","CORS 预检失败怎么定位?",2024,59,"2026-10-16T19:24:10.688789","2026-10-16T19:24:10.688952","2026-10-16T19:24:10.68899",[104,105],"浏览器","跨域",{"id":107,"slug":108,"companyId":48,"companyName":49,"companySlug":50,"position":89,"round":109,"difficulty":110,"questionType":90,"topicId":48,"topicName":91,"questionKind":56,"points":22,"title":111,"body":112,"answer":113,"followUps":114,"askedYear":63,"starCount":64,"viewCount":117,"status":66,"submitterId":22,"publishedAt":118,"createdAt":119,"updatedAt":120,"tags":121},26,"react-fiber-reconciliation","二面",4,"React Fiber 与 Diff 算法","Fiber 架构解决了什么问题?它是如何实现可中断渲染的?\nReact 的 diff 算法用了哪些优化策略?","问题:栈调和是**递归同步**的,长任务会阻塞主线程导致掉帧。Fiber 把渲染拆成**可中断的工作单元链表**,由 Scheduler 在空闲时执行,并支持**优先级**(用户输入 > 数据请求)。\n- 渲染分 **render(可中断)** 与 **commit(同步、不可中断)** 两阶段。\n- diff 三条策略:① 只做**同层比较**;② 元素**类型不同直接重建**子树;③ 列表用 **key** 标识复用,key 需稳定唯一。\n坑:用数组下标做 key,在插入\u002F删除时会导致组件状态错乱。",[115,116],"useMemo\u002FuseCallback 真能提升性能吗?","并发模式下的时间切片怎么工作?",51,"2026-10-16T19:24:10.61969","2026-10-16T19:24:10.61987","2026-10-16T19:24:10.61991",[122,123],"Fiber","React",{"id":22,"slug":125,"companyId":22,"companyName":126,"companySlug":127,"position":128,"round":52,"difficulty":53,"questionType":90,"topicId":22,"topicName":78,"questionKind":56,"points":22,"title":129,"body":130,"answer":131,"followUps":132,"askedYear":136,"starCount":64,"viewCount":137,"status":66,"submitterId":22,"publishedAt":138,"createdAt":139,"updatedAt":140,"tags":141},"java-concurrenthashmap-thread-safety","字节跳动","bytedance","java","ConcurrentHashMap 如何保证线程安全？","JDK8 之后 ConcurrentHashMap 的并发控制从分段锁改成了什么？请说明 put 的流程，以及为什么不允许 null key \u002F null value。","JDK7 用 Segment 分段锁，锁粒度是段；JDK8 改为 CAS + synchronized 锁单个桶头节点，扩容时多线程协助迁移（sizeCtl \u002F ForwardingNode）。不允许 null：并发下无法区分「key 不存在」与「key 存在但值为 null」，会造成二义性。",[133,134,135],"扩容时其他线程怎么参与迁移？","size() 在并发下怎么统计？","为什么用 synchronized 而不是 ReentrantLock？",2026,49,"2026-10-16T13:03:33.663356","2026-10-16T13:03:33.667514","2026-10-16T13:03:33.668346",[142,143,144],"Java","并发","集合",{"id":146,"slug":147,"companyId":53,"companyName":148,"companySlug":149,"position":150,"round":151,"difficulty":22,"questionType":151,"topicId":152,"topicName":153,"questionKind":56,"points":22,"title":154,"body":155,"answer":156,"followUps":157,"askedYear":136,"starCount":64,"viewCount":160,"status":66,"submitterId":22,"publishedAt":161,"createdAt":162,"updatedAt":163,"tags":164},10,"hr-why-leave-last-job","阿里巴巴","alibaba","product","hr",5,"产品经理","为什么离开上一家公司？","这是 HR 面几乎必问的问题，说清你真正在意的东西，但不要抱怨前东家。","结构：肯定收获 → 说明成长诉求与现状错位 → 指向目标岗位的匹配点。避免：只谈钱、吐槽领导同事、说想换个环境这类空话。",[158,159],"你期望的团队氛围是什么样的？","如果新公司也有同样的问题你会怎么办？",48,"2026-10-16T13:03:34.21875","2026-10-16T13:03:34.21912","2026-10-16T13:03:34.219159",[165,166],"HR面","表达",{"id":168,"slug":169,"companyId":146,"companyName":170,"companySlug":171,"position":128,"round":172,"difficulty":110,"questionType":90,"topicId":22,"topicName":78,"questionKind":56,"points":22,"title":173,"body":174,"answer":175,"followUps":176,"askedYear":98,"starCount":64,"viewCount":160,"status":66,"submitterId":22,"publishedAt":179,"createdAt":180,"updatedAt":181,"tags":182},18,"aqs-reentrantlock","蚂蚁集团","antgroup","三面","AQS 原理与 ReentrantLock 实现","AQS 的核心数据结构是什么?如何实现独占和共享两种模式?\nReentrantLock 的公平锁与非公平锁区别在哪?","AQS 核心是 **volatile int state** + **CLH 双向队列**;获取失败入队并 `LockSupport.park`,释放时唤醒后继。\n- 独占模式重写 `tryAcquire\u002FtryRelease`(如 ReentrantLock),共享模式重写 `tryAcquireShared\u002FtryReleaseShared`(如 Semaphore、CountDownLatch)。\n- 可重入靠 state 计数:同线程再次获取时 state+1,释放递减到 0 才真正释放。\n- **非公平锁**直接 CAS 抢一次,抢不到再入队;公平锁先检查队列是否有前驱。非公平吞吐更高,但可能**饥饿**。",[177,178],"为什么 AQS 用双向队列?","Condition 是怎么实现等待\u002F通知的?","2026-10-16T19:24:10.409962","2026-10-16T19:24:10.411632","2026-10-16T19:24:10.41167",[183,143],"AQS",{"id":48,"slug":185,"companyId":53,"companyName":148,"companySlug":149,"position":128,"round":109,"difficulty":110,"questionType":186,"topicId":22,"topicName":78,"questionKind":56,"points":22,"title":187,"body":188,"answer":189,"followUps":190,"askedYear":136,"starCount":64,"viewCount":193,"status":66,"submitterId":22,"publishedAt":194,"createdAt":195,"updatedAt":196,"tags":197},"java-jvm-gc-tuning","system","线上服务频繁 Full GC，你怎么排查和调优？","一个日活百万的服务突然出现 Full GC 频率上升、接口 P99 抖动。请给出排查路径与调优手段。","先量化再动手：1) jstat -gcutil 看各代占用与 GC 耗时，确认是内存泄漏还是晋升过快；2) dump 堆用 MAT 找大对象与 GC Roots；3) 看是否大对象直接进老年代（网关缓存、批量查询）；4) 调优顺序：修代码 → 调堆比例\u002F晋升阈值 → 换收集器（G1\u002FZGC）。",[191,192],"G1 的 Mixed GC 触发条件是什么？","怎么判断是内存泄漏还是流量上涨？",47,"2026-10-16T13:03:33.780823","2026-10-16T13:03:33.781315","2026-10-16T13:03:33.781365",[198,199,200],"GC","JVM","排查",{"id":202,"slug":203,"companyId":29,"companyName":204,"companySlug":205,"position":89,"round":52,"difficulty":53,"questionType":90,"topicId":48,"topicName":91,"questionKind":56,"points":22,"title":206,"body":207,"answer":208,"followUps":209,"askedYear":63,"starCount":64,"viewCount":212,"status":66,"submitterId":22,"publishedAt":213,"createdAt":214,"updatedAt":215,"tags":216},25,"vue3-reactivity-proxy","快手","kuaishou","Vue3 响应式原理与 Proxy","Vue3 为什么用 Proxy 替换 Object.defineProperty?\nref 和 reactive 有什么区别,各自的坑是什么?","Vue3 用 **Proxy** 代理整个对象,可拦截**新增\u002F删除属性、数组下标修改、Map\u002FSet** 等操作;defineProperty 必须**递归遍历**初始化且无法监听新增属性。\n- 依赖收集靠 `track`,触发更新靠 `trigger`(effect + depsMap)。\n- `ref` 可包裹任意类型,模板中自动解包,JS 里需 `.value`;`reactive` 只对对象生效。\n坑:reactive 对象**整体替换**会失去响应;直接解构 reactive 会丢响应(需 `toRefs`);ref 嵌套进 reactive 会自动解包。",[210,211],"computed 和 watch 的实现差异?","shallowRef 用在什么场景?",45,"2026-10-16T19:24:10.59411","2026-10-16T19:24:10.594324","2026-10-16T19:24:10.59436",[217,218],"Vue","响应式",{"id":29,"slug":220,"companyId":22,"companyName":126,"companySlug":127,"position":51,"round":52,"difficulty":48,"questionType":54,"topicId":53,"topicName":55,"questionKind":56,"points":22,"title":221,"body":222,"answer":223,"followUps":224,"askedYear":136,"starCount":64,"viewCount":212,"status":66,"submitterId":22,"publishedAt":227,"createdAt":228,"updatedAt":229,"tags":230},"algo-lru-cache-handwrite","手写 LRU 缓存（O(1) 复杂度）","用你熟悉的语言实现一个 LRU 缓存，要求 get \u002F put 都是 O(1)，并说明为什么选这种数据结构。","哈希表（key → 节点）+ 双向链表（头部最新、尾部最旧）。get 命中后把节点移到头部；put 超容量时摘掉尾节点并从哈希表移除。避免用数组，否则移动元素是 O(n)。",[225,226],"怎么加过期时间？","并发访问时你怎么保证线程安全？","2026-10-16T13:03:34.117889","2026-10-16T13:03:34.118454","2026-10-16T13:03:34.118501",[231,55,232],"手写代码","缓存",{"id":234,"slug":235,"companyId":30,"companyName":236,"companySlug":237,"position":128,"round":52,"difficulty":53,"questionType":238,"topicId":22,"topicName":78,"questionKind":56,"points":22,"title":239,"body":240,"answer":241,"followUps":242,"askedYear":98,"starCount":64,"viewCount":245,"status":66,"submitterId":22,"publishedAt":246,"createdAt":247,"updatedAt":248,"tags":249},16,"redis-cache-avalanche-penetration","京东","jd","design","缓存穿透、击穿、雪崩的区别与应对","请区分缓存穿透、击穿和雪崩,并给出各自的工程方案。\n如何保证缓存与数据库的一致性?","**穿透**:查不存在的数据,请求压到 DB → 缓存空值(短过期)或**布隆过滤器**拦截。\n**击穿**:热点 key 过期瞬间大量并发打到 DB → 互斥锁重建,或逻辑过期 + 异步更新。\n**雪崩**:大批 key 同时失效或缓存整体宕机 → 过期时间加**随机抖动**、多级缓存、缓存集群高可用。\n一致性推荐 **Cache Aside**:先更新 DB 再删除缓存(而非更新缓存),配合延迟双删或 binlog 订阅(如 Canal)做补偿。",[243,244],"为什么是删除缓存而不是更新缓存?","延迟双删的第二次延迟多久合适?",44,"2026-10-16T19:24:10.353699","2026-10-16T19:24:10.355464","2026-10-16T19:24:10.359546",[250,232],"Redis",{"id":252,"slug":253,"companyId":29,"companyName":204,"companySlug":205,"position":51,"round":52,"difficulty":53,"questionType":54,"topicId":53,"topicName":55,"questionKind":56,"points":22,"title":254,"body":255,"answer":256,"followUps":257,"askedYear":63,"starCount":64,"viewCount":260,"status":66,"submitterId":22,"publishedAt":261,"createdAt":262,"updatedAt":263,"tags":264},38,"sliding-window-maximum","滑动窗口最大值(239 题)","给定数组和窗口大小 k,窗口从最左滑到最右,返回每个窗口中的最大值。\n示例:`nums=[1,3,-1,-3,5,3,6,7], k=3` → `[3,3,5,5,6,7]`。","思路:**单调队列(双端队列)**。队列存下标,并保持对应值**单调递减**。\n- 新元素入队前,从队尾弹出所有比它小的元素(它们不可能再成为最大值);队头元素若已滑出窗口则出队。\n- 窗口形成后(下标 ≥ k-1)每次取队头即为当前最大值。\n复杂度:时间 **O(n)**(每个下标最多入队出队各一次),空间 O(k)。\n坑:用大顶堆也能过但复杂度是 O(n log n);队列里存值而非下标就无法判断过期。",[258,259],"怎么同时求窗口最小值?","单调栈解决哪类问题?",43,"2026-10-16T19:24:10.873808","2026-10-16T19:24:10.874009","2026-10-16T19:24:10.874042",[265,266],"单调队列","滑动窗口",530,12,1796090253895,{"code":15,"message":16,"data":271,"timestamp":293},{"total":267,"companyCount":146,"byPosition":272,"byDifficulty":279,"positions":285},{"java":273,"algo":274,"frontend":275,"ai":276,"devops":277,"product":278,"mobile":160,"data":160,"test":193,"driving-c1":29,"objective":29,"math-grade1":29},71,65,64,56,54,53,{"1":280,"2":281,"3":282,"4":283,"5":284},9,79,198,210,34,[128,51,89,286,287,150,288,289,290,291,76,292],"ai","devops","mobile","data","test","driving-c1","math-grade1",1796090253906,{"code":15,"message":16,"data":295,"timestamp":311},[296,299,302,305,308],{"id":46,"slug":47,"companyId":48,"companyName":49,"companySlug":50,"position":51,"round":52,"difficulty":53,"questionType":54,"topicId":53,"topicName":55,"questionKind":56,"points":22,"title":57,"body":58,"answer":59,"followUps":297,"askedYear":63,"starCount":64,"viewCount":65,"status":66,"submitterId":22,"publishedAt":67,"createdAt":68,"updatedAt":69,"tags":298},[61,62],[71,72],{"id":74,"slug":75,"position":76,"round":77,"difficulty":53,"questionType":76,"topicId":22,"topicName":78,"questionKind":79,"points":22,"title":80,"body":81,"answer":82,"followUps":300,"starCount":64,"viewCount":84,"status":66,"publishedAt":85,"createdAt":85,"updatedAt":85,"tags":301},[],[],{"id":26,"slug":88,"position":89,"round":52,"difficulty":53,"questionType":90,"topicId":48,"topicName":91,"questionKind":56,"points":22,"title":92,"body":93,"answer":94,"followUps":303,"askedYear":98,"starCount":64,"viewCount":99,"status":66,"submitterId":22,"publishedAt":100,"createdAt":101,"updatedAt":102,"tags":304},[96,97],[104,105],{"id":107,"slug":108,"companyId":48,"companyName":49,"companySlug":50,"position":89,"round":109,"difficulty":110,"questionType":90,"topicId":48,"topicName":91,"questionKind":56,"points":22,"title":111,"body":112,"answer":113,"followUps":306,"askedYear":63,"starCount":64,"viewCount":117,"status":66,"submitterId":22,"publishedAt":118,"createdAt":119,"updatedAt":120,"tags":307},[115,116],[122,123],{"id":22,"slug":125,"companyId":22,"companyName":126,"companySlug":127,"position":128,"round":52,"difficulty":53,"questionType":90,"topicId":22,"topicName":78,"questionKind":56,"points":22,"title":129,"body":130,"answer":131,"followUps":309,"askedYear":136,"starCount":64,"viewCount":137,"status":66,"submitterId":22,"publishedAt":138,"createdAt":139,"updatedAt":140,"tags":310},[133,134,135],[142,143,144],1796090253915,{"code":15,"message":16,"data":313,"timestamp":375},[314,318,323,328,334,339,346,351,357,363,369],{"id":22,"slug":128,"name":78,"kind":315,"description":316,"icon":128,"sortOrder":146,"questionCount":281,"objectiveCount":29,"children":317},"subject","JVM、并发、Spring、MySQL 等后端高频考点",[],{"id":48,"slug":89,"name":91,"kind":315,"description":319,"icon":320,"sortOrder":321,"questionCount":275,"objectiveCount":64,"children":322},"JS\u002FTS、框架、浏览器与工程化","code",20,[],{"id":53,"slug":51,"name":55,"kind":315,"description":324,"icon":325,"sortOrder":326,"questionCount":274,"objectiveCount":64,"children":327},"数据结构与算法题，含手写代码","binary",30,[],{"id":110,"slug":286,"name":329,"kind":315,"description":330,"icon":331,"sortOrder":332,"questionCount":276,"objectiveCount":64,"children":333},"AI 工程","RAG、微调、Agent、评测与成本优化","spark",40,[],{"id":152,"slug":150,"name":153,"kind":315,"description":335,"icon":336,"sortOrder":337,"questionCount":278,"objectiveCount":64,"children":338},"需求、指标、增长与协作","target",50,[],{"id":340,"slug":290,"name":341,"kind":315,"description":342,"icon":343,"sortOrder":344,"questionCount":193,"objectiveCount":64,"children":345},6,"测试开发","用例设计、自动化与质量体系","check",60,[],{"id":30,"slug":287,"name":347,"kind":315,"description":348,"icon":349,"sortOrder":65,"questionCount":277,"objectiveCount":64,"children":350},"运维\u002FSRE","K8s、可观测性、故障排查","server",[],{"id":29,"slug":289,"name":352,"kind":315,"description":353,"icon":354,"sortOrder":355,"questionCount":160,"objectiveCount":64,"children":356},"数据研发","数仓建模、指标治理、任务调优","db",80,[],{"id":280,"slug":288,"name":358,"kind":315,"description":359,"icon":360,"sortOrder":361,"questionCount":160,"objectiveCount":64,"children":362},"移动端","启动优化、内存、跨端方案","phone",90,[],{"id":146,"slug":291,"name":364,"kind":315,"description":365,"icon":366,"sortOrder":367,"questionCount":29,"objectiveCount":29,"children":368},"驾校科目一","道路交通安全法规与常识题库","car",100,[],{"id":28,"slug":292,"name":370,"kind":315,"description":371,"icon":372,"sortOrder":373,"questionCount":29,"objectiveCount":29,"children":374},"一年级数学","10 以内加减、数的认识与简单应用题","calc",110,[],1796090253929]