[{"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\":5}":42,"interview-public-stats":197,"interview-public-hot":222,"interview-topics-filter":299},{"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,"prompt":22,"mcp":23,"model":24},46,148,298,642,1,{"cursor":26,"claude-desktop":26,"Claude Code":27,"pi":28,"Cursor":29,"VS Code":30,"Codex CLI":24,"Ollama":24,"终端":24},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","终端",1796093388028,{"code":15,"message":16,"data":43,"timestamp":196},{"records":44,"total":194,"size":131,"current":173,"pages":195},[45,62,87,98,106,116,130,145,154,162,169,183],{"id":46,"slug":47,"position":48,"round":49,"difficulty":24,"questionType":50,"topicId":28,"topicName":51,"questionKind":52,"points":24,"title":53,"body":54,"answer":55,"followUps":56,"starCount":57,"viewCount":58,"status":59,"publishedAt":60,"createdAt":60,"updatedAt":60,"tags":61},523,"math-grade1-10-y86dxw","math-grade1","笔试","objective","一年级数学","single","10以内加法","计算：3 + 4 =（ ）。","正确答案：B",[],0,27,"published","2026-10-18T12:50:14.980487",[],{"id":63,"slug":64,"companyId":24,"companyName":65,"companySlug":66,"position":67,"round":68,"difficulty":69,"questionType":70,"topicId":71,"topicName":72,"questionKind":73,"points":24,"title":74,"body":75,"answer":76,"followUps":77,"askedYear":80,"starCount":57,"viewCount":58,"status":59,"submitterId":24,"publishedAt":81,"createdAt":82,"updatedAt":83,"tags":84},39,"merge-k-sorted-lists","字节跳动","bytedance","algo","二面",4,"coding",3,"算法","subjective","合并 K 个升序链表(23 题)","给定 k 个升序链表,合并为一个升序链表并返回。\n示例:`[[1,4,5],[1,3,4],[2,6]]` → `[1,1,2,3,4,4,5,6]`。","三种解法要能讲清取舍:\n- **顺序两两合并**:时间 O(k²n),链表多时退化严重。\n- **分治合并**:像归并排序一样两两合并,时间 **O(kn log k)**,空间 O(log k),实现稳、不易出错。\n- **小顶堆**:堆中始终维护 k 个当前头节点,每次弹出最小值接到结果尾部并把其 next 入堆,时间 **O(kn log k)**,空间 O(k),适合 k 大且链表很长。\n坑:注意空链表数组、以及堆中元素比较需要自定义比较器。",[78,79],"如果要求原地合并、不允许新建节点呢?","K 路归并在大数据外部排序中怎么用?",2025,"2026-10-16T19:24:10.88926","2026-10-16T19:24:10.889427","2026-10-16T19:24:10.889456",[85,86],"堆","链表",{"id":88,"slug":89,"position":50,"round":49,"difficulty":24,"questionType":50,"topicId":24,"topicName":90,"questionKind":91,"points":24,"title":92,"body":93,"answer":94,"followUps":95,"starCount":57,"viewCount":96,"status":59,"publishedAt":60,"createdAt":60,"updatedAt":60,"tags":97},509,"java-string-bs4sf4","Java 后端","judge","String 不可变性","Java 中 String 是不可变类，因此调用 concat 方法会在原 String 对象上直接修改其内容。","正确答案：F",[],26,[],{"id":99,"slug":100,"position":50,"round":49,"difficulty":24,"questionType":50,"topicId":24,"topicName":90,"questionKind":91,"points":24,"title":101,"body":102,"answer":103,"followUps":104,"starCount":57,"viewCount":96,"status":59,"publishedAt":60,"createdAt":60,"updatedAt":60,"tags":105},514,"java-synchronized-1c33z1","synchronized 可重入性","Java 中 synchronized 是可重入锁，同一个线程可以多次获取同一把锁而不会立即死锁。","正确答案：T",[],[],{"id":107,"slug":108,"position":48,"round":49,"difficulty":109,"questionType":50,"topicId":28,"topicName":51,"questionKind":110,"points":24,"title":111,"body":112,"answer":113,"followUps":114,"starCount":57,"viewCount":96,"status":59,"publishedAt":60,"createdAt":60,"updatedAt":60,"tags":115},527,"math-grade1-5-q53y8t",2,"multiple","得数是5的算式","下面算式中，得数是5的有哪些？","正确答案：A,B,D",[],[],{"id":117,"slug":118,"position":119,"round":120,"difficulty":71,"questionType":121,"topicId":24,"topicName":90,"questionKind":73,"points":24,"title":122,"body":123,"answer":124,"followUps":125,"sourceUrl":6,"starCount":57,"viewCount":127,"status":59,"publishedAt":128,"createdAt":128,"updatedAt":128,"tags":129},380,"java-z0suqp","java","一面","concept","泛型擦除带来的限制与运行期获取泛型","请说明 Java 泛型擦除的具体表现：为什么不能 new T()、不能 new T[]、不能对泛型类型做 instanceof；静态成员为何不能使用类级类型参数；并给出在运行期获取泛型实参的常见做法及适用前提。","1）擦除：编译后类型参数被替换为边界（无界为 Object），并在需要处插入强制转换；运行期不存在 T 的类型信息，因此 new T()、new T[]、instanceof List\u003CString> 无法编译或不可靠。2）数组因协变与运行期类型检查（ArrayStoreException）与泛型不变性冲突，故禁止泛型数组创建；可用 List\u003CT> 或 (T[]) new Object[n] 强转并接受未检查警告。3）静态成员属于类而非实例，类级类型参数随实例确定，故静态上下文不能引用 T；静态泛型方法需自己声明 \u003CT>。4）运行期获取实参：通过子类\u002F匿名类保留的 ParameterizedType（getGenericSuperclass \u002F getGenericInterfaces）反射读取，如 TypeReference、Gson TypeToken 的做法；前提是泛型信息被固化在 class 的签名中，局部变量和直接 new 的对象拿不到。",[126],"桥接方法是什么，何时生成；为什么说擦除导致重载冲突，举例说明",25,"2026-10-18T11:29:30.89475",[],{"id":131,"slug":132,"position":119,"round":120,"difficulty":71,"questionType":121,"topicId":24,"topicName":90,"questionKind":73,"points":24,"title":133,"body":134,"answer":135,"followUps":136,"askedYear":80,"starCount":57,"viewCount":127,"status":59,"submitterId":24,"publishedAt":139,"createdAt":140,"updatedAt":141,"tags":142},12,"hashmap-resize-concurrency","HashMap 的扩容机制与并发安全问题","HashMap 什么时候扩容?JDK8 的扩容做了什么优化?\n为什么说 HashMap 不是线程安全的?","默认负载因子 **0.75**,元素数超过 `容量 × 0.75` 时扩容为**2 倍**。\n- 长度是 2 的幂,所以索引用 `(n-1) & hash`;扩容时元素要么留在原下标,要么移到 `原下标 + 旧容量`,无需重新计算 hash。\n- JDK8 把头插改为**尾插**,解决了 JDK7 并发扩容形成环形链表导致 CPU 100% 的问题。\n坑:并发 put 仍会丢数据、size 不准,多线程应换 `ConcurrentHashMap`。",[137,138],"为什么负载因子是 0.75?","ConcurrentHashMap 在 JDK8 怎么保证并发安全?","2026-10-16T19:24:10.211642","2026-10-16T19:24:10.211863","2026-10-16T19:24:10.211904",[143,144],"并发","集合",{"id":146,"slug":147,"position":48,"round":49,"difficulty":24,"questionType":50,"topicId":28,"topicName":51,"questionKind":52,"points":24,"title":148,"body":149,"answer":150,"followUps":151,"starCount":57,"viewCount":152,"status":59,"publishedAt":60,"createdAt":60,"updatedAt":60,"tags":153},524,"math-grade1-q-damnjq","数的认识","比6大1的数是（ ）。","正确答案：C",[],23,[],{"id":155,"slug":156,"position":48,"round":49,"difficulty":109,"questionType":50,"topicId":28,"topicName":51,"questionKind":52,"points":24,"title":157,"body":158,"answer":159,"followUps":160,"starCount":57,"viewCount":152,"status":59,"publishedAt":60,"createdAt":60,"updatedAt":60,"tags":161},526,"math-grade1-q-1jnvdh","数的大小比较","下面四个数中，最大的是（ ）。","正确答案：D",[],[],{"id":163,"slug":164,"position":50,"round":49,"difficulty":24,"questionType":50,"topicId":24,"topicName":90,"questionKind":52,"points":24,"title":165,"body":166,"answer":55,"followUps":167,"starCount":57,"viewCount":152,"status":59,"publishedAt":60,"createdAt":60,"updatedAt":60,"tags":168},513,"java-spring-boot-1gmim2","Spring Boot 启动注解","Spring Boot 中用于标记主配置类并启用自动配置的常用注解是？",[],[],{"id":170,"slug":171,"position":172,"round":49,"difficulty":173,"questionType":174,"topicId":30,"topicName":175,"questionKind":73,"points":24,"title":176,"body":177,"answer":178,"followUps":179,"sourceUrl":6,"starCount":57,"viewCount":152,"status":59,"publishedAt":181,"createdAt":181,"updatedAt":181,"tags":182},505,"deployment-502-1elsmg","devops",5,"case","运维\u002FSRE","找出Deployment配置中导致滚动更新502的问题","某 Java 服务启动约需 60 秒，replicas: 3，滚动更新期间用户持续出现 502。现有片段：strategy.maxSurge=0、maxUnavailable=25%；livenessProbe: httpGet \u002Fhealthz port 8080，initialDelaySeconds 5，periodSeconds 10，failureThreshold 3；readinessProbe 与 livenessProbe 使用同一端点同一参数；未设置 preStop 与 terminationGracePeriodSeconds。请指出至少 3 处问题，说明各自后果与修改方案。","1）探针初始延迟过短：initialDelaySeconds 5 秒远小于 60 秒启动时间，liveness 会在启动阶段连续失败并把容器杀掉，引发反复重启。应改用 startupProbe（failureThreshold×periodSeconds 覆盖启动时间），或把 liveness 的 initialDelay 与 failureThreshold 放大。 2）readiness 与 liveness 共用同一端点：两者语义不同——liveness 表示“要不要重启”，readiness 表示“能不能接流量”。共用端点会导致依赖抖动时容器被直接重启而非优雅摘流。应拆分 \u002Fhealthz（进程存活）与 \u002Fready（依赖与预热完成）。 3）maxSurge=0 且 maxUnavailable=25%：滚动更新时先停后起，3 副本会先少一个，容量瞬时下降 33%，叠加启动 60 秒必然出现 502。应设置 maxSurge=1、maxUnavailable=0，保证先就绪再摘旧。 4）缺少优雅下线：未配置 preStop（如 sleep 5~10s）与 terminationGracePeriodSeconds，Pod 被删除时 Endpoints 摘除与进程退出存在时间差，请求打到正在退出的实例上产生 502。应加 preStop sleep、容器内处理 SIGTERM、设置合理的 grace period。 5）还应确认 readiness 未就绪时不接流量，以及 PDB 与 HPA 的配合。",[180],"startupProbe 与 livenessProbe 同时配置时失败判定顺序是怎样的；preStop 的 sleep 时间如何定，设太长会有什么副作用","2026-10-18T11:31:24.282644",[],{"id":184,"slug":185,"position":186,"round":49,"difficulty":109,"questionType":50,"topicId":187,"topicName":188,"questionKind":110,"points":24,"title":189,"body":190,"answer":191,"followUps":192,"starCount":57,"viewCount":152,"status":59,"publishedAt":60,"createdAt":60,"updatedAt":60,"tags":193},519,"driving-c1-q-jcmhru","driving-c1",10,"驾校科目一","交通事故处置","机动车发生交通事故后，车辆驾驶人应当如何处置？","正确答案：A,B,C",[],[],530,45,1796093388101,{"code":15,"message":16,"data":198,"timestamp":221},{"total":194,"companyCount":187,"byPosition":199,"byDifficulty":208,"positions":214},{"java":200,"algo":201,"frontend":202,"ai":203,"devops":204,"product":205,"mobile":206,"data":206,"test":207,"driving-c1":29,"objective":29,"math-grade1":29},71,65,64,56,54,53,48,47,{"1":209,"2":210,"3":211,"4":212,"5":213},9,79,198,210,34,[119,67,215,216,172,217,218,219,220,186,50,48],"frontend","ai","product","mobile","data","test",1796093388119,{"code":15,"message":16,"data":223,"timestamp":298},[224,242,250,267,282],{"id":225,"slug":226,"companyId":109,"companyName":227,"companySlug":228,"position":67,"round":120,"difficulty":71,"questionType":70,"topicId":71,"topicName":72,"questionKind":73,"points":24,"title":229,"body":230,"answer":231,"followUps":232,"askedYear":80,"starCount":57,"viewCount":235,"status":59,"submitterId":24,"publishedAt":236,"createdAt":237,"updatedAt":238,"tags":239},33,"three-sum","腾讯","tencent","三数之和(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坑:先排序是关键,否则无法用双指针;去重逻辑遗漏会导致结果集重复。",[233,234],"四数之和怎么推广?","两数之和为什么用哈希表更优?",70,"2026-10-16T19:24:10.778881","2026-10-16T19:24:10.779024","2026-10-16T19:24:10.77906",[240,241],"双指针","数组",{"id":243,"slug":244,"position":50,"round":49,"difficulty":71,"questionType":50,"topicId":24,"topicName":90,"questionKind":52,"points":24,"title":245,"body":246,"answer":150,"followUps":247,"starCount":57,"viewCount":248,"status":59,"publishedAt":60,"createdAt":60,"updatedAt":60,"tags":249},507,"java-hashmap-1jq9q5","HashMap 树化阈值","在 JDK 8 的 HashMap 中，当链表长度达到多少，并且数组容量不小于 64 时，会将该链表转换为红黑树？",[],69,[],{"id":26,"slug":251,"position":215,"round":120,"difficulty":71,"questionType":121,"topicId":109,"topicName":252,"questionKind":73,"points":24,"title":253,"body":254,"answer":255,"followUps":256,"askedYear":259,"starCount":57,"viewCount":260,"status":59,"submitterId":24,"publishedAt":261,"createdAt":262,"updatedAt":263,"tags":264},"cors-preflight","前端","跨域与 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。",[257,258],"JSONP 的原理和局限?","CORS 预检失败怎么定位?",2024,59,"2026-10-16T19:24:10.688789","2026-10-16T19:24:10.688952","2026-10-16T19:24:10.68899",[265,266],"浏览器","跨域",{"id":96,"slug":268,"companyId":109,"companyName":227,"companySlug":228,"position":215,"round":68,"difficulty":69,"questionType":121,"topicId":109,"topicName":252,"questionKind":73,"points":24,"title":269,"body":270,"answer":271,"followUps":272,"askedYear":80,"starCount":57,"viewCount":275,"status":59,"submitterId":24,"publishedAt":276,"createdAt":277,"updatedAt":278,"tags":279},"react-fiber-reconciliation","React Fiber 与 Diff 算法","Fiber 架构解决了什么问题?它是如何实现可中断渲染的?\nReact 的 diff 算法用了哪些优化策略?","问题:栈调和是**递归同步**的,长任务会阻塞主线程导致掉帧。Fiber 把渲染拆成**可中断的工作单元链表**,由 Scheduler 在空闲时执行,并支持**优先级**(用户输入 > 数据请求)。\n- 渲染分 **render(可中断)** 与 **commit(同步、不可中断)** 两阶段。\n- diff 三条策略:① 只做**同层比较**;② 元素**类型不同直接重建**子树;③ 列表用 **key** 标识复用,key 需稳定唯一。\n坑:用数组下标做 key,在插入\u002F删除时会导致组件状态错乱。",[273,274],"useMemo\u002FuseCallback 真能提升性能吗?","并发模式下的时间切片怎么工作?",51,"2026-10-16T19:24:10.61969","2026-10-16T19:24:10.61987","2026-10-16T19:24:10.61991",[280,281],"Fiber","React",{"id":24,"slug":283,"companyId":24,"companyName":65,"companySlug":66,"position":119,"round":120,"difficulty":71,"questionType":121,"topicId":24,"topicName":90,"questionKind":73,"points":24,"title":284,"body":285,"answer":286,"followUps":287,"askedYear":291,"starCount":57,"viewCount":292,"status":59,"submitterId":24,"publishedAt":293,"createdAt":294,"updatedAt":295,"tags":296},"java-concurrenthashmap-thread-safety","ConcurrentHashMap 如何保证线程安全？","JDK8 之后 ConcurrentHashMap 的并发控制从分段锁改成了什么？请说明 put 的流程，以及为什么不允许 null key \u002F null value。","JDK7 用 Segment 分段锁，锁粒度是段；JDK8 改为 CAS + synchronized 锁单个桶头节点，扩容时多线程协助迁移（sizeCtl \u002F ForwardingNode）。不允许 null：并发下无法区分「key 不存在」与「key 存在但值为 null」，会造成二义性。",[288,289,290],"扩容时其他线程怎么参与迁移？","size() 在并发下怎么统计？","为什么用 synchronized 而不是 ReentrantLock？",2026,49,"2026-10-16T13:03:33.663356","2026-10-16T13:03:33.667514","2026-10-16T13:03:33.668346",[297,143,144],"Java",1796093388151,{"code":15,"message":16,"data":300,"timestamp":360},[301,305,310,315,321,327,334,338,344,350,355],{"id":24,"slug":119,"name":90,"kind":302,"description":303,"icon":119,"sortOrder":187,"questionCount":210,"objectiveCount":29,"children":304},"subject","JVM、并发、Spring、MySQL 等后端高频考点",[],{"id":109,"slug":215,"name":252,"kind":302,"description":306,"icon":307,"sortOrder":308,"questionCount":202,"objectiveCount":57,"children":309},"JS\u002FTS、框架、浏览器与工程化","code",20,[],{"id":71,"slug":67,"name":72,"kind":302,"description":311,"icon":312,"sortOrder":313,"questionCount":201,"objectiveCount":57,"children":314},"数据结构与算法题，含手写代码","binary",30,[],{"id":69,"slug":216,"name":316,"kind":302,"description":317,"icon":318,"sortOrder":319,"questionCount":203,"objectiveCount":57,"children":320},"AI 工程","RAG、微调、Agent、评测与成本优化","spark",40,[],{"id":173,"slug":217,"name":322,"kind":302,"description":323,"icon":324,"sortOrder":325,"questionCount":205,"objectiveCount":57,"children":326},"产品经理","需求、指标、增长与协作","target",50,[],{"id":328,"slug":220,"name":329,"kind":302,"description":330,"icon":331,"sortOrder":332,"questionCount":207,"objectiveCount":57,"children":333},6,"测试开发","用例设计、自动化与质量体系","check",60,[],{"id":30,"slug":172,"name":175,"kind":302,"description":335,"icon":336,"sortOrder":235,"questionCount":204,"objectiveCount":57,"children":337},"K8s、可观测性、故障排查","server",[],{"id":29,"slug":219,"name":339,"kind":302,"description":340,"icon":341,"sortOrder":342,"questionCount":206,"objectiveCount":57,"children":343},"数据研发","数仓建模、指标治理、任务调优","db",80,[],{"id":209,"slug":218,"name":345,"kind":302,"description":346,"icon":347,"sortOrder":348,"questionCount":206,"objectiveCount":57,"children":349},"移动端","启动优化、内存、跨端方案","phone",90,[],{"id":187,"slug":186,"name":188,"kind":302,"description":351,"icon":352,"sortOrder":353,"questionCount":29,"objectiveCount":29,"children":354},"道路交通安全法规与常识题库","car",100,[],{"id":28,"slug":48,"name":51,"kind":302,"description":356,"icon":357,"sortOrder":358,"questionCount":29,"objectiveCount":29,"children":359},"10 以内加减、数的认识与简单应用题","calc",110,[],1796093388194]