首页
学习
活动
专区
圈层
工具
发布
清单首页测试文章详情

从Java全栈开发到微服务架构:一次真实面试的深度复盘

{"type":"doc","content":[{"type":"heading","content":[{"text":"从Java全栈开发到微服务架构:一次真实面试的深度复盘","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":1,"id":"694726e2-d583-4a77-ab3e-61904d4d7636"}},{"type":"heading","content":[{"text":"面试官:李明(某互联网大厂资深技术负责人)","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":2,"id":"ec1da389-d795-4843-ab57-ca79981bd645"}},{"type":"heading","content":[{"text":"应聘者:张伟(28岁,硕士学历,5年Java全栈开发经验)","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":2,"id":"c02b5504-e178-4279-a799-83f0972128e9"}},{"type":"heading","content":[{"text":"第一轮:基础与语言特性","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":3,"id":"55f8fe7b-13e6-4164-be3c-a3e6599ba37f"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":你好,张伟,欢迎来到我们公司的面试。先简单介绍一下你自己吧。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"082b4138-2890-45cf-bdc5-eb8bc568bd44"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":您好,我是张伟,28岁,硕士毕业于某985高校计算机专业,过去5年一直在一家中型互联网公司做Java全栈开发,主要负责后端系统维护和前端页面重构。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"f6d86ad7-344b-46ae-afb1-af15fc50a8a4"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":很好,你提到做过前后端的工作,那你能说说Java SE 8和11之间有哪些主要区别吗?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"fb927836-6664-49ed-aed5-69fc4dec9af5"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":Java 8引入了Lambda表达式、Stream API、默认方法等新特性,提升了代码的简洁性和可读性。而Java 11则在性能优化、模块化(JPMS)和API增强方面做了很多改进,比如HTTP Client API的引入,让网络请求更方便。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"94fc805e-6b46-47f3-af93-f13b98bb85cf"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":不错,看来你对Java版本更新有一定的了解。那你知道JVM的内存结构吗?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"19626fbd-688d-4ce2-b12b-d5081a41cd02"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":JVM的内存结构主要包括方法区、堆、栈、程序计数器、本地方法栈。其中堆是最大的一块,用于存储对象实例;栈用于存储局部变量和方法调用。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"269d1e52-6c39-45e7-9a05-0551495fb659"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":很好,你回答得很准确。我们再来看看一个实际的问题,比如你在项目中是否使用过JVM的垃圾回收机制?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"f2d8f7fc-1115-4ee9-8d8c-88c434ee8c39"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":是的,我们在生产环境中使用过G1收集器,它在处理大堆内存时表现更好,减少了Full GC的频率。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"e6a79e9f-c042-40b7-b6cc-184dd74435c1"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":听起来你对JVM有实际经验,这很好。那我们可以进入下一轮问题。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"9539694c-6303-421a-902f-3dcaa87fa733"}},{"type":"heading","content":[{"text":"第二轮:Spring Boot与Web框架","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":3,"id":"267459d6-f2a6-467a-8605-1f3603b50662"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":你之前提到做过后端系统维护,那能说说你常用的Web框架是什么吗?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"c58c0b67-1d69-4d74-8e55-fd209282ba38"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":我主要使用Spring Boot,因为它简化了配置,提高了开发效率。同时我也接触过Spring MVC和Spring WebFlux。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"e873b38a-c21d-4536-9e73-c5466bd2d815"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":很好,那你能说说Spring Boot的自动配置原理吗?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"145c028b-5477-48a8-a200-a707b0168f59"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":Spring Boot通过","type":"text"},{"text":"@EnableAutoConfiguration","marks":[{"type":"code"}],"type":"text"},{"text":"注解开启自动配置功能,它会根据类路径中的依赖自动配置Bean,比如数据源、嵌入式服务器等。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"d63ee81c-a537-43cd-96d5-1bcf732b2ddc"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":非常准确。那你在项目中有没有使用过Spring WebFlux?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"99dd2284-52ed-4326-b87c-589b3d24dd9c"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":有的,我们有一个实时推送功能的模块,使用了WebFlux来实现响应式编程,提升了系统的并发能力。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"d5c62265-4f5f-43c0-8ccd-5bf2eb07a0f6"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":听起来你对异步编程也有一定理解。那你能举一个具体的例子吗?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"1a5d7007-2582-444e-9b7c-fa82c0e84be7"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":比如我们有一个订单状态通知系统,当订单状态发生变化时,通过WebSocket实时推送到前端,这样用户可以立即看到最新的状态。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"8b34e598-19f4-48ab-baa1-7ef505cdd6a9"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":很好,这个例子很具体。我们继续看下一个问题。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"95f66083-3184-49e8-bb91-46d0f2daddb0"}},{"type":"heading","content":[{"text":"第三轮:前端框架与构建工具","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":3,"id":"a69c5ade-ab88-4831-815d-4916a368fed5"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":你说过你也做过前端页面重构,那你能说说你熟悉的前端框架吗?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"ffa22510-e1bb-4b20-9bf7-19d89ba79b65"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":我主要使用Vue3和Element Plus,也接触过Vant和Ant Design Vue。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"e97b7851-ca7c-4b25-9392-de2682c702a8"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":那你有没有用过Vite或者Webpack?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"0b54a9c1-823c-40c1-9a5f-1370d665390f"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":有,我们项目中使用Vite作为构建工具,因为它的启动速度更快,适合开发环境。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"75ee1cf6-37cd-4d66-b30a-1e3eeba98ae1"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":那你能说说Vite相比Webpack有什么优势吗?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"e76dc91f-1d74-49bf-b2f8-b48c281ae43d"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":Vite利用ES模块原生支持,不需要打包,启动速度快,而且热更新也非常快,这对开发效率提升很大。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"1d159187-c36b-4a71-aea4-498e2c8b89c7"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":非常好,你对前端工具链有深入的理解。那我们来看一个具体的代码示例,你能否写出一个简单的Vue3组件?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"82e19166-b75d-4415-a7eb-20e83e61882e"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":当然可以。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"70564009-555c-41c4-895d-ba0f95824baa"}},{"type":"codeBlock","content":[{"text":"<template>\n <div>\n <h1>{{ message }}</h1>\n <button @click=\"changeMessage\">Change Message</button>\n </div>\n</template>\n\n<script setup>\nimport { ref } from 'vue';\n\nconst message = ref('Hello, Vue 3!');\n\nconst changeMessage = () => {\n message.value = 'Message Changed!';\n};\n</script>\n\n<style scoped>\nbutton {\n background-color: #4CAF50;\n color: white;\n padding: 10px 20px;\n border: none;\n cursor: pointer;\n}\n</style>","type":"text"}],"attrs":{"isHoverDragHandle":false,"runtimes":0,"language":"javascript","theme":"atom-one-dark","id":"74e2f1c7-03aa-487b-82dc-e01c8faa8bba","key":"","languageByAi":"javascript"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":写得非常清晰,代码结构也很规范。你对Vue3的Composition API熟悉吗?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"6e4caa12-99c0-4db9-b2e5-f57d9af62fe3"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":是的,我经常使用","type":"text"},{"text":"setup()","marks":[{"type":"code"}],"type":"text"},{"text":"函数和","type":"text"},{"text":"ref","marks":[{"type":"code"}],"type":"text"},{"text":"、","type":"text"},{"text":"reactive","marks":[{"type":"code"}],"type":"text"},{"text":"等API来管理组件的状态。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"4b1a6fcf-c098-4e1d-8678-27daa7d72c10"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":很好,看来你对前端技术掌握得比较全面。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"d369049b-0599-45f3-a8a5-80b64710404c"}},{"type":"heading","content":[{"text":"第四轮:数据库与ORM","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":3,"id":"d57f7d85-06a0-4d30-bd56-72d410bbad4d"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":你在后端开发中有没有使用过数据库?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"2bcfa720-595a-49e1-b31d-5a0a0570e5b5"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":是的,我们项目中使用的是MySQL,也接触过MyBatis和JPA。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"24653c0d-b6ee-41d7-b2f2-dac1a6f966e5"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":那你能不能说说MyBatis和JPA的区别?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"194bc8b6-ffa7-4dcf-bf88-ad122cf05684"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":MyBatis是一个半自动的ORM框架,需要手动编写SQL语句,适合复杂的查询;而JPA是全自动的,基于注解,更适合简单的CRUD操作。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"5161ee46-0f90-439b-8e44-e595d14dd840"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":非常准确。那你在项目中有没有使用过事务管理?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"6ee2a041-5e73-49ab-aedb-4e44c3a68193"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":有的,我们使用Spring的","type":"text"},{"text":"@Transactional","marks":[{"type":"code"}],"type":"text"},{"text":"注解来管理事务,确保数据一致性。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"52dcf8f4-49df-427a-9be5-1e916b2ddec7"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":那你能说说事务的传播行为吗?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"247b463e-3952-4a72-b09c-ca1332839a3b"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":比如","type":"text"},{"text":"REQUIRED","marks":[{"type":"code"}],"type":"text"},{"text":"表示如果当前存在事务,则加入该事务;如果没有,则新建一个事务。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"c5b5424f-6ce3-400d-8d54-2cab9cbd84bb"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":很好,看来你对事务管理有一定的理解。那我们继续看下一个问题。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"9a347ede-b636-45ca-a1fa-040765aaa317"}},{"type":"heading","content":[{"text":"第五轮:测试与CI/CD","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":3,"id":"3d9c5ac4-88c8-4d08-bd36-e6cae9001598"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":你在项目中有没有进行过单元测试?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"fbcaf8b1-5819-4a19-bb7d-bb0779995872"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":有,我们使用JUnit 5进行单元测试,并结合Mockito进行模拟测试。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"5dbf8c69-4f95-4fa5-9730-8a5cd388fb06"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":那你有没有使用过CI/CD工具?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"f7a423a2-d1a8-49ee-bae2-810a0d5b3153"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":有的,我们使用GitLab CI来进行自动化构建和部署。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"982ad140-1ab8-433b-b265-2aeafa9f0acc"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":那你能写一个简单的CI/CD配置文件吗?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"48bd15eb-5575-4fa8-972e-8fee469af420"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":好的。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"78e68dcc-1c47-418e-8687-f0b54586db28"}},{"type":"codeBlock","content":[{"text":"stages:\n - build\n - test\n - deploy\n\nbuild_job:\n stage: build\n script:\n - mvn clean package\n\ntest_job:\n stage: test\n script:\n - mvn test\n\ndeploy_job:\n stage: deploy\n script:\n - echo \"Deploying to production...\"","type":"text"}],"attrs":{"isHoverDragHandle":false,"runtimes":0,"language":"yaml","theme":"atom-one-dark","id":"3ab53100-c909-4d77-9f5d-a4946f14b769","key":"","languageByAi":"yaml"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":写得非常规范,说明你对CI/CD有实际经验。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"a7385185-82b8-42f0-831f-3a084bd9b2b6"}},{"type":"heading","content":[{"text":"第六轮:微服务与云原生","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":3,"id":"6c2dbb8c-02f3-4437-a75c-74167940f9e6"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":你有没有参与过微服务架构的项目?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"0e4535a8-4543-418e-a2c9-e91285f2c835"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":有,我们公司正在逐步将单体应用拆分成多个微服务。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"2f13ddcd-1e85-4660-b74a-a6d98bb8c6d7"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":那你有没有使用过Spring Cloud?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"92e1537d-d8bb-443b-935d-0378580136f3"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":是的,我们使用了Spring Cloud Netflix Eureka来做服务注册与发现,OpenFeign来做服务调用。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"186ae456-1603-4ebb-b062-081eee81f596"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":那你是如何保证微服务之间的通信稳定的?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"ebb2c5fa-d9cd-4626-a685-cea00a45f87e"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":我们使用了Resilience4j来实现断路器和重试机制,防止服务雪崩。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"fba8a1e3-69e6-4ed5-b564-64ab336c5078"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":很好,看来你对微服务治理有一定的理解。那你能说说你对Kubernetes的理解吗?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"68377fb6-d481-4796-a41a-ad31367c685f"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":Kubernetes是一个容器编排平台,能够自动管理容器的部署、扩展和运维,非常适合微服务架构。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"7c1db143-e2a1-4bb3-a113-93c7a58a5df6"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":非常好,你对云原生技术有不错的认识。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"fb3a3b2e-ab78-452f-b94c-1cafe12ea7f1"}},{"type":"heading","content":[{"text":"第七轮:安全与权限管理","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":3,"id":"fd49990c-e316-4ab1-ae5f-69f8ef89384a"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":你在项目中有没有涉及过安全相关的开发?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"eea1e3e4-39e4-44cc-9dae-3959654cde71"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":有,我们使用Spring Security来实现权限控制。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"96361085-a218-4086-aa8e-04850cda9c49"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":那你能说说OAuth2的流程吗?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"935f491e-bd70-4692-956c-a60062cf8464"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":OAuth2是一种授权协议,通常包括授权码模式、隐式模式等。以授权码模式为例,用户登录后获取授权码,然后通过授权码换取访问令牌。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"a2bcc2ad-9383-4c34-8f9b-fb4643b4ef22"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":非常好,你对OAuth2的理解很到位。那你在项目中有没有使用过JWT?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"aff24f8f-9e42-4d11-a137-6109c4ff9b4f"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":有,我们使用JWT来做无状态认证,减少服务器的会话管理压力。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"b94a468a-d5c1-4a73-9530-d44189b6f726"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":很好,看来你对现代安全机制有深入了解。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"b0cb0376-9ab6-4b4f-b092-8d2a92e25879"}},{"type":"heading","content":[{"text":"第八轮:消息队列与缓存","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":3,"id":"c82fa025-7628-4467-87a0-3680548cd4bb"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":你在项目中有没有使用过消息队列?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"be229035-7786-4e68-b8bc-c5c81f8b0a4e"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":有,我们使用Kafka来处理异步任务,比如订单状态变更的通知。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"3ee43263-3ebb-4df6-a3a0-f87f0ae9a53b"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":那你能说说Kafka的基本概念吗?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"92ca019d-5697-4cf8-b08a-329ce8f8c80c"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":Kafka是一个分布式流处理平台,核心概念包括Topic、Partition、Producer、Consumer、Broker等。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"013cb451-1f2e-47f6-92dd-c38b7415675f"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":很好,那你在项目中有没有使用过Redis?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"2127c50a-337a-4622-8e28-187c08376e2e"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":有,我们用Redis做缓存,提高系统的响应速度。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"d5928d76-aea2-4cae-a363-76cf0bda48eb"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":那你能说说Redis的持久化机制吗?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"aba7572d-b7e4-4b61-ac5b-99bd819acd2a"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":Redis有两种持久化方式,RDB和AOF。RDB是快照形式,适合备份;AOF则是日志形式,适合数据恢复。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"b0121002-b110-46fa-895e-592c2ac60476"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":非常准确,看来你对缓存技术有深入的理解。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"93025a85-4ab5-433a-a872-4a0219064c81"}},{"type":"heading","content":[{"text":"第九轮:日志与监控","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":3,"id":"9527a049-eb76-4d15-87dd-724de9b11829"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":你在项目中有没有使用过日志框架?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"c17e2d9e-f337-41ac-80c9-07bf2daeb9b5"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":有,我们使用Logback和SLF4J。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"bdc079e1-66a4-4efb-8929-0809776b887d"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":那你有没有使用过ELK Stack?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"8811884a-2765-4f41-810c-21a223121a17"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":有,我们使用Elasticsearch存储日志,Logstash做日志采集,Kibana做可视化展示。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"43f97378-6cff-4492-a835-3500070f23ca"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":很好,那你能说说Prometheus和Grafana的关系吗?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"f5213517-f6c4-4d1e-9852-f05c65a10015"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":Prometheus是一个监控系统,用来收集指标数据;Grafana是一个可视化工具,可以展示Prometheus的数据。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"6c46c561-d751-495d-bc67-08d1f0c3a442"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":非常好,你对监控系统有不错的理解。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"64ff5cb6-65f4-4598-9ee4-22874cbdac23"}},{"type":"heading","content":[{"text":"第十轮:综合与收尾","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":3,"id":"c2804d2b-9b71-4f67-8e81-4b157d5ce475"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":最后一个问题,你在工作中有没有遇到过特别困难的技术挑战?","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"0ecc0356-b1ac-4958-9570-e42b4f8b86d2"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":有,有一次我们遇到了高并发下的数据库锁竞争问题,通过引入Redis分布式锁和优化SQL语句解决了这个问题。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"e14a81ba-21cd-4328-bc0f-db1151a6f091"}},{"type":"paragraph","content":[{"text":"面试官","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":很好,看来你具备解决问题的能力。今天的时间差不多了,我们会尽快给你反馈,感谢你的参与。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"b67e2fe5-08a0-4265-b228-e56f1619855e"}},{"type":"paragraph","content":[{"text":"张伟","marks":[{"type":"textStyle","attrs":{"color":"","background":""}},{"type":"bold"}],"type":"text"},{"text":":谢谢您的时间,期待有机会加入贵公司。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"fe4a347f-795f-4405-8c81-575edd3fe259"}},{"type":"heading","content":[{"text":"技术点总结与代码案例","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":2,"id":"76b326b0-d5ee-42fb-adb7-806cf43c978c"}},{"type":"heading","content":[{"text":"1. Spring Boot 自动配置","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":3,"id":"d09fc6fd-f7d3-497a-aa88-dc886dced829"}},{"type":"paragraph","content":[{"text":"Spring Boot 的自动配置是其最核心的功能之一,它通过 ","type":"text"},{"text":"@SpringBootApplication","marks":[{"type":"code"}],"type":"text"},{"text":" 注解组合了 ","type":"text"},{"text":"@Configuration","marks":[{"type":"code"}],"type":"text"},{"text":"、","type":"text"},{"text":"@EnableAutoConfiguration","marks":[{"type":"code"}],"type":"text"},{"text":" 和 ","type":"text"},{"text":"@ComponentScan","marks":[{"type":"code"}],"type":"text"},{"text":",从而实现了“约定优于配置”的理念。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"a26ddf9c-bb46-4e50-85b2-01a33896e78f"}},{"type":"codeBlock","content":[{"text":"@SpringBootApplication\npublic class Application {\n public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }\n}","type":"text"}],"attrs":{"isHoverDragHandle":false,"runtimes":0,"language":"java","theme":"atom-one-dark","id":"f67dbe8b-78e4-4567-99b4-38e40e4d4991","key":"","languageByAi":"java"}},{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"text":"@SpringBootApplication","marks":[{"type":"code"}],"type":"text"},{"text":":启用Spring Boot的自动配置和组件扫描。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"d2b0714e-c0d9-45ad-85b6-4a424742b947"}}],"attrs":{"id":"234c2bab-94fb-4331-80fb-bdbe0f4f1bf5"}},{"type":"listItem","content":[{"type":"paragraph","content":[{"text":"SpringApplication.run(...)","marks":[{"type":"code"}],"type":"text"},{"text":":启动Spring Boot应用。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"421a3c9f-a870-49f1-9bc4-fc9d84dacc20"}}],"attrs":{"id":"39e3edac-5931-4738-a619-66bdaa3315e6"}}],"attrs":{"isHoverDragHandle":false,"id":"0b1c7cd8-1d41-462b-b393-39ea9f0994ae"}},{"type":"heading","content":[{"text":"2. Vue3 组件示例","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":3,"id":"0260b34b-183b-4a6b-bdf5-46161b289dd2"}},{"type":"paragraph","content":[{"text":"Vue3 引入了 Composition API,使得组件逻辑更加灵活和可复用。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"2621b100-a495-4a27-8595-ba4c41936276"}},{"type":"codeBlock","content":[{"text":"<template>\n <div>\n <h1>{{ message }}</h1>\n <button @click=\"changeMessage\">Change Message</button>\n </div>\n</template>\n\n<script setup>\nimport { ref } from 'vue';\n\nconst message = ref('Hello, Vue 3!');\n\nconst changeMessage = () => {\n message.value = 'Message Changed!';\n};\n</script>\n\n<style scoped>\nbutton {\n background-color: #4CAF50;\n color: white;\n padding: 10px 20px;\n border: none;\n cursor: pointer;\n}\n</style>","type":"text"}],"attrs":{"isHoverDragHandle":false,"runtimes":0,"language":"javascript","theme":"atom-one-dark","id":"c6ca1e07-89f9-45ad-8f14-1a562df7655f","key":"","languageByAi":"javascript"}},{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"text":"使用 ","type":"text"},{"text":"ref","marks":[{"type":"code"}],"type":"text"},{"text":" 来声明响应式数据。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"78e2294d-7e8f-4906-b72f-0e48f9f47845"}}],"attrs":{"id":"757526f5-cde4-4a56-8b4e-8b33d9b08c25"}},{"type":"listItem","content":[{"type":"paragraph","content":[{"text":"使用 ","type":"text"},{"text":"setup()","marks":[{"type":"code"}],"type":"text"},{"text":" 函数来组织组件逻辑。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"66f158c3-9ba6-4801-a240-4421fde8ae17"}}],"attrs":{"id":"ae5df664-42c1-476a-bd23-e8ba68c88657"}}],"attrs":{"isHoverDragHandle":false,"id":"53ea2abf-ae23-4c81-aaba-086d2c06e236"}},{"type":"heading","content":[{"text":"3. GitLab CI 示例","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":3,"id":"808c96bd-9ece-4dc6-93ad-1f55f0c2c063"}},{"type":"paragraph","content":[{"text":"GitLab CI 是一种流行的 CI/CD 工具,用于自动化构建、测试和部署流程。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"d70330bb-398d-4796-bb0d-351d9cfa9a64"}},{"type":"codeBlock","content":[{"text":"stages:\n - build\n - test\n - deploy\n\nbuild_job:\n stage: build\n script:\n - mvn clean package\n\ntest_job:\n stage: test\n script:\n - mvn test\n\ndeploy_job:\n stage: deploy\n script:\n - echo \"Deploying to production...\"","type":"text"}],"attrs":{"isHoverDragHandle":false,"runtimes":0,"language":"yaml","theme":"atom-one-dark","id":"c4923aaf-c3a5-4813-a3dc-80be79dbf663","key":"","languageByAi":"yaml"}},{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"text":"stages","marks":[{"type":"code"}],"type":"text"},{"text":" 定义了流水线阶段。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"627f4ed4-86cb-4239-a184-8715eabc60f8"}}],"attrs":{"id":"2db90553-5875-4128-b5fd-c7051b65875c"}},{"type":"listItem","content":[{"type":"paragraph","content":[{"text":"每个 job 定义了执行的脚本命令。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"8d247d20-b197-4fdf-9fb5-42b312fdb1f8"}}],"attrs":{"id":"0ee55c6d-48b7-4ef6-babd-fd08bffc113e"}}],"attrs":{"isHoverDragHandle":false,"id":"dc149f36-a2a5-42cc-acbf-85d5d2eb91ed"}},{"type":"heading","content":[{"text":"4. Redis 分布式锁示例","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":3,"id":"2d2b1c90-b507-415f-87df-747b0f9609d6"}},{"type":"paragraph","content":[{"text":"在高并发场景下,使用 Redis 实现分布式锁可以避免资源竞争。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"c426e340-a6ae-478c-9c99-a20b14c1dfd6"}},{"type":"codeBlock","content":[{"text":"public boolean tryLock(String key, String value, long expireTime) {\n String result = redisTemplate.opsForValue().setIfAbsent(key, value, expireTime, TimeUnit.SECONDS);\n return \"OK\".equals(result);\n}","type":"text"}],"attrs":{"isHoverDragHandle":false,"runtimes":0,"language":"java","theme":"atom-one-dark","id":"256c036f-86f5-471e-9727-6765314de549","key":"","languageByAi":"java"}},{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"text":"setIfAbsent","marks":[{"type":"code"}],"type":"text"},{"text":" 方法用于设置键值对,只有在键不存在时才设置成功。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"714b1e4f-1fb9-4dc5-98b5-79e4e5dfd9f9"}}],"attrs":{"id":"0104ec19-579a-4069-acdc-908543983283"}},{"type":"listItem","content":[{"type":"paragraph","content":[{"text":"设置过期时间,防止死锁。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"ea7716cc-18f1-4218-8d92-c050d4872b43"}}],"attrs":{"id":"43024d5a-b2dc-4f9c-a7c5-b45c72539341"}}],"attrs":{"isHoverDragHandle":false,"id":"1dc7cd95-266f-4314-81b7-cb6acb642161"}},{"type":"heading","content":[{"text":"5. Kafka 生产者示例","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":3,"id":"6fbfd44a-ad72-4f5d-9ae7-ed68d2b8549c"}},{"type":"paragraph","content":[{"text":"Kafka 是一个高性能的消息队列,适用于大数据和实时计算场景。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"c5d29a2e-9ce9-4161-896a-9422cd9f8830"}},{"type":"codeBlock","content":[{"text":"public void sendMessage(String topic, String message) {\n ProducerRecord<String, String> record = new ProducerRecord<>(topic, message);\n producer.send(record);\n}","type":"text"}],"attrs":{"isHoverDragHandle":false,"runtimes":0,"language":"java","theme":"atom-one-dark","id":"771c36cc-e6bc-4d83-baa0-a5e382afc222","key":"","languageByAi":"java"}},{"type":"bulletList","content":[{"type":"listItem","content":[{"type":"paragraph","content":[{"text":"ProducerRecord","marks":[{"type":"code"}],"type":"text"},{"text":" 用于封装消息内容。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"a6bddaed-8a12-4370-8e03-51efbdb6f605"}}],"attrs":{"id":"445ad012-f5a2-4782-9bf6-ce1a74ef9f61"}},{"type":"listItem","content":[{"type":"paragraph","content":[{"text":"send","marks":[{"type":"code"}],"type":"text"},{"text":" 方法发送消息到 Kafka。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"bad34706-dbd4-4f0a-938f-3cf6007d8e43"}}],"attrs":{"id":"08fefca5-c3a8-47ca-bd11-df3ac3609973"}}],"attrs":{"isHoverDragHandle":false,"id":"c9359c84-0170-4816-a37c-def7e00f589b"}},{"type":"heading","content":[{"text":"结束语","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"level":2,"id":"0de1f6f6-1041-4009-8211-3074079e6c8b"}},{"type":"paragraph","content":[{"text":"本次面试展示了张伟作为一名Java全栈开发者的扎实技术功底和丰富的项目经验。他不仅对Java语言、Spring Boot、Vue3、Redis、Kafka等技术有深入理解,还能结合实际业务场景灵活运用。通过这次面试,可以看出他在技术上具有较强的学习能力和解决问题的能力,是一位值得信赖的开发者。","type":"text"}],"attrs":{"isHoverDragHandle":false,"textAlign":"inherit","indent":0,"id":"22610da8-0193-49ab-b846-d9702c17d5d5"}}]}

举报
领券