标签搜索
后端-04-后端
程序员的自留地

后端-04-后端

fiora
2026-10-21 / 0 评论 / 7 阅读
本段 119 题 | 来源:backend + general + design | 知识点:后端

1. 什么是 Web 服务器(web server)?

  • 知识点: 后端 / 操作系统与网络 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: web-server, http, client-server)
  • 类型: technical | 难度: easy | 子类型:
  • 分类: backend
  • id: 695cc0341da553795622a65b | 官方: 是 | 付费: 否

答案:

TL;DRWeb 服务器(web server)用于存储、处理并将网站内容通过 HTTP(HTTP)等协议返回给浏览器;它既包含硬件也包含软件。
Web 服务器(web server)是一台用于存储、处理并向浏览器交付网站内容的计算机。当用户通过浏览器发起请求时,服务器会通过 HTTP(HTTP)等协议响应并返回内容。
Web 服务器(web server)通常是硬件与软件的组合:硬件负责与请求设备交换数据;软件则控制用户如何访问服务器中存储的文件。

2. 使用 Python(Python)语言有哪些优势?

  • 知识点: 后端 / 编程语言基础 (主题: python;标签: python, advantages, libraries)
  • 类型: technical | 难度: easy | 子类型:
  • 分类: backend
  • id: 695cc0351da553795622a7f8 | 官方: 是 | 付费: 否

答案:

TL;DRPython(Python)语法简单、生态丰富、开源免费、动态类型(dynamic typing)、解释执行,适合快速开发、数据分析(data analysis)与 AI(AI)等场景。
Python(Python)是一种高层编程语言(high-level programming language),语法简单易读,适合新手上手。
Python(Python)的优势包括:

  • 易于实现:相比 Java、C++ 等语言更容易学习和编写
  • 丰富的支持库:例如 Pandas、NumPy 等
  • 免费开源:拥有庞大的活跃社区
  • 动态类型:无需显式声明数据类型
  • 强大库生态:库丰富且高效,提升开发效率
  • 解释型语言:逐行执行,便于调试与跨平台
  • 适合数据分析:便于简化复杂数值计算

3. 单元测试(Unit Test)、集成测试(Integration Test)和端到端测试(End-to-End Test,E2E)有什么区别?

  • 知识点: 后端 / 测试 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: Unit Test, Integration Test, E2E, Testing Pyramid)
  • 类型: technical | 难度: easy | 子类型:
  • 分类: general
  • id: 695cd80b1da5537956265218 | 官方: 是 | 付费: 否

答案:

TL;DRUnit 测试(Unit Testing)单个函数或组件,Integration 测试(Integration Testing)多个模块协作,E2E 测试(End-to-End Testing)整个系统从用户角度走完整流程。
Unit- 范围小:单个函数/组件。

  • 速度快,依赖少。
  • 通常会 mock 外部依赖。
    Integration- 范围中:多个模块组合。
  • 验证模块之间接口是否正确。
  • 可能包含真实 DB/API 或部分 mock。
    E2E- 范围大:用户完整流程(登录、下单等)。
  • 最接近真实环境。
  • 最慢、最贵,但能覆盖真实风险。

4. 如何降低排行榜系统的运维开销(Minimal Operational Overhead)?哪些措施能够实现更少的运维工作?

  • 知识点: 后端 / DevOps/云 / 系统设计/架构 / UI/UX 设计 (主题: system-design, aws;标签: minimal-ops, serverless, managed-services, autoscaling, monitoring)
  • 类型: technical | 难度: easy | 子类型:
  • 分类: backend
  • id: 695dfa151da5537956361df0 | 官方: 是 | 付费: 否

答案:

TL;DR降低运维开销的核心是减少自建与手动运维:使用 Serverless(无服务器架构)、云上托管服务(Managed Service)、自动扩缩容(Auto Scaling)与监控告警(Monitoring and Alerting)。
可行措施- 运行 Serverless Functions(无服务器函数)。

  • 使用云厂商的Fully Managed Services(托管数据库、托管队列、托管缓存)。
  • 基于告警启用 Autoscaling。
  • 配置完整的Monitoring 与告警。

5. 分布式任务调度系统(Distributed Task Scheduling System)的 API(Application Programming Interface,应用程序接口)通常需要哪些接口?分别解决什么需求?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: rest-api, submit-job, get-status, cancel-job, list-jobs, worker-executions)
  • 类型: technical | 难度: easy | 子类型:
  • 分类: backend
  • id: 695dfcb71da553795636539e | 官方: 是 | 付费: 否

答案:

TL;DR常见 API 包括:提交任务(Submit Job)、查询任务状态(Query Job Status)、取消任务(Cancel Job)、按条件列出任务(List Jobs by Criteria)、查询某 worker(工作节点)当前执行的任务。它们覆盖了 job(作业)生命周期管理与可观测性(Observability)需求。
常见 API- Submit Job(提交作业):POST /jobs(提交 one-time/periodic jobs,即一次性/周期性作业)

  • Get Job Status:GET /jobs/{job_id}(查看 queued/running/completed/failed)
  • Cancel Job:DELETE /jobs/{job_id}(取消已提交任务)
  • List Pending Jobs:GET /jobs?status=pending&user_id=u003(按条件筛选任务)
  • Get Jobs Running on a Worker:GET /job/executions?worker_id=w001(查看某 worker 执行中的 jobs)

6. 什么是客户端-服务器(Client-Server)架构?它的核心思想是什么?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: client-server, request-response, centralized-server)
  • 类型: technical | 难度: easy | 子类型:
  • 分类: general
  • id: 695e01071da553795636b4f9 | 官方: 是 | 付费: 否

答案:

TL;DR客户端-服务器架构(Client-Server Architecture)是一种计算模型:多个客户端(用户或设备)通过网络向一个集中式服务器发起请求,服务器负责管理资源、处理请求并返回结果。客户端负责发起请求并处理响应(如渲染界面、展示数据)。
核心思想- 客户端(Client):发起请求并负责展示/交互,例如浏览器、手机 App、桌面应用。

  • 服务器(Server):集中管理资源并处理业务逻辑,响应多个客户端请求。
  • 网络(Network):客户端与服务器之间的数据通信通道。
    典型例子当你用浏览器打开网站时,浏览器发送请求给 Web Server(Web服务器),服务器返回 HTML/CSS/图片等资源,浏览器再渲染页面。

7. 客户端-服务器架构(Client-Server Architecture)是如何工作的?请描述它的请求-响应流程(Request-Response Flow)。

  • 知识点: 后端 / 操作系统与网络 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: request-response, client-request, server-processing)
  • 类型: technical | 难度: easy | 子类型:
  • 分类: general
  • id: 695e01071da553795636b56b | 官方: 是 | 付费: 否

答案:

TL;DR客户端-服务器(Client-Server)模型基于请求-响应(Request-Response)机制:客户端发送请求,服务器处理并返回响应,客户端再处理响应(渲染或展示)。
流程步骤- 客户端发起请求:请求网页、查询数据、下载文件或调用 API(Application Programming Interface)。

  • 服务器处理请求:读取数据库、执行业务逻辑或生成动态内容。
  • 服务器返回响应:把数据/服务结果返回客户端。
  • 客户端处理响应:浏览器渲染页面,App 展示数据等。

例子登录网银时,客户端提交账号密码,服务器验证后查询账户数据,再返回给客户端显示。

8. 什么是微服务架构(Microservices Architecture)?它的核心思想是什么?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: microservices, loosely-coupled, independent-deploy, single-responsibility)
  • 类型: technical | 难度: easy | 子类型:
  • 分类: backend
  • id: 695e02931da553795636f421 | 官方: 是 | 付费: 否

答案:

TL;DR微服务架构(Microservices Architecture)是一种将复杂系统拆分为多个松耦合、可独立开发/部署/维护核心思想- 单一职责原则(Single Responsibility Principle, SRP):把“因同样原因变化”的内容聚合,把“因不同原因变化”的内容拆开。

  • 服务独立性:服务可独立开发、测试、部署,避免整体系统被单点影响。
  • 通过 API 协作:服务之间通过简单协议(HTTP/REST、RPC、消息等)交互。

9. 什么是 Serverless 架构?它的核心理念是什么?

  • 知识点: 后端 / DevOps/云 / 系统设计/架构 / UI/UX 设计 (主题: system-design, cloud;标签: serverless, faas, managed-infrastructure, event-driven)
  • 类型: technical | 难度: easy | 子类型:
  • 分类: backend
  • id: 695e03bc1da553795637026a | 官方: 是 | 付费: 否

答案:

TL;DRServerless(无服务器)架构并不意味着没有服务器,而是指开发者无需管理服务器:云厂商自动负责资源分配、扩缩容与运维。开发者以函数(Functions)或托管服务的形式部署代码,按执行次数与运行时长计费。
核心理念- 云厂商托管基础设施:无需自行运维、打补丁、规划容量。

  • 按使用付费:按调用次数、执行时长、内存等计费,不为闲置资源付费。
  • 事件驱动:函数由事件触发(HTTP 请求、文件上传、DB 变更、定时任务等)。
  • 自动扩缩容:负载上升自动扩容,空闲时不运行函数(成本降低)。

10. 什么是 Peer-to-Peer (P2P) 网络?它与 Client-Server 架构的核心区别是什么?

  • 知识点: 后端 / 操作系统与网络 / 系统设计/架构 / UI/UX 设计 (主题: system-design, networking;标签: p2p, decentralization, client-server, distributed-systems)
  • 类型: technical | 难度: easy | 子类型:
  • 分类: backend
  • id: 695e0de81da553795637df38 | 官方: 是 | 付费: 否

答案:

TL;DRP2P(Peer-to-Peer) 是一种去中心化网络架构:网络中的参与者(peers)直接交换资源与信息,不依赖中心服务器。每个 peer 同时扮演客户端(Client)+ 服务器(Server)的角色。
与 Client-Server 的核心区别- 控制权:Client-Server(客户端-服务器)由中心服务器控制;P2P(点对点)没有单一中心。

  • 资源提供者:Client-Server 的服务/数据来自服务器;P2P 的资源由各个 peer 共同提供。
  • 扩展方式:Client-Server 扩展通常依赖增加服务器;P2P 随着 peer 增加自然扩展。
  • 故障影响:Client-Server 有明显单点风险;P2P 更耐故障(某些 peer 下线不一定影响整体)。

11. 什么是 Couchbase Server?

  • 知识点: 后端 / 数据库 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: Couchbase Server, NoSQL, elastic, distributed, multi-model)
  • 类型: technical | 难度: easy | 子类型:
  • 分类: backend
  • id: 695f6c1ad6221b0fef04c781 | 官方: 是 | 付费: 否

答案:

核心答案Couchbase Server 是一种易用、快速、弹性(elastic)的 NoSQL(Not Only SQL)数据库,具备分布式与多模型能力,可用于构建集群化应用。
它能够支持 key-value(键值)访问与 JSON(JavaScript Object Notation)文档存储,并提供高吞吐和低延迟特性。

12. Lambda 表达式是否可以理解为“无名称的代码块”?

  • 知识点: 后端 / 编程语言基础 (主题: java;标签: Lambda Expression, Anonymous Function)
  • 类型: technical | 难度: easy | 子类型:
  • 分类: backend
  • id: 6960c5a90e32007ea0d2abb5 | 官方: 是 | 付费: 否

答案:

核心答案可以把 Lambda 表达式理解为一种匿名函数(Anonymous Function):它通常没有显式名字,可作为参数传递、赋值给函数式接口(Functional Interface)变量,并在需要时执行。
但要注意:在 Java 中 Lambda(Lambda)不是“任意代码块”,它必须匹配函数式接口(Functional Interface)的签名。

13. 云领域(Cloud Computing)中 API(Application Programming Interface)的好处是什么?

  • 知识点: 后端 / DevOps/云 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: Integration, Automation, Interoperability)
  • 类型: technical | 难度: easy | 子类型:
  • 分类: general
  • id: 6960ca4a0e32007ea0d2f2aa | 官方: 是 | 付费: 否

答案:

核心答案云领域中 API(Application Programming Interface)的好处包括:

  • 不需要从零写完整程序(复用云能力)
  • 便于应用之间通信
  • 容易创建应用并与云服务联动
  • 以安全方式无缝连接两个应用

14. 解释 RESTful API(RESTful API)设计的最佳实践,以及在Afterpay BNPL(Buy Now Pay Later)中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: afterpay, generated)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: backend
  • 公司: Afterpay (Block)
  • id: 69b3791d58d557c902b9757d | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

15. 什么是微服务架构(Microservices Architecture)?与单体架构(Monolithic Architecture)相比有哪些优缺点?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: microservices, system-design;标签: afterpay, generated)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: backend
  • 公司: Afterpay (Block)
  • id: 69b3791d58d557c902b97580 | 官方: 是 | 付费: 是

答案:

思路分析从服务拆分(Service Decomposition)、独立部署(Independent Deployment)、数据隔离(Data Isolation)、通信方式(Communication Mechanism)等维度对比。
参考答案优点:独立部署(Independent Deployment)、技术多样性(Technology Diversity)、弹性伸缩(Elastic Scaling)、团队自治(Team Autonomy)。缺点:分布式复杂性(Distributed Complexity)、服务间通信开销(Inter-Service Communication Overhead)、数据一致性挑战(Data Consistency Challenges)、运维复杂度增加(Operational Complexity Increase)。
评分要点- 理解何时应该使用微服务(Microservices)

  • 服务拆分原则(DDD)
  • 分布式事务处理方案
    常见追问- Afterpay BNPL(Buy Now Pay Later)是如何做微服务拆分(Microservice Decomposition)的?
  • 如何处理微服务间的数据一致性?

16. 解释 RESTful API(RESTful API)设计的最佳实践,以及在ANZ Plus中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: anz, generated)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: general
  • 公司: 澳新银行
  • id: 69b3793558d557c902b98cbe | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

17. Define cache coherence and hypercube connection. For a node hypercube, what will be its diameter?

定义缓存一致性和超立方体连接。对于一个节点超立方体,它的直径是多少?
  • 知识点: 后端 (标签: interviewbit, arcesium, company-specific)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: general
  • 公司: Arcesium
  • id: 69b3793e58d557c902b993f6 | 官方: 否 | 付费: 否

答案:

Cache coherence simply means that different processors might keep their own local caches. As a result, there could be several copies of the same data. Access to the local copies behaves similarly to access from the local copies, with the exception of access time. A hypercube is a single node. An n node hypercube is made up of two n/2 node hypercubes connected by their respective nodes. An n node hypercube has a diameter of log(n). The diameter is nothing but the smallest number of links needed to connect the two farthest nodes.

缓存一致性简单来说就是不同的处理器可能保留各自的本地缓存。因此,同一数据可能存在多个副本。对本地副本的访问行为与从本地副本访问类似,只是访问时间不同。超立方体是单个节点。一个 n 节点超立方体由两个 n/2 节点超立方体通过它们各自的节点连接而成。一个 n 节点超立方体的直径为 log(n)。直径不过是连接两个最远节点所需的最小链路数。

18. 解释 RESTful API(RESTful API)设计的最佳实践,以及在Jira(Jira)中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: atlassian, generated)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: design
  • 公司: Atlassian
  • id: 69b3794b58d557c902b99e78 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

19. 解释 RESTful API(RESTful API)设计的最佳实践,以及在AutoCAD(AutoCAD)中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: autodesk, generated)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: backend
  • 公司: Autodesk
  • id: 69b3795758d557c902b9a828 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

20. 解释 RESTful API(RESTful API)设计的最佳实践,以及在Mining Operations(Mining Operations)中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: bhp, generated)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: general
  • 公司: BHP
  • id: 69b3797558d557c902b9c0e5 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

21. 解释 RESTful API(Representational State Transferful Application Programming Interface) 设计的最佳实践,以及在Bilibili Video中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: bilibili, generated)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: backend
  • 公司: 哔哩哔哩
  • id: 69b3797d58d557c902b9c5d2 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

22. 解释 RESTful API(Representational State Transferful Application Programming Interface) 设计的最佳实践,以及在Canva Editor中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: canva, generated)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: backend
  • 公司: 可画
  • id: 69b379d258d557c902ba02e7 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

23. 解释 RESTful API(Representational State Transferful Application Programming Interface) 设计的最佳实践,以及在CommBank App中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: cba, generated)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: general
  • 公司: Commonwealth Bank of Australia
  • id: 69b379f158d557c902ba17b5 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

24. 解释 RESTful API(RESTful API)设计的最佳实践,以及在Cochlear Implants(人工耳蜗)中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: cochlear, generated)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: general
  • 公司: Cochlear
  • id: 69b37a2558d557c902ba38ad | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

25. 解释 RESTful API(RESTful API)设计的最佳实践,以及在Coles Online(Coles Online)中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: coles, generated)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: general
  • 公司: Coles Group
  • id: 69b37a4458d557c902ba4bd2 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

26. What are the various annotations that Spring Boot Offers?

Spring Boot 提供了哪些各种注解?
  • 知识点: 后端 (标签: interviewbit, dassault-systemes, company-specific)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: general
  • 公司: 达索系统
  • id: 69b37a5b58d557c902ba5bed | 官方: 否 | 付费: 否

答案:

Spring Boot offers several annotations that can be used to quickly set up and configure a Spring application. Some of the most commonly used annotations include:

Spring Boot 提供了多个注解,可用于快速设置和配置 Spring 应用程序。一些最常用的注解包括:
  1. @SpringBootApplication: This annotation is a convenience annotation that is used to enable several features in a Spring Boot application, including auto-configuration, component scanning, and making the class a configuration class for Spring Boot. 2. @Configuration: This annotation is used to indicate that a class is a configuration class for a Spring application. It tells the Spring framework that this class contains beans that need to be managed by the Spring container. 3. @Bean: This annotation is used to indicate that a method will return a bean that should be managed by the Spring container. It can be used in conjunction with @Configuration to create and configure beans for the application. 4. @Component: This annotation is used to indicate that a class is a component that should be managed by the Spring container. It can be used on any class, including @Configuration classes. 5. @Autowired: This annotation is used to indicate that a constructor, field, or setter method should be autowired with a matching bean in the Spring container. 6. @Value: This annotation is used to assign a value from application.properties or other property sources to a field, constructor, or setter method. 7. @Service: This annotation is a specialization of @Component and is used to indicate that a class is a service component, and it should be managed by the Spring container. 8. @Repository: This annotation is a specialization of @Component and is used to indicate that a class is a repository component, and it should be managed by the Spring container. 9. @Controller: This annotation is a specialization of @Component and is used to indicate that a class is a controller component, and it should be managed by the Spring container. 10. @RequestParam: This annotation is used to bind a request parameter to a method parameter in a Spring application. This annotation can be used to define the required parameter, default value, and whether the parameter is mandatory or not. 11. @PathParam: This annotation is used to bind a URL path parameter to a method parameter in a Spring application. This annotation can be used to define the required parameter and whether it is mandatory or not. 12. @SpringBootTest: This annotation is used to perform integration tests on a Spring Boot application. This annotation can be used to test the entire application context, including the controllers, services, and repositories. It can be used to verify the behavior of the application as a whole and to ensure that all components are functioning correctly.

    1. @SpringBootApplication:此注解是一个便捷注解,用于在 Spring Boot 应用程序中启用多项功能,包括自动配置、组件扫描,并将该类设为 Spring Boot 的配置类。 2. @Configuration:此注解用于表示某个类是 Spring 应用程序的配置类。它告诉 Spring 框架,该类包含需要由 Spring 容器管理的 bean。 3. @Bean:此注解用于表示某个方法将返回一个应由 Spring 容器管理的 bean。它可以与 @Configuration 一起使用,为应用程序创建和配置 bean。 4. @Component:此注解用于表示某个类是一个应由 Spring 容器管理的组件。它可用于任何类,包括 @Configuration 类。 5. @Autowired:此注解用于表示构造函数、字段或 setter 方法应使用 Spring 容器中匹配的 bean 进行自动装配。 6. @Value:此注解用于将 application.properties 或其他属性源中的值赋给字段、构造函数或 setter 方法。 7. @Service:此注解是 @Component 的一种特化,用于表示某个类是服务组件,并且应由 Spring 容器管理。 8. @Repository:此注解是 @Component 的一种特化,用于表示某个类是仓库组件,并且应由 Spring 容器管理。 9. @Controller:此注解是 @Component 的一种特化,用于表示某个类是控制器组件,并且应由 Spring 容器管理。 10. @RequestParam:此注解用于将请求参数绑定到 Spring 应用程序中的方法参数。此注解可用于定义必需参数、默认值以及该参数是否为必填。 11. @PathParam:此注解用于将 URL 路径参数绑定到 Spring 应用程序中的方法参数。此注解可用于定义必需参数以及它是否为必填。 12. @SpringBootTest:此注解用于对 Spring Boot 应用程序执行集成测试。此注解可用于测试整个应用程序上下文,包括控制器、服务和仓库。它可用于验证应用程序整体的行为,并确保所有组件都正常工作。

These are just a few examples of the annotations that Spring Boot offers, and it provides many more which can be used for different purposes, like security, transactions, and so on. Using these annotations makes it easier to configure a Spring application, and Spring Boot also provides several sensible defaults that allow you to get started quickly without having to configure everything manually.

这些只是 Spring Boot 提供的注解中的几个例子,它还提供了更多可用于不同目的的注解,例如安全性、事务等。使用这些注解可以更容易地配置 Spring 应用程序,而且 Spring Boot 还提供了若干合理的默认值,使你无需手动配置所有内容就能快速开始。

27. Write a program to create and insert a new node in a binary tree in a level order manner

编写一个程序,以层序方式在二叉树中创建并插入一个新节点
  • 知识点: 后端 / 算法与数据结构 (标签: interviewbit, delhivery, company-specific)
  • 类型: technical | 难度: easy | 子类型: coding
  • 分类: general
  • 公司: Delhivery
  • id: 69b37a6e58d557c902ba692d | 官方: 否 | 付费: 否

答案:

The figure shows how you can insert a node in a level order manner.

该图展示了如何以层序方式插入节点。

Algorithm: - For traversing in a level order manner, a queue is required because a queue follows FIFO i.e. first in first out.

算法:- 为了以层序方式遍历,需要一个队列,因为队列遵循先进先出(FIFO)原则。
  • For inserting a node, first, check whether the root node is not or not. In the base case. If the root is NULL, then create a new node and return it.
  • Now traverse the tree in a level order manner using a queue and find the first empty space for inserting the new node.
  • If the left child of the node is NULL then insert the new node to the left, else check for the right child.
  • If the left or right child is not NULL, then insert their children into the queue and traverse until the queue becomes empty.
    Implementation:

    实现:

include

include

using namespace std;

using namespace std;

struct Node {

struct Node {
int val;
int val;
Node* lval;
Node* lval;
Node* rval;
Node* rval;
};

//Function to create a new node

//函数用于创建一个新节点
Node* newNode(int val)
Node* newNode(int val)
{
Node* n = new Node();
Node* n = new Node();
if (!n) {
if (!n) {
cout << "Memory error\n";
cout << "内存错误\n";
return NULL;
return NULL;
}
n->val = val;
n->val = val;
n->lval = n->rval = NULL;
n->lval = n->rval = NULL;
return n;
返回 n;
}

//Function to insert the given node

//用于插入给定节点的函数
Node Insert(Node root, int val)
Node Insert(Node root, int val)
{

if (root == NULL) {

if (root == NULL) {
root = newNode(val);
root = newNode(val);
return root;
return root;
}

queue<Node*> que;

queue<Node*> que;
que.push(root);
que.push(root);

while (!que.empty()) {

while (!que.empty()) {
Node* x = que.front();
Node* x = que.front();
que.pop();
que.pop();

if (x->lval != NULL)

if (x->lval != NULL)
que.push(x->lval);
que.push(x->lval);
else {
否则 {
x->lval = newNode(val);
x->lval = newNode(val);
return root;
return root;
}

if (x->rval != NULL)

if (x->rval != NULL)
que.push(x->rval);
que.push(x->rval);
else {
否则 {
x->rval = newNode(val);
x->rval = newNode(val);
return root;
return root;
}
}
}
//Inorder traversal of a BT
//二叉树的中序遍历
void inorder(Node* x)
void inorder(Node* x)
{
if (x == NULL)
if (x == NULL)
return;
return;

inorder(x->lval);

inorder(x->lval);
cout << x->val << ' ';
cout << x->val << ' ';
inorder(x->rval);
inorder(x->rval);
}

int main()

int main()
{
Node* root = newNode(5);
Node* root = newNode(5);
root->lval = newNode(1);
root->lval = newNode(1);
root->lval->lval = newNode(7);
root->lval->lval = newNode(7);
root->rval = newNode(9);
root->rval = newNode(9);
root->rval->lval = newNode(16);
root->rval->lval = newNode(16);
root->rval->rval = newNode(10);
root->rval->rval = newNode(10);

cout << " Before insertion: ";

cout << " Before insertion: ";
inorder(root);
inorder(root);
cout << endl;
cout << endl;
int add = 11;
int add = 11;
root = Insert(root, add);
root = Insert(root, add);

cout << "After insertion: ";

cout << "After insertion: ";
inorder(root);
inorder(root);
cout << endl;
cout << endl;

return 0;

return 0;
}
Time and space analysis: - Time Complexity: O(N), where N is the number of nodes in the given binary tree
时间与空间分析:- 时间复杂度:O(N),其中 N 为给定二叉树中的节点数
  • Space Complexity: O(1)

28. 解释 RESTful API(RESTful API)设计的最佳实践,以及在Elasticsearch(Elasticsearch)中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: elastic, generated)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: backend
  • 公司: Elastic
  • id: 69b37ab858d557c902ba95b1 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

29. 解释 RESTful API(RESTful API)设计的最佳实践,以及在GrabRide(GrabRide)中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: grab, generated)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: backend
  • 公司: Grab
  • id: 69b37b2058d557c902bad301 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

30. Find that Is there a loop in a linked list? Given the head of the list and determine if it loops back to itself. A linked list has a loop if there is some node that can be reached again by following the next pointer in consecutive nodes.

判断链表中是否存在环?给定链表的头节点,并判断它是否会回环到自身。如果存在某个节点,通过沿连续节点的 next 指针可以再次到达,则该链表存在环。
  • 知识点: 后端 / 算法与数据结构 (标签: interviewbit, hashedin, company-specific)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: general
  • 公司: HashedIn
  • id: 69b37b2f58d557c902badb92 | 官方: 否 | 付费: 否

答案:

Explanation:

说明:

In the above figure you can see that the last node connected with node 2. Here the Cycle exists. So we need to return true, which means the list contains a loop.

在上图中可以看到,最后一个节点与节点 2 相连。这里存在环。因此我们需要返回 true,这意味着该链表包含环。

Solution:

解决方案:
Although there can be many solutions to this problem, one is to start with every node and check if we are reaching the same node again. But this is not a very optimal solution. Another solution is to start traversing the list and keep track of every node in the HashMap while traversing and check if that node is already present in the HashMap. If the node is already present then that means there is a cycle, so we need to return true. This solution is optimal in terms of time, but it consumes extra space. So for avoiding space complexity, we can use the two-pointer approach of slow and fast pointers and check that if both slow and fast pointers reach the same node, then that means the list contains a cycle. So let’s implement this algorithm.
尽管这个问题有多种解决方案,其中一种是从每个节点开始并检查是否再次到达同一节点。但这不是最优解。另一种解决方案是开始遍历列表并在遍历时在HashMap中记录每个节点,并检查该节点是否已存在于HashMap中。如果节点已存在,则意味着存在循环,因此我们需要返回true。这个解决方案在时间上是最优的,但它消耗额外空间。因此,为了避免空间复杂度,我们可以使用慢指针和快指针的双指针方法,并检查如果慢指针和快指针都到达同一节点,则意味着列表包含循环。那么让我们实现这个算法。

public boolean hasCycle(ListNode head) {

public boolean hasCycle(ListNode head) {
//Edge case
//边界情况
if(head == null || head.next == null)
if(head == null || head.next == null)
return false;
返回 false;

ListNode slow = head, fast = head;

ListNode slow = head, fast = head;

//Fast moves 2 steps and slow moves 1 step. If there is a cycle then both pointers will meet and that means the cycle exists in the list.

//快指针移动2步,慢指针移动1步。如果存在循环,则两个指针将相遇,这意味着列表中存在的循环。
while(fast != null && fast.next != null){
while(fast != null && fast.next != null){
fast = fast.next.next;
fast = fast.next.next;
slow = slow.next;
slow = slow.next;
if(slow == fast)
if(slow == fast)
return true;
返回 true;
}
//No cycle found so return false
//未发现循环,因此返回false
return false;
返回 false;
}
The above algorithm takes O(n) time because all the nodes travel only once. But if there is a cycle then the nodes will be visited only for some constant time. And constant O(1) space because no extra memory is required to detect the loop.
上述算法的时间复杂度为O(n),因为所有节点只遍历一次。但如果存在循环,则节点只会被访问常数次。空间复杂度为常数O(1),因为检测循环不需要额外内存。

31. Suppose you are given a binary tree and a target sum. Is there a root-to-leaf path where the sum of the values along the path is equal to the target sum? If so, return true; otherwise, return false. A leaf is a node that has no children.

假设给定一棵二叉树和一个目标和。是否存在一条从根到叶子的路径,使得路径上所有值的和等于目标和?如果存在,返回 true;否则,返回 false。叶子节点是指没有子节点的节点。
  • 知识点: 后端 / 算法与数据结构 (标签: interviewbit, hashedin, company-specific)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: general
  • 公司: HashedIn
  • id: 69b37b2f58d557c902badb95 | 官方: 否 | 付费: 否

答案:

For example - Consider the below tree and target = 26. And we can see the path exists in the tree from 9 -> 7 -> 6 -> 4. This path to 26. So we need to return true.

例如——考虑下面的树,目标 = 26。我们可以看到树中存在从 9 -> 7 -> 6 -> 4 的路径。这条路径之和为 26。所以我们需要返回 true。

Solution - For the solution, we can traverse the one sub-tree using DFS. And once we found that we reached the leaf node and found the sum equal to the target node then we can return true. Otherwise, we need to traverse the other sub-tree for finding the target and leaf node.

解决方案——对于该解决方案,我们可以使用 DFS 遍历其中一棵子树。一旦我们发现到达了叶子节点,并且发现和等于目标节点,那么我们可以返回 true。否则,我们需要遍历另一棵子树来寻找目标和叶子节点。

//The method returns the boolean result if there is a path.

//该方法返回是否存在路径的布尔结果。
public boolean solution(TreeNode root, int targetSum){
public boolean solution(TreeNode root, int targetSum){
//Base case when we reach to the leaf node and reached the target sum
//基本情况:当我们到达叶子节点且达到了目标和
if(root.left == null && root.right == null){
if(root.left == null && root.right == null){
if(targetSum-root.val == 0)
if(targetSum-root.val == 0)
return true;
返回 true;
return false;
返回 false;
}
boolean left = false;
boolean left = false;
//Search on the left sub-tree for the path.
//在左子树中搜索路径。
if(root.left != null){
if(root.left != null){
left = solution(root.left, targetSum-root.val);
left = solution(root.left, targetSum-root.val);
}
//Searching on the right sub-tree if there is no path in left sub-tree
//如果在左子树中没有找到路径,则在右子树中搜索
if(!left){
if(!left){
if(root.right != null)
if(root.right != null)
return solution(root.right, targetSum-root.val);
return solution(root.right, targetSum-root.val);
}
return left;
return left;
}
In the above approach, every node in the worst case will be traversed. So the time complexity will be O(n) . And we are using recursion, so the space complexity will be also O(n) in the worst case.
在上述方法中,最坏情况下每个节点都会被遍历。因此时间复杂度为O(n)。而且我们使用了递归,所以最坏情况下空间复杂度也是O(n)。

There are also many coding questions that are asked in HashedIn Interview. But the patterns that are followed are basically covered in the above questions.

HashedIn面试中还会问许多编码问题。但所遵循的模式基本上都包含在上述问题中。

HashedIn follows the same round for the senior roles. And also the levels of questions are almost similar. The rounds that differentiate the Interview rounds for the senior job profile are the proficiency and experience in development. General Questions related to the java expertise and some popular frameworks are asked. Like Java 8 concepts, Spring boot, Hibernate, Kafka, HLD design of the current project, LLD of e-commerce website, etc.

HashedIn对高级职位采用相同的面试轮次。问题的难度也几乎相似。区分高级职位面试轮次的是开发方面的熟练度和经验。会问到与Java专业知识及一些流行框架相关的一般性问题。例如Java 8概念、Spring Boot、Hibernate、Kafka、当前项目的HLD设计、电商网站的LLD等。

32. What Is Spring Boot Architecture?

什么是Spring Boot架构?
  • 知识点: 后端 / 系统设计/架构 (标签: interviewbit, hashedin, company-specific)
  • 类型: technical | 难度: easy | 子类型: system-design
  • 分类: general
  • 公司: HashedIn
  • id: 69b37b2f58d557c902badb98 | 官方: 否 | 付费: 否

答案:

If you already know about Spring architecture, then you’ll be happy to know that Spring Boot architecture is built on top of the original architecture. It’s designed to address common problems related to scalability and speed. A Spring Boot application is a collection of several Java classes that work together to perform a specific task. Ideally, there should be three types of classes in your application - services, controllers, and repositories. Services are responsible for storing data, retrieving data from APIs, or sending data to APIs. Controllers receive data from services and save them as models so they can be returned to the user. Repositories are responsible for storing and retrieving data from a database. Although the application architecture might vary from project to project, there are a few things that should always remain the same. These include things like where you save your files, what programming language you use, and how the files are organized.

如果你已经了解Spring架构,那么你会高兴地知道Spring Boot架构是建立在原始架构之上的。它旨在解决与可扩展性和速度相关的常见问题。Spring Boot应用程序是由多个协同工作的Java类组成的集合,用于执行特定任务。理想情况下,你的应用程序中应有三类类——服务类、控制器类和仓库类。服务类负责存储数据、从API检索数据或向API发送数据。控制器类从服务类接收数据并将其保存为模型,以便返回给用户。仓库类负责从数据库存储和检索数据。虽然应用程序架构可能因项目而异,但有一些事情应始终保持不变。这些包括文件保存位置、使用的编程语言以及文件的组织方式。

33. There is a loop in a linked list if there is some node where the next pointer can be followed to reach the same node again. The index pos is used to denote the node that the tail's next pointer is connected to. Note that pos is not passed as a parameter.

如果链表中存在某个节点,通过跟随next指针可以再次到达同一节点,则链表中存在循环。索引pos用于表示尾节点的next指针所连接的节点。请注意,pos不是作为参数传递的。
  • 知识点: 后端 / 算法与数据结构 (标签: interviewbit, nagarro, company-specific)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: general
  • 公司: Nagarro
  • id: 69b37bf958d557c902bb6149 | 官方: 否 | 付费: 否

答案:

Given the linked list, return true if there is a cycle in the linked list. Otherwise, return false.

给定链表,如果链表中存在环,则返回true;否则返回false。

We can use a fast and slow pointer approach and will start traversing the linked list. The slow pointer will move 1 step forward and the fast pointer will move 2 steps forward. If there is a cycle in a linked list, then there will be a time when both the pointers will reach the same position. Then we will return true. Otherwise, if the pointer reaches the null then that means there was no loop in the linked list and then we will return false.

我们可以使用快慢指针方法并开始遍历链表。慢指针每次向前移动1步,快指针每次向前移动2步。如果链表中存在环,那么在某个时刻两个指针将到达相同位置。然后我们将返回true。否则,如果指针到达null,则意味着链表中没有环,然后我们将返回false。

//Method that detects the loop in the linked list.

//检测链表中循环的方法。
public boolean hasCycle(ListNode head) {
public boolean hasCycle(ListNode head) {
if(head == null || head.next == null)
if(head == null || head.next == null)
return false;
返回 false;

//Managing slow and fast pointers.

//管理慢指针和快指针。
ListNode slow = head, fast = head;
ListNode slow = head, fast = head;
/*
moving the pointers slow by 1 position
将慢指针移动 1 个位置
and fast pointer by 2. If they meet that
将快指针移动 2 个位置。如果它们相遇,那
means there is a cycle. So return true.
就意味着存在环。因此返回 true。
*/
while(fast != null && fast.next != null){
while(fast != null && fast.next != null){
fast = fast.next.next;
fast = fast.next.next;
slow = slow.next;
slow = slow.next;
if(slow == fast)
if(slow == fast)
return true;
返回 true;
}
//Otherwise return false if the linked list reaches the end
//否则,如果链表到达末尾,则返回 false
return false; }
return false; }
  • Data Science
  • All Events
  • My Events

34. How can you delete a value from a linked list if you have a pointer to it? It's important to note that no other node, not even the head, is provided with a pointer.

如果你有一个指向链表中某个节点的指针,你如何删除该节点的值?值得注意的是,没有提供指向其他节点(甚至头节点)的指针。
  • 知识点: 后端 / 算法与数据结构 (标签: interviewbit, nutanix, company-specific)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: general
  • 公司: Nutanix
  • id: 69b37c0258d557c902bb67b7 | 官方: 否 | 付费: 否

答案:

The approach is to copy the data from the next node to the node that will be erased, then delete the node that will be deleted.

方法是把下一个节点的数据复制到将要被删除的节点,然后删除那个将要被删除的节点。

void delNode(ListNode* ptr)

void delNode(ListNode* ptr)
{
// If the node to be deleted is the
// 如果要删除的节点是
// last node of linked list
// 链表的最后一个节点
if (!ptr->next)
if (!ptr->next)
{
free(ptr);
free(ptr);
// this will simply make the node_ptr NULL.
// 这只会让 node_ptr 变为 NULL。
return;
return;
}

// if node to be deleted is the first or

// 如果要删除的节点是第一个或
// any node in between the linked list.
// 链表中间的任意节点。
ListNode* temp = ptr->next;
ListNode* temp = ptr->next;
ptr->val = temp->val;
ptr->val = temp->val;
ptr->next = temp->next;
ptr->next = temp->next;
free(temp);
free(temp);
}
It's vital to keep in mind that this method will only operate if the given reference does not point to the last node. Because you don't have the following node to copy the info from if it's the last node. We can make the final node a dummy node to make this solution work. However, the programs/functions that use this function should be changed as well.
务必记住,此方法仅在给定引用不指向最后一个节点时有效。因为如果它是最后一个节点,就没有后续节点可供复制信息。我们可以将最后一个节点设为哑节点,使此解决方案奏效。但是,使用此函数的程序/函数也应随之修改。

35. How does spring IoC work?

Spring IoC 是如何工作的?
  • 知识点: 后端 (标签: interviewbit, paypay, company-specific)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: general
  • 公司: PayPay
  • id: 69b37c1158d557c902bb7043 | 官方: 否 | 付费: 否

答案:

Spring sets itself apart from other frameworks with features including Spring IOC (Inversion of Control), Spring AOP (Aspect-Oriented Programming), and transaction management. Among the most important components of the Spring Framework is the IOC Container. Objects are created, their dependencies are gathered and configured, and their lifecycle is managed using it. In order to manage the components of the application, the Container utilizes DI (Dependency Injection). Object-related information is obtained from either Java code or configuration files (XML), Java POJO classes, and Java annotations. These objects are known as beans. Because Java objects and their lifecycle are not controlled by developers, the term Inversion Of Control (IoC) has been coined. In the following diagram, you can see how the Container manages beans utilizing Java POJO classes and Configuration metadata.

Spring 凭借 Spring IOC(控制反转)、Spring AOP(面向切面编程)和事务管理等特性,从其他框架中脱颖而出。IOC 容器是 Spring 框架最重要的组件之一。对象的创建、依赖的收集与配置以及生命周期的管理都通过它来完成。为了管理应用程序的组件,容器利用了 DI(依赖注入)。与对象相关的信息可从 Java 代码或配置文件(XML)、Java POJO 类以及 Java 注解中获取。这些对象被称为 bean。由于 Java 对象及其生命周期不再由开发者控制,因此创造了“控制反转”(IoC)这一术语。在下图中,你可以看到容器如何利用 Java POJO 类和配置元数据来管理 bean。

PayPay Interview Preparation

36. You are given two non-empty linked lists that each represent a non-negative integer. The digits are kept in reverse order, with each node containing only one digit. Add the two numbers together and return the total as a linked list.

给定两个非空链表,每个链表表示一个非负整数。数字以相反顺序存储,每个节点仅包含一位数字。将两个数相加,并以链表形式返回总和。
  • 知识点: 后端 (标签: interviewbit, qualcomm, company-specific)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: general
  • 公司: 高通
  • id: 69b37c2d58d557c902bb815b | 官方: 否 | 付费: 否

答案:

Except for the number 0 itself, you may presume that the two numbers do not have any leading zeros.

除了数字 0 本身之外,你可以假定这两个数字不含任何前导零。

Example 1:

示例1:
  • Input: l1 = [2,4,3], l2 = [5,6,4]
  • Output: [7,0,8]
  • Explanation: 342 + 465 = 807.

Example 2:

示例2:
  • Input: l1 = [0], l2 = [0]
  • Output: [0]

Example 3:

示例3:
  • Input: l1 = [9,9,9,9,9,9,9], l2 = [9,9,9,9]
  • Output: [8,9,9,9,0,0,0,1]

The total may be used to maintain track of the carry bit; if the sum is greater than 10, sum / 10 will return 1 as two digits, and the carry bit cannot have a sum greater than 19. To construct the list, we utilise a double pointer to store the address of ListNode next in the ListNode structure for the list's tail. We must first dereference the tail because we are using a double pointer. So, tail will point to the memory address where the next node will be added, (tail) will be the address of the tail node (after memory has been allocated), and &(*tail)->next will be the address of the next ListNode in the tail node.

总和可用于跟踪进位位;如果和大于 10,则 sum / 10 将返回 1(作为两位数),且进位位的和不可能大于 19。为构建链表,我们使用双指针在 ListNode 结构中存储链表尾部的 ListNode next 的地址。由于我们使用的是双指针,必须先解引用 tail。因此,tail 将指向即将添加下一个节点的内存地址,(tail) 将是尾节点的地址(在分配内存之后),而 &(tail)->next 将是尾节点中下一个 ListNode 的地址。
class Solution {
class Solution {

public:

public:
ListNode addTwoNumbers(ListNode l1, ListNode* l2) {
ListNode addTwoNumbers(ListNode l1, ListNode* l2) {
int sum = 0;
int sum = 0;
ListNode dummy, **tail = &dummy.next;
ListNode dummy, **tail = &dummy.next;
while (l1 || l2 || sum) {
while (l1 || l2 || sum) {
if (l1) {
if (l1) {
sum += l1->val;
sum += l1->val;
l1 = l1->next;
l1 = l1->next;
}
if (l2) {
if (l2) {
sum += l2->val;
sum += l2->val;
l2 = l2->next;
l2 = l2->next;
}
(*tail) = new ListNode(sum % 10);
(*tail) = new ListNode(sum % 10);
tail = &(*tail)->next;
tail = &(*tail)->next;
sum /= 10;
sum /= 10;

}
return dummy.next;

return dummy.next;
}
};

37. How will you delete a node in a doubly-linked list (DLL)?

你将如何删除双向链表(DLL)中的一个节点?
  • 知识点: 后端 / 算法与数据结构 (标签: interviewbit, siemens, company-specific)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: general
  • 公司: Siemens
  • id: 69b37c5158d557c902bc75be | 官方: 否 | 付费: 否

答案:

The following is the process to delete a node in a doubly-linked list (DLL): - Step 1: Create a function that takes as arguments a linked list and a node that needs to be deleted, and deletes the node.

以下是删除双向链表(DLL)中一个节点的过程:- 步骤1:创建一个函数,其参数为一个链表和一个需要删除的节点,并删除该节点。
  • Step 2: To delete a head node:
    Move the head pointer to the next node in the current node (head here). Set the previous pointer of the next node to the previous pointer of the current node. - Step 3: If you wish to remove the centre node, follow these steps.

    将头指针移动到当前节点(这里的head)的下一个节点。将下一个节点的前驱指针设置为当前节点的前驱指针。- 步骤3:如果你希望删除中间节点,请遵循以下步骤。
    Set the previous pointer of the next node to the previous pointer of the current node. Move the previous node's next pointer to the current node's next pointer. Remove the node. (the most recent node) You do not need to delete previous or next if they are NULL. (for removing the final node) - Step 4: Call the function on the given linked list and specify the node you want to delete.
    将下一个节点的前驱指针设置为当前节点的前驱指针。将前一个节点的后继指针移动到当前节点的后继指针。删除该节点。(最近的节点)如果前驱或后继为NULL,则不需要删除它们。(用于删除最后一个节点)- 步骤4:在给定的链表上调用该函数,并指定你要删除的节点。
    Code to delete a node in a doubly-linked list:
    删除双向链表中一个节点的代码:

import gc

import gc

Node of the doubly linked list

class Node:

class Node:

def __init__(self, data):

def __init__(self, data):
self.data = data
self.data = data
self.next = None
self.next = None
self.prev = None
self.prev = None

class DoublyLinkedList:

class DoublyLinkedList:

def __init__(self):

def __init__(self):
self.head = None
self.head = None

A function to delete a node in a Doubly Linked List.

def deleteNode(self, todelete):

def deleteNode(self, todelete):

if self.head is None or todelete is None:

if self.head is None or todelete is None:
return
return

If node to be deleted is the head node

if self.head == todelete:

if self.head == todelete:
self.head = todelete.next
self.head = todelete.next

Change next only if node to be deleted is NOT

the last node

if todelete.next is not None:

if todelete.next is not None:
todelete.next.prev = todelete.prev
todelete.next.prev = todelete.prev

Change prev only if node to be deleted is NOT

the first node

if todelete.prev is not None:

if todelete.prev is not None:
todelete.prev.next = todelete.next
todelete.prev.next = todelete.next

gc.collect()

gc.collect()

Given a reference to the head of a list and an

integer, inserts a new node on the front of list

def push(self, new_data):

def push(self, new_data):

Allocates node and inserts the data in it

new_node = Node(new_data)

new_node = Node(new_data)

Make next of new node as head and previous as None

new_node.next = self.head

new_node.next = self.head

Change prev of head node to new_node

if self.head is not None:

如果 self.head 不是 None:
self.head.prev = new_node
self.head.prev = new_node

Move the head to point to the new node

self.head = new_node

self.head = new_node

def printList(self, node):

def printList(self, node):
while(node is not None):
while(node is not None):
print(node.data,end=' ')
print(node.data,end=' ')
node = node.next
node = node.next

Start with an empty list

dll = DoublyLinkedList()

dll = DoublyLinkedList()

dll.push(2);

dll.push(2);
dll.push(4);
dll.push(4);
dll.push(8);
dll.push(8);
dll.push(10);
dll.push(10);

print ("\n The original linked list",end=' ')

print ("\n 原始链表",end=' ')
dll.printList(dll.head)
dll.printList(dll.head)

delete nodes from doubly linked list

dll.deleteNode(dll.head)

dll.deleteNode(dll.head)
dll.deleteNode(dll.head.next)
dll.deleteNode(dll.head.next)
dll.deleteNode(dll.head.next)
dll.deleteNode(dll.head.next)

Updated linked list will be NULL<-8->NULL

print("\n The updated linked list",end=' ')

print("\n 更新后的链表",end=' ')
dll.printList(dll.head)
dll.printList(dll.head)
Useful Resources:
有用资源:
  • Networking Interview
  • Data Structure Interview
  • Algorithm Interview
  • Compilers
  • Interview Resources

38. Can you explain the concept of microservices and how it differs from a monolithic architecture?

你能解释一下微服务的概念以及它与单体架构有何不同吗?
  • 知识点: 后端 / 系统设计/架构 (标签: interviewbit, tcs-digital, company-specific)
  • 类型: technical | 难度: easy | 子类型: system-design
  • 分类: general
  • 公司: Tata Consultancy Services
  • id: 69b37c6d58d557c902bc8637 | 官方: 否 | 付费: 否

答案:

Microservices is an architectural style that involves building a software system as a collection of small, independent services that communicate with each other over a network. Each service is responsible for a specific function or capability, and it is designed to be scalable, maintainable, and resilient.

微服务是一种架构风格,它将软件系统构建为一组小型、独立的服务集合,这些服务通过网络相互通信。每个服务负责特定的功能或能力,并且被设计为可扩展、可维护且具有弹性。

In the above image, we can see that there are multiple systems connected with the interface, this individual system can perform some individual and independent tasks. The Interface is responsible to handle that type of task/request and route it to the specific system for the response.

在上图中,我们可以看到有多个系统与接口相连,这些独立的系统可以执行一些单独且独立的任务。接口负责处理那类任务/请求,并将其路由到特定的系统以获取响应。

A microservices architecture has several advantages, such as: - Decoupling: The separation of services allows for greater decoupling of the system, which makes it easier to modify, test, and deploy individual services without affecting the rest of the system.

微服务架构有几个优点,例如:- 解耦:服务的分离使得系统能够更大程度地解耦,从而更容易修改、测试和部署单个服务,而不影响系统的其余部分。
  • Scalability: The independent nature of the services allows for greater scalability, as each service can be scaled up or down independently.
  • Resilience: The independent nature of the services allows for greater resilience, as the failure of one service does not affect the rest of the system.
  • Flexibility: The use of small, independent services allows for greater flexibility, as the system can be modified and enhanced by adding or modifying individual services.
    A monolithic architecture, on the other hand, involves building the software system as a single, large, cohesive unit. A monolithic architecture has several disadvantages, such as: - Coupling: The lack of separation between the components of the system leads to greater coupling, which makes it harder to modify, test, and deploy individual components without affecting the rest of the system.

    另一方面,单体架构将软件系统构建为一个单一的、大型的、内聚的单元。单体架构有几个缺点,例如:- 耦合:系统组件之间缺乏分离会导致更大的耦合,这使得在不影响系统其余部分的情况下修改、测试和部署单个组件变得更加困难。
  • Scalability: The single, large nature of the system limits scalability, as the entire system needs to be scaled up or down as a whole.
  • Resilience: The single, large nature of the system limits resilience, as the failure of one component can affect the entire system.
  • Flexibility: The single, large nature of the system limits flexibility, as it is harder to add or modify individual components without affecting the rest of the system.
    In the above image, we can see that the entire application is clubbed into a single differed by the User Interface, Business logic, and Data Access Layer.

    在上图中,我们可以看到整个应用程序被合并为一个整体,由用户界面、业务逻辑和数据访问层组成。

39. What is a continuous integration and delivery pipeline and how do you implement it?

什么是持续集成和交付流水线,你如何实现它?
  • 知识点: 后端 (标签: interviewbit, tcs-digital, company-specific)
  • 类型: technical | 难度: easy | 子类型: coding
  • 分类: general
  • 公司: Tata Consultancy Services
  • id: 69b37c6d58d557c902bc864b | 官方: 否 | 付费: 否

答案:

Continuous integration and continuous delivery (CI/CD) is a software development practice that involves integrating code changes frequently, building and testing the code automatically, and deploying the code to production as soon as it is ready. The goal of CI/CD is to reduce the time and effort required to develop and deploy software, and to improve the quality and reliability of the software.

持续集成和持续交付(CI/CD)是一种软件开发实践,涉及频繁集成代码变更、自动构建和测试代码,并在代码准备就绪后立即部署到生产环境。CI/CD 的目标是减少开发和部署软件所需的时间和精力,并提高软件的质量和可靠性。

In the above image, we can see how continuous delivery and continuous integration communicate for better delivery of software. It typically consists of the following steps:

在上图中,我们可以看到持续交付和持续集成如何通信以实现更好的软件交付。它通常包括以下步骤:
  1. Plan: This stage involves defining the requirements and goals for the software project. 2. Code: The code stage involves writing the software code to meet the requirements and goals defined in the planning stage. 3. Build: The build step involves compiling the code and creating an executable version of the software, which can be done automatically using a build tool like Make or Gradle. 4. Continuous Testing: This stage involves running a set of automated tests to ensure that the code is correct and meets the specified requirements. This can include unit tests, integration tests, and functional tests. 5. Release: The release stage involves finalizing the code for a specific release, which can include bug fixes, new features, and other changes. 6. Deploy: The deploy step involves deploying the code to a production environment, such as a staging or production server, which can be done automatically using a deployment tool like Ansible or Jenkins. 7. Operate: The operating stage involves managing the software and infrastructure in a production environment, which can include monitoring performance, managing resources, and addressing any issues that arise. 8. Monitor: The monitor stage involves monitoring the software and infrastructure to identify issues or opportunities for improvement, which can inform future updates or releases.

    1. 计划:此阶段涉及定义软件项目的需求和目标。 2. 编码:编码阶段涉及编写软件代码以满足计划阶段定义的需求和目标。 3. 构建:构建步骤涉及编译代码并创建软件的可执行版本,可以使用 Make 或 Gradle 等构建工具自动完成。 4. 持续测试:此阶段涉及运行一组自动化测试,以确保代码正确并满足指定的需求。这可以包括单元测试、集成测试和功能测试。 5. 发布:发布阶段涉及为特定版本最终确定代码,其中可以包括错误修复、新功能和其他更改。 6. 部署:部署步骤涉及将代码部署到生产环境,例如暂存或生产服务器,可以使用 Ansible 或 Jenkins 等部署工具自动完成。 7. 运营:运营阶段涉及在生产环境中管理软件和基础设施,其中可以包括监控性能、管理资源和解决出现的任何问题。 8. 监控:监控阶段涉及监控软件和基础设施,以识别问题或改进机会,这可以为未来的更新或发布提供信息。

To implement a CI/CD pipeline, you need to choose the tools and processes that are appropriate for your project and set up the pipeline accordingly. This typically involves configuring the code repository, setting up the build and test tools, and configuring the deployment process. Some of the tools available in the market are:

要实现 CI/CD 流水线,您需要选择适合您项目的工具和流程,并相应地设置流水线。这通常涉及配置代码仓库、设置构建和测试工具,以及配置部署流程。市场上可用的一些工具包括:
  1. Jenkins: Jenkins is a popular open-source automation server that is widely used for continuous integration and continuous delivery. It allows for the automation of building, testing, and deploying software applications, and provides a wide range of plugins and integrations for different development environments and tools. 2. GitLab: GitLab is a web-based Git repository manager that provides integrated support for continuous integration and delivery. It offers features such as code review, issue tracking, and wiki documentation, as well as built-in continuous integration and delivery pipelines that can be configured to automatically test and deploy code changes. 3. Travis CI: Travis CI is a cloud-based continuous integration service that is widely used by open-source software projects. It provides a range of features for building and testing software applications, including support for multiple programming languages and frameworks, and integration with popular code hosting platforms such as GitHub and Bitbucket.

    1. Jenkins:Jenkins 是一个流行的开源自动化服务器,广泛用于持续集成和持续交付。它允许自动化构建、测试和部署软件应用程序,并为不同的开发环境和工具提供广泛的插件和集成。 2. GitLab:GitLab 是一个基于 Web 的 Git 仓库管理器,提供对持续集成和交付的集成支持。它提供代码审查、问题跟踪和 wiki 文档等功能,以及内置的持续集成和交付流水线,可以配置为自动测试和部署代码变更。 3. Travis CI:Travis CI 是一个基于云的持续集成服务,被开源软件项目广泛使用。它提供一系列用于构建和测试软件应用程序的功能,包括对多种编程语言和框架的支持,以及与 GitHub 和 Bitbucket 等流行代码托管平台的集成。

40. Given a binary tree's root, determine whether it is a BST. Then, determine whether it is a valid BST. A BST is a tree in which both subtrees are binary search trees and in which the subtrees of each node are also BSTs.

给定二叉树的根节点,判断它是否为 BST。然后,判断它是否为有效的 BST。BST 是一种树,其中两个子树都是二叉搜索树,并且每个节点的子树也都是 BST。
  • 知识点: 后端 / 算法与数据结构 (标签: interviewbit, virtusa, company-specific)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: general
  • 公司: Virtusa
  • id: 69b37c8a58d557c902bc9414 | 官方: 否 | 付费: 否

答案:

We can easily solve this problem with the help of recursion. Just we need to see that every subtree must be a binary search tree. So here is the approach for the solution using the recursion.

我们可以借助递归轻松解决这个问题。只需注意每个子树都必须是二叉搜索树。因此,这里是使用递归的解决方案方法。

class Solution {

class Solution {
//private method that validates the tree by the values of root and sub roots
//私有方法,通过根节点和子根节点的值来验证树
private boolean solution(TreeNode root, long left, long right){
private boolean solution(TreeNode root, long left, long right){
//Base case to determine if we reach the leaf of the
//基本情况,用于判断是否到达树的叶子节点
//tree and found no error. Then the part is the valid BST
//并且未发现错误。那么该部分就是有效的 BST
if(root == null)
if(root == null)
return true;
返回 true;

//Comparing the value of the subtrees that all values to

//比较子树的值,即所有值到
//its sub tree must fulfill the condition of validity.
//其子树都必须满足有效性条件。
if(!(root.val < right && root.val > left))
if(!(root.val < right && root.val > left))
return false;
返回 false;

//Recursively validating it's right subtree and left subtree.

//递归地验证其右子树和左子树。
return ((solution(root.left, left, root.val)) &&
return ((solution(root.left, left, root.val)) &&
(solution(root.right, root.val, right)));
(solution(root.right, root.val, right)));

}
//Method that validates and returns true if it's valid.

//验证并返回 true(如果有效)的方法。
public boolean isValidBST(TreeNode root) {
public boolean isValidBST(TreeNode root) {
//Calling private helper method to validate.
//调用私有辅助方法进行验证。
return solution(root, Long.MIN_VALUE, Long.MAX_VALUE);
return solution(root, Long.MIN_VALUE, Long.MAX_VALUE);
}
}

Successful Tech Career for FREE!

免费开启成功的科技职业生涯!

Successful Tech Career!

成功的技术职业生涯!

Interview Process

面试流程

CTC & Designation

CTC与职位级别

Projects on the Job

工作项目

Referral System

推荐系统

Try It Out

试试看

2 Lakh+ Roadmaps Created

已生成20万+职业规划

41. What is REST API?

什么是 REST API?
  • 知识点: 后端 (标签: interviewbit, virtusa, company-specific)
  • 类型: technical | 难度: easy | 子类型: concept
  • 分类: general
  • 公司: Virtusa
  • id: 69b37c8a58d557c902bc9445 | 官方: 否 | 付费: 否

答案:

REST API (Representational State Transfer) is an architectural style used to describe the transfer of information between web services. REST describes three types of interactions: request and response, PUT and GET, and resource and representation. These interactions can be performed over standard HTTP requests, but REST also provides a contract that describes the types of data that can be transferred, how it can be formatted, and what methods can be used to manipulate it.

REST API(表述性状态转移)是一种架构风格,用于描述 Web 服务之间的信息传输。REST 描述了三种类型的交互:请求与响应、PUT 与 GET,以及资源与表示。这些交互可以通过标准 HTTP 请求执行,但 REST 还提供了一种契约,描述了可以传输的数据类型、数据的格式以及可用于操作数据的方法。

The concept behind REST API is to minimize the amount of data sent over the network. It does this by defining how data will be transferred (either PUT or POST) and what method will be used to do so (GET or DELETE).

REST API 背后的理念是尽量减少通过网络发送的数据量。它通过定义数据将如何传输(PUT 或 POST)以及将使用什么方法来进行传输(GET 或 DELETE)来实现这一点。

Another key aspect of REST API is that both client-sender and server-receiver must adhere to a set of rules that define how data will be transferred (e.g. which format/data format). The combination of these two elements allows for increased security in remote communication and ensures that no information can be passed between devices unless explicitly allowed by both parties.

REST API 的另一个关键方面是,客户端发送方和服务器接收方都必须遵守一套规则,这些规则定义了数据将如何传输(例如使用哪种格式/数据格式)。这两个要素的结合可以增强远程通信的安全性,并确保除非双方明确允许,否则任何信息都不能在设备之间传递。

REST API has become a popular architectural pattern among modern web applications because it reduces complexity while ensuring interoperability between web services. Although the concept of REST API might seem simple at first glance, there are several subtleties involved in building an application with this architectural style in mind. In particular, REST API requires both clients.

REST API 已成为现代 Web 应用中流行的架构模式,因为它在确保 Web 服务之间互操作性的同时降低了复杂性。尽管 REST API 的概念乍看之下似乎很简单,但在构建采用这种架构风格的应用时,仍涉及若干细微之处。特别是,REST API 要求客户端双方。

42. Do you have continuous integration?

你们有持续集成吗?
  • 知识点: 后端
  • 类型: technical | 难度: medium | 子类型:
  • 分类: general
  • id: 695a0586084cf0f0766d3eb8 | 官方: 是 | 付费: 否

答案:

The best software development teams I know use tools like Jenkins, Travis, and Buildbot. If the team has no continuous integration, I try to gauge whether they are familiar with the concept. If they aren’t, this is a bad sign in my experience. Having a continuous integration system means that the team probably believes in automation, which is usually a very good sign in my experience.

我所认识的最好的软件开发团队会使用 Jenkins、Travis 和 Buildbot 这样的工具。如果团队没有持续集成,我会试着判断他们是否熟悉这个概念。如果他们不熟悉,根据我的经验,这是一个不好的迹象。拥有持续集成系统意味着团队很可能信奉自动化,而根据我的经验,这通常是一个非常积极的信号。
For some teams, this naturally leads to a discussion about continuous delivery, which is a related but different concept from continuous integration. If it’s a web developer position, I expect the team to at least have heard about CD, and strong teams tend to put it in place, at least in part.
对某些团队来说,这自然会引出关于持续交付的讨论,持续交付是一个与持续集成相关但不同的概念。如果是 Web 开发人员职位,我期望团队至少听说过 CD,而强大的团队往往会至少部分地将其落实到位。
Follow-up questions:
后续问题:
  • When CI reports a failure, how long does your team take to get it fixed?
  • What do you like/dislike about your CI system?
  • How long do your CI runs take? Are you making them faster?

43. How would you explain the API to a child?

你会如何向一个孩子解释 API?
  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 / 行为与软技能 (主题: system-design;标签: api, concept, communication, abstraction)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: backend
  • id: 695b63eb2873cad90baba6c7 | 官方: 是 | 付费: 否

答案:

TL;DRAn API is like a waiter: one program asks for something, the API carries the request to another program, and brings back the response.

TL;DR API 就像一个服务员:一个程序提出请求,API 把请求带给另一个程序,然后把响应带回来。
Child-friendly analogy- You (customer) tell the waiter what you want
面向儿童的类比——你(顾客)告诉服务员你想要什么
  • The waiter takes the order to the kitchen
  • The waiter returns with your food (response)
    ExampleWhen you tap a tablet to move a character, your device uses an API to request the game program to move the character.

    示例:当你点击平板电脑来移动一个角色时,你的设备使用一个 API 请求游戏程序移动该角色。

44. 为什么 RESTful API 在 Web 开发中如此流行?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 / 编程语言基础 (主题: system-design;标签: rest, stateless, scalability, cache, api-design)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: backend
  • id: 695cc0351da553795622a754 | 官方: 是 | 付费: 否

答案:

TL;DRRESTful API 由于无状态(Stateless)、可扩展(Scalable)、高性能(High Performance)、可缓存(Cacheable)等特性,使 Web 服务更易维护与扩展,因此很受欢迎。
RESTful API 在 Web 开发中流行的原因在于其多项有益特性与设计原则,这些原则提升了 Web 服务的效率与可维护性,例如:无状态(Stateless)、可扩展且高性能(Scalable and High Performance)、可缓存(Cacheable)等。
RESTful API 的核心之一是无状态(Stateless):客户端到服务端的每个请求都必须包含服务端处理该请求所需的全部信息。这让服务端不需要维护客户端状态,从而简化架构并提升可扩展性(Scalability)。
无状态(Stateless)特性也让负载均衡(Load Balancing)、水平扩容(Horizontal Scaling)更容易,并提升整体性能,因为服务端可以更轻松地分发工作负载,而无需协调客户端状态。

45. PHP 中的 extract 函数是什么?

  • 知识点: 后端 / 算法与数据结构 / 系统设计/架构 / UI/UX 设计 / 编程语言基础 (主题: system-design;标签: php, extract, variables, arrays)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: backend
  • id: 695cc0361da553795622a8a3 | 官方: 是 | 付费: 否

答案:

TL;DRextract 是 PHP 内置函数(Built-in Function),用于把数组键值导入为本地变量,但可能引发命名冲突(Naming Conflict),需要谨慎使用。
extract 是 PHP 的内置函数(Built-in Function),用于将数组中的值导入到局部符号表(Symbol Table)中并生成变量。符号表(Symbol Table)是一种包含所有可用变量及其值的数据结构(Data Structure)。
它可以让你用变量直接访问数组值,而不是通过数组语法访问。不过要谨慎使用,因为不当使用可能导致变量命名冲突(Variable Naming Conflict)。

46. 什么是应用服务器(Application Server)?它是如何工作的?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: application-server, middleware, runtime, enterprise-app, web-server)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: backend
  • id: 695ccbc31da5537956248f27 | 官方: 是 | 付费: 否

答案:

TL;DR应用服务器(Application Server)提供运行时环境(Runtime Environment)与中间件(Middleware),承载应用的业务逻辑(Business Logic),并在 UI、业务逻辑与数据存储之间协调通信。请求通常先到 Web Server(Web 服务器),再转发到应用服务器(Application Server),由其访问数据库并返回结果。
应用服务器(Application Server)是一种专门的软件,用于为企业级应用提供运行时环境(Runtime Environment)和中间件(Middleware)。它负责处理应用的用户界面层(UI Layer)、应用逻辑层(Application Logic Layer)与数据存储层(Data Storage Layer)之间的通信,并提供应用背后的业务逻辑(Business Logic)。
当客户端(Client)首次发起请求时,请求先到 Web 服务器(Web Server),Web 服务器再将请求发送到应用服务器(Application Server)。应用服务器从数据库服务器(Database Server)请求信息,并把结果返回给 Web 服务器,最后 Web 服务器将信息发送给客户端。

47. Web 服务器和应用服务器的主要区别是什么?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: web-server, application-server, static-content, dynamic-content)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: backend
  • id: 695ccbc41da5537956248fa8 | 官方: 是 | 付费: 否

答案:

TL;DRWeb 服务器主要处理 HTTP(HTTP)并提供静态资源(Static Resource);应用服务器负责动态内容(Dynamic Content)与业务逻辑(Business Logic),通常在 Web 服务器之后处理请求并支持多线程(Multithreading)等能力。

  • Web 服务器用于处理 HTTP 请求并提供静态内容(HTML、图片等);应用服务器用于处理动态内容,承载业务逻辑与应用功能。
  • Web 服务器通常部署在应用服务器前面处理 Web 请求与静态内容;应用服务器负责动态请求与业务逻辑。
  • Web 服务器为网站/应用提供运行环境;应用服务器为企业级应用提供运行环境。
  • Web 服务器不支持多线程;应用服务器支持。

48. 什么是排行榜(Leaderboard)?请解释其概念、类型,以及一个可扩展排行榜系统(Scalable Leaderboard System)的基本设计思路。

  • 知识点: 后端 / 数据库 / 系统设计/架构 / UI/UX 设计 / 编程语言基础 (主题: system-design;标签: leaderboard, redis, sorted set, ranking system, scalability, low latency, high availability, api design)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: backend
  • id: 695cd4eb1da5537956260b4c | 官方: 是 | 付费: 否

答案:

TL;DR排行榜(Leaderboard)是一种用于展示玩家/用户排名的系统,常见于在线游戏、健身、教育等场景。通常按分数或指标排序,包含两种常见类型:绝对排行榜(Absolute Leaderboard)与相对排行榜(Relative Leaderboard)。在系统设计中,常用 Redis 有序集合(Redis Sorted Set)来实现实时排名查询,并将分数与记录持久化到关系型数据库(Relational Database)以支持复杂查询与历史数据。

  1. 什么是排行榜(Leaderboard)?
    排行榜是一种用于展示竞争性事件中参与者排名的仪表盘(Dashboard)。参与者根据完成任务获得分数,分数最高者位于榜首。在互联网场景下,热门游戏的排行榜可能会被数百万玩家同时查看与更新。

排行榜的价值

  • 增强游戏/产品的社交属性(促进竞争与分享)
  • 提升用户活跃度(增加游戏活动频率或用户参与度)

典型例子
例如 Apex Legends 的排行榜(Apex Legends Tracker)展示全局玩家排名。

  1. 排行榜的类型
  • 绝对排行榜(Absolute leaderboard):按全局指标对所有玩家进行排序,通常展示 top 10 / top 100。
  • 相对排行榜(Relative leaderboard):展示某个玩家附近的排名区间(例如前后各 5 名)。
  1. 关键术语(Terminology)
  • Node:为其他服务提供能力的服务器节点
  • Hash function:把任意大小的数据映射为固定大小值的数学函数
  • Data partitioning:将数据拆分到多个节点以提升性能与可扩展性
  • Data replication:跨节点复制数据副本以提升可用性与持久性
  • Hotspot:某节点因承担过多数据或请求导致性能下降
  • CDN:将内容分发到更靠近用户的边缘节点以提升访问速度
  • API:系统组件之间交互的接口
  • Encryption:通过密钥对数据进行安全编码,保护机密性
  1. 排行榜如何工作?(核心数据结构与存储)
    为了满足实时排名、高并发读取与写入的访问模式,常用 Redis 有序集合(Redis Sorted Set)作为主要数据结构(Data Structure)。

为什么用 Redis 有序集合(Redis Sorted Set)?

  • Sorted Set 是内存数据结构,适合实时生成排行榜
  • 可以在 对数时间复杂度 内获取某玩家排名
  • 天然支持按 score 排序的集合结构(本质上就是“按分数排序的集合”)

为什么仍需要关系型数据库(Relational Database)?

  • Redis 负责实时排名与快速查询
  • 关系型数据库用于持久化分数与排行榜记录,支持复杂查询、历史数据分析与审计
  1. 面试澄清问题(Questions to Ask the Interviewer)
    候选人应问的问题(Questions Candidates Should Ask)
  • 系统的主要 use case 是什么?
  • 用户是否全球分布?
  • 写请求的 DAU(Daily Active Users)是多少?
  • 读写比例(read:write ratio)是多少?
  • 是否必须实时(real-time)?

示例面试官回答(Sample Interviewer Responses)

  • 更新分数并展示排行榜
  • 是(全球分布)
  • 写 DAU:5000 万
  • 读写比:5:1
  • 需要实时
  1. 需求(Requirements)
    Functional Requirements

    功能需求
  • 客户端可实时查看 top 10(绝对排行榜)
  • 可查看指定玩家的 rank 与 score
  • 可查看指定玩家附近的排名区间(相对排行榜)
  • 支持 push 通知推送分数更新
  • 支持 global / regional / friends 圈层排行榜
  • 支持历史分数与历史榜单
  • 支持日榜/周榜/月榜
  • 支持全球多地域分布式更新
  • 支持数千并发玩家

Non-Functional Requirements

非功能需求
  • 高可用(High availability)
  • 低延迟(Low latency)
  • 可扩展性(Scalability)
  • 可靠性(Reliability)
  • 最小运维成本(Minimal operational overhead)
  1. API 设计(Leaderboard API)
    系统可以通过 REST(Representational State Transfer) 或 RPC(Remote Procedure Call) 暴露 API。最佳实践是:对外 public API(公共 API) 使用 REST(松耦合、易调试),系统成熟后内部服务之间可切换 RPC(高性能但耦合更强、调试更难)。

HTTP Request Headers(HTTP 请求头示例)

  • authorization:用于鉴权用户
  • content-encoding:压缩类型
  • method:HTTP Verb
  • content-type:数据格式(JSON/XML)
  • user-agent:识别客户端用于分析

HTTP Response Headers(HTTP 响应头示例)

  • status code:请求是否成功
  • cache-control:缓存策略
  • content-encoding:压缩类型
  • content-type:数据格式
  1. API 示例:更新分数(POST)
    客户端通过 HTTP POST(HTTP POST 方法) 更新玩家分数(POST 非幂等(non-idempotent))。

/players/:player-id/scores

/players/:player-id/scores
method: POST
method: POST
authorization: Bearer
authorization: Bearer
content-length: 100
content-length: 100
content-type: application/JSON
content-type: application/JSON
content-encoding: gzip
内容编码:gzip
{
"player_id": ,
"player_id": ,
"score": ,
"score": ,
"location": "Geohash"
"location": "Geohash"
}
可能返回:
  • 200 OK:成功
  • 202 Accepted:异步处理
  • 400 Bad Request:请求体非法
  • 403 Forbidden:权限不足
  1. API 示例:查询玩家 rank 与 score(GET)
    /players/:player-id

    /players/:player-id
    method: GET
    方法:GET
    authorization: Bearer
    authorization: Bearer
    user-agent: Chrome
    user-agent: Chrome
    accept: application/json, text/html
    accept: application/json, text/html
    {
    "player_id": "45231",
    "player_id": "45231",
    "player_name": "Rick",
    "player_name": "里克",
    "score": 1562,
    "score": 1562,
    "rank": 1,
    "rank": 1,
    "updated_at": "2030-10-10T12:11:42Z"
    "updated_at": "2030-10-10T12:11:42Z"
    }
  2. API 示例:查询 top 10(GET)
    /leaderboard/top/:count

    /leaderboard/top/:count
    method: GET
    方法:GET
    authorization: Bearer
    authorization: Bearer
    user-agent: Chrome
    user-agent: Chrome
    accept: application/json, text/html
    accept: application/json, text/html
    {
    "total": 10,
    "total": 10,
    "updated_at": "2030-10-10T12:11:42Z",
    "updated_at": "2030-10-10T12:11:42Z",
    "data": [
    "data": [
    {
    "player_id": "45231",
    "player_id": "45231",
    "player_name": "Rick",
    "player_name": "里克",
    "score": 1562,
    "score": 1562,
    "rank": 1
    "rank": 1
    }
    ]
    }
  3. API 示例:服务健康检查(HEAD)
    /:service/health

    /:service/health
    method: HEAD
    方法:HEAD
  • 200 OK:服务正常
  • 500 Internal Error:服务异常
  1. 数据存储与 schema 设计(Data Storage and Schema Design)
    读写比为 5:1,因此系统相对 write-heavy(写密集型),核心写路径(write path) 是客户端更新分数。

关系型数据库(Relational Database Management System, RDBMS)实体

  • Players
  • Games
  • Leaderboards
  • Friends(关联实体,用于 follower-followee 关系)

关系说明:

  • Games 与 Players:1-to-many
  • Games 与 Leaderboards:1-to-many(支持 global/regional/friends)
  • Players 与 Leaderboards:1-to-many

Redis Schema(核心)

  • Sorted Set:存储 Leaderboards(key = leaderboard_id,成员 = player_id,score = 分数)
  • Hash:存储 Players 元数据(key = player_id)

49. 为什么在排行榜系统中可以用 Serverless Functions 替换 Web Services?它的优势与局限分别是什么?

  • 知识点: 后端 / DevOps/云 / 系统设计/架构 / UI/UX 设计 (主题: system-design, aws;标签: serverless, autoscaling, operational-overhead, cost)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: backend
  • id: 695df7bb1da553795635d802 | 官方: 是 | 付费: 否

答案:

TL;DRServerless Functions 可用于降低运维成本并获得自动扩缩容能力,适合事件驱动的写后落库、缓存同步、CDN 失效等任务。但它可能存在冷启动、执行限制,以及在高频调用下成本更高的问题。
优势(Benefits)- 无需管理服务器:按需执行,避免部署/运维负担。

  • 自动扩缩容:适合应对突发流量。
  • 按执行计费:仅为执行时间付费,降低空闲资源浪费。
    局限(Limitations)- 可能较慢:冷启动导致延迟。
  • 限制较多:执行时间、内存、网络等有上限。
  • 相对昂贵:高 QPS 长时间运行时,单位成本可能高于 VM/容器。
    适用场景示例- 实现 write-behind(异步落库)
  • 事件驱动同步 Redis / CDN 缓存
  • 推送通知触发(score updates)

50. 在分布式计数器里,Push Model 与 Pull Model(消息队列缓冲)有什么区别?各自的优缺点是什么?

  • 知识点: 后端 / 算法与数据结构 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: message-queue, push-model, pull-model, buffering, dlq, fault-tolerance, exactly-once)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: backend
  • id: 695e00311da5537956369eec | 官方: 是 | 付费: 否

答案:

TL;DRPush Model 是每次计数变更都直接写数据库,实时但在超高写入下可能压垮 DB;Pull Model 通过消息队列缓冲变更,异步批量写 DB,提高吞吐与跨机房带宽效率,但会导致计数非实时/不准确,并且难以做到exactly-once。
Push Model(直接写 DB)- 机制:每次 increment/decrement 都更新数据库。

  • 优点:实现简单,实时性能好。
  • 缺点:极端高写入时 DB 压力大,性能可能退化。
    Pull Model(MQ 缓冲 + 异步写 DB)- 机制:客户端事件进入消息队列,serverless/worker 周期性拉取并批量更新数据库。
  • 高可用:MQ 需复制与 checkpoint;引入 Dead Letter Queue,DB 不可用时消息进 DLQ。
  • 优点:提升吞吐;跨数据中心聚合减少带宽;队列解耦 server 与 DB,降低 DB 负载。
  • 缺点:异步导致计数不准确;运维复杂;很难做到 exactly-once,重复消费会导致计数错误。
    结论虽然 Pull Model 在吞吐上更强,但对于要求“准确计数”的分布式计数器,重复投递与异步延迟会导致不准确,因此文章结论是:不要用 MQ 作为核心实现。

51. 什么是两层(Two-Tier)客户端-服务器架构?它有哪些优点和局限?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: two-tier, client-direct-server, bottleneck)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: backend
  • id: 695e01071da553795636b56e | 官方: 是 | 付费: 否

答案:

TL;DR两层架构中客户端直接与服务器交互,服务器通常同时负责业务逻辑和数据管理。它结构简单,但当客户端数量增多时容易出现性能瓶颈。
结构- Client:负责 UI 展示与交互。

  • Server:承担应用逻辑 + 数据库访问(甚至数据库本身)。
    优点- 实现简单,开发成本(Development Cost)低。
  • 部署层级少,延迟低。
    局限- 扩展性(Scalability)差:服务器(Server)负载容易被大量客户端(Client)压垮。
  • 性能瓶颈:业务逻辑与数据访问耦合在同一层。
  • 安全性较弱:客户端直连数据层的场景更难控制。
    例子桌面应用(Desktop Application)直接连接数据库服务器(Database Server)并读取数据展示,就是典型 Two-Tier(两层架构)。

52. 什么是三层(Three-Tier)客户端-服务器架构(Client-Server Architecture)?相比两层架构为什么更可扩展(Scalable)?

  • 知识点: 后端 / 数据库 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: three-tier, separation-of-concerns, application-server, database-server)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: backend
  • id: 695e01071da553795636b571 | 官方: 是 | 付费: 否

答案:

TL;DR三层架构在客户端(Client)与数据层(Data Layer)之间增加了应用/业务逻辑层(Application Server,应用服务器),将 UI(用户界面)、业务逻辑(Business Logic)与数据访问(Data Access)解耦(Decoupling),提升了可扩展性、可维护性(Maintainability)与安全性(Security)。
三层结构- Client(Presentation,表现层):前端 UI(用户界面)展示与交互。

  • Application Server(Business Logic):处理业务逻辑、鉴权、校验等。
  • Database Server(Data Layer):存储与管理数据。
    为什么更可扩展- 解耦(Decoupling):业务逻辑(Business Logic)不再与数据库(Database)直接耦合。
  • 独立扩容:应用层可水平扩展(加实例)来应对更多请求。
  • 安全性更高:客户端不直接访问数据库。
  • 可维护性更强:每层职责清晰,修改影响更小。
    例子Web 应用(Web Application):浏览器(Browser)请求 Web Server(Web 服务器,应用层),应用层再查询数据库(Database)并返回结果。

53. CouchDB 和 Couchbase Server 有什么区别?

  • 知识点: 后端 / 数据库 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: CouchDB, Couchbase Server, JSON document, key-value, memcached protocol, REST API)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: backend
  • id: 695f6c1ad6221b0fef04c795 | 官方: 是 | 付费: 否

答案:

核心答案CouchDB 与 Couchbase Server 都支持 JSON 文档(JSON Document),但定位与能力侧重点不同。
区别说明- CouchDB:擅长存储 JSON 文档(JSON Document),并支持将非 JSON 文件作为附件(Attachment)附加到文档中。

  • Couchbase Server:除了 JSON 文档外,还支持key-value 与二进制数据存储;使用 Memcached 二进制协议实现 key-value 功能,并通过 REST API 支持 SQL / View 查询等能力。

54. 云计算(Cloud Computing)中的系统集成商(System Integrators)是什么?

  • 知识点: 后端 / DevOps/云 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: Integration, Hybrid Cloud, Private Cloud)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: general
  • id: 6960ca490e32007ea0d2f107 | 官方: 是 | 付费: 否

答案:

核心答案云环境(Cloud Environment)包含多组件且可能很复杂,系统集成商(System Integrator)指一套策略/过程,用于设计云架构(Cloud Architecture)并把不同组件集成起来,从而构建例如混合云(Hybrid Cloud)或私有云(Private Cloud)网络等解决方案。

55. Q9. How would you explain the API to a child?

问题9:你如何向孩子解释这个API?
  • 知识点: 后端 / 行为与软技能 (标签: explanation, simplification)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: general
  • 公司: Google
  • id: 696470f1a9243c30c87057d0 | 官方: 是 | 付费: 否

答案:

(补充答案·AI 生成(AI-Generated))

用比喻:API(Application Programming Interface,应用程序编程接口)就像餐厅的服务员——你(程序)不用进厨房(内部实现,Internal Implementation),只要按菜单(约定好的格式)告诉服务员你想要什么,他就把结果端给你。要点:①不用知道内部怎么做的;②有固定的「点单规则」(接口约定/参数,Interface Contract/Parameters);③按规则就能拿到结果,换厨师(换实现)也不影响你。

56. java 线程(Thread)2 种方式实现、设计模式(Design Pattern)、链表(Linked List)操作、排序(Sorting)。

  • 知识点: 后端 / 操作系统与网络 / 系统设计/架构 / UI/UX 设计 / 编程语言基础 (主题: java, concurrency, design-patterns;标签: Java, Thread, Runnable, Design Patterns)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: backend
  • id: 6965b95ea9243c30c8824b8e | 官方: 是 | 付费: 否

答案:

答案(1)2种线程实现(Thread Implementation)
aThread类(Thread Class)继承
TestCLth=newTestCL()//类继承Thread(Thread)

th.start()b实现Runnable接口(Runnable Interface)
Threadth=newThread(newRunnable(){

线程t=新线程(新可运行接口(){

publicvoidrun(){

公共无效运行(){

//实现

}

})

th.start()(2)设计模式(Design Pattern),分为4类
a创建模式(Creational Pattern):如工厂模式(Factory Pattern)、单例模式(Singleton Pattern)
b结构模式(Structural Pattern):代理模式(Proxy Pattern)
c行为模式(Behavioral Pattern):观察者模式(Observer Pattern)
d线程池模式(Thread Pool Pattern)

57. jvm(Java Virtual Machine)运行机制及内存原理。

  • 知识点: 后端 / 操作系统与网络 / 编程语言基础 (主题: jvm, java;标签: JVM, Memory, GC)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: backend
  • id: 6965b960a9243c30c8824ec2 | 官方: 是 | 付费: 否

答案:

答案运行:
I加载.class文件
II管理并且分配内存
III垃圾回收(Garbage Collection)
内存原理:
IJVM(Interpretation of the Java Virtual Machine)装载环境和配置
II装载JVM.dll(Java Virtual Machine Dynamic Link Library)并初始化JVM.dll
IV处理class类(bytecode class)

58. 在 Databricks 中如何处理实时/流式数据(real-time/streaming data)?

  • 知识点: 后端 / 数据工程与数据科学/AI (主题: databricks, spark, structured-streaming, kafka, delta-lake;标签: Databricks, Streaming)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: backend
  • id: 69708ce1120fcc15913766ef | 官方: 否 | 付费: 否

答案:

答案用 Spark Structured Streaming 连接 Kafka(Apache Kafka)/Event Hubs(Azure Event Hubs)/Kinesis(Amazon Kinesis)等源,定义 streaming DataFrame(流式数据帧),完成实时清洗、聚合与窗口计算(window computation)。
建议用 Delta Lake 作为 sink(数据出口),并配置 checkpoint(检查点)保障容错与 exactly-once(精确一次);监控延迟与吞吐,按需调优触发间隔(trigger interval)、状态存储(state store)与分区策略(partition strategy)。

59. 描述你将 Databricks 与其他数据工具集成的经验。

  • 知识点: 后端 / 数据工程与数据科学/AI (主题: databricks, integration, jdbc, odbc, airflow;标签: Databricks, Integration)
  • 类型: technical | 难度: medium | 子类型:
  • 分类: backend
  • id: 69708ce1120fcc1591376755 | 官方: 否 | 付费: 否

答案:

答案例如连接 S3(Amazon S3)/ADLS(Azure Data Lake Storage)作为数据湖(data lake),连接 Tableau/Power BI 做可视化,连接外部仓库/数据库做读写(JDBC/ODBC)。
编排层可用 Airflow/ADF(Azure Data Factory)触发 Jobs(作业);关键点在于连接器配置、安全(IAM(Identity and Access Management)/密钥/网络)与端到端一致性校验。

60. 什么是事件驱动架构(EDA,Event-Driven Architecture)?在Afterpay BNPL(Buy Now, Pay Later)中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: afterpay, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: Afterpay (Block)
  • id: 69b3791d58d557c902b97598 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

61. 解释 RESTful API 设计的最佳实践,以及在Taobao中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: alibaba, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: 阿里巴巴
  • id: 69b3792358d557c902b97b8b | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

62. 解释 RESTful API 设计的最佳实践(RESTful API Design Best Practices),以及在 AWS(Amazon Web Services)中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: amazon, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: 亚马逊
  • id: 69b3792c58d557c902b98377 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

63. 解释 RESTful API 设计的最佳实践(RESTful API Design Best Practices),以及在 Alipay(支付宝)中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: ant-group, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: 蚂蚁集团(支付宝)
  • id: 69b3793158d557c902b9888e | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

64. 解释 RESTful API 设计的最佳实践(RESTful API Design Best Practices),以及在 Claude 中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: anthropic, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: Anthropic
  • id: 69b3793358d557c902b98a3b | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

65. 什么是事件驱动架构(EDA,Event-Driven Architecture)?在ANZ Plus中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: anz, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: general
  • 公司: 澳新银行
  • id: 69b3793658d557c902b98cfb | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

66. 解释 RESTful(RESTful)API 设计的最佳实践,以及在Asana Work Management中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: asana, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: Asana
  • id: 69b3794158d557c902b99697 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

67. 什么是事件驱动架构(EDA,Event-Driven Architecture)?在Jira中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: atlassian, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: design
  • 公司: Atlassian
  • id: 69b3794c58d557c902b99ec7 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

68. 什么是事件驱动架构(EDA, Event-Driven Architecture)?在AutoCAD中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: autodesk, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: Autodesk
  • id: 69b3795758d557c902b9a87b | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

69. 解释 RESTful API 设计的最佳实践,以及在Baidu Search中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: baidu, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: 百度
  • id: 69b3796058d557c902b9b0a1 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

70. 什么是事件驱动架构(EDA, Event-Driven Architecture)?在Mining Operations中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: bhp, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: general
  • 公司: BHP
  • id: 69b3797658d557c902b9c165 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

71. 什么是事件驱动架构(Event-Driven Architecture,EDA)?在Bilibili Video中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: bilibili, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: 哔哩哔哩
  • id: 69b3797d58d557c902b9c647 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

72. 解释 RESTful API(Representational State Transfer API)设计的最佳实践,以及在Bloomberg Terminal中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: bloomberg, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: 彭博
  • id: 69b3798858d557c902b9ce43 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

73. 解释 RESTful API 设计的最佳实践,以及在TikTok中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: bytedance, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: 字节跳动
  • id: 69b3799a58d557c902b9dae2 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

74. 什么是事件驱动架构(EDA)?在Canva Editor中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: canva, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: 可画
  • id: 69b379d358d557c902ba037f | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

75. 什么是事件驱动架构(EDA)?在CommBank App中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: cba, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: general
  • 公司: Commonwealth Bank of Australia
  • id: 69b379f258d557c902ba1868 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

76. 什么是事件驱动架构(EDA)?在Cochlear Implants中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: cochlear, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: general
  • 公司: Cochlear
  • id: 69b37a2658d557c902ba3970 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

77. 什么是事件驱动架构(EDA)?在Coles Online中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: coles, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: general
  • 公司: Coles Group
  • id: 69b37a4558d557c902ba4ca8 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

78. 解释 RESTful API(RESTful Application Programming Interface)设计的最佳实践,以及在Confluent Cloud中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: confluent, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: Confluent
  • id: 69b37a4f58d557c902ba528e | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

79. 解释 RESTful API 设计的最佳实践,以及在Falcon Platform中如何应用。Falcon Platform(Falcon平台)、RESTful API(RESTful Application Programming Interface)

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: crowdstrike, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: CrowdStrike
  • id: 69b37a5358d557c902ba55ca | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

80. 解释 RESTful API 设计的最佳实践,以及在Lakehouse Platform中如何应用。RESTful API(RESTful Application Programming Interface)、Lakehouse Platform(湖仓平台)

  • 知识点: 后端 / 数据工程与数据科学/AI / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: databricks, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: Databricks
  • id: 69b37a6558d557c902ba6361 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

81. 解释 RESTful API(RESTful API)设计的最佳实践,以及在APM(APM)中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: datadog, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: Datadog
  • id: 69b37a6758d557c902ba647a | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

82. 解释 RESTful API(RESTful API)设计的最佳实践,以及在Discord App(Discord App)中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: discord, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: Discord
  • id: 69b37a7958d557c902ba7094 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

83. 解释 RESTful API(RESTful API)设计的最佳实践,以及在Mavic Series(Mavic Series)中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: dji, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: 大疆创新
  • id: 69b37a8f58d557c902ba7d83 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

84. 什么是事件驱动架构(Event-Driven Architecture, EDA)?在Elasticsearch中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: elastic, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: Elastic
  • id: 69b37ab958d557c902ba96a9 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

85. 解释 RESTful API 设计的最佳实践,以及在Google Search中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: google, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: Google
  • id: 69b37b1658d557c902bacd22 | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

86. 什么是事件驱动架构(Event-Driven Architecture, EDA)?在GrabRide中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: grab, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: Grab
  • id: 69b37b2258d557c902bad40e | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

87. 解释 RESTful API(Representational State Transfer Application Programming Interface)设计的最佳实践,以及在Terraform(基础设施即代码工具)中如何应用。

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: api-design, system-design;标签: hashicorp, generated)
  • 类型: technical | 难度: medium | 子类型: concept
  • 分类: backend
  • 公司: HashiCorp
  • id: 69b37b3058d557c902badc4b | 官方: 是 | 付费: 是

答案:

思路分析从 HTTP(HyperText Transfer Protocol)方法语义、URL(Uniform Resource Locator)设计、版本控制、错误处理、安全性等方面展开。
参考答案核心原则:资源导向 URL、正确使用 HTTP 方法、合理的状态码、分页排序过滤、HATEOAS(Hypermedia As The Engine Of Application State)、版本管理(URL/Header)、认证授权(OAuth2/JWT)。
评分要点- RESTful 设计原则理解

  • 实际项目中的应用经验
  • API 安全性考虑
    常见追问- REST vs GraphQL 的选择?
  • 如何处理 API 向后兼容?

88. Flask 如何处理数据库请求?

  • 知识点: 后端 / 数据库 / 编程语言基础 (主题: python;标签: python, flask, database, request)
  • 类型: technical | 难度: hard | 子类型:
  • 分类: backend
  • id: 695b5e5b7fd56f69a88e8a74 | 官方: 是 | 付费: 否

答案:

TL;DRFlask 通常通过请求生命周期钩子管理数据库连接:before_request 打开连接,after_request 处理响应,teardown_request 释放资源。
常见模式- before_request():请求前初始化 DB(Database)连接

  • after_request():请求后处理响应
  • teardown_request():无论是否异常都释放连接

89. 你能解释一下微服务架构(Microservices Architecture)的概念吗?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 / 编程语言基础 / 行为与软技能 (主题: system-design;标签: microservices, scalability, resilience, service-communication)
  • 类型: technical | 难度: hard | 子类型:
  • 分类: backend
  • id: 695cc0361da553795622a856 | 官方: 是 | 付费: 否

答案:

TL;DR微服务架构把应用拆成多个小型、松耦合、可独立部署的服务;提升扩展性与迭代速度,但带来通信、协作与数据一致性等复杂性。
微服务架构是一种将应用构建为一组小型、松耦合、可独立部署服务的设计模式。每个服务聚焦于特定业务能力,可独立开发、测试与部署。该模式提高可扩展性与韧性,并能加快开发周期,但也带来额外复杂性,例如协调、服务通信以及服务之间的数据同步等问题。

90. 你如何在 GraphQL 服务器中进行错误处理(error handling)?

  • 知识点: 后端 / 算法与数据结构 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: graphql, error-handling, resolver, middleware, error-codes)
  • 类型: technical | 难度: hard | 子类型:
  • 分类: backend
  • id: 695cce7f1da553795624f742 | 官方: 是 | 付费: 否

答案:

TL;DRGraphQL 的错误处理可以通过自定义错误格式、添加错误码、用中间件/高阶函数包装 resolver(解析器)来捕获异常,并按类别结构化返回给客户端。
在 GraphQL 服务器中可以通过自定义错误格式、添加错误码、以及使用错误捕获中间件或高阶函数包装 resolver(解析器)来实现错误处理。错误需要正确分类,并以结构化格式返回给客户端,便于客户端进行统一处理。

91. 你会如何在 Express.js 中实现一个简单的中间件来记录(log)传入请求?

  • 知识点: 后端 (主题: nodejs;标签: express, middleware, logging, nodejs)
  • 类型: technical | 难度: hard | 子类型:
  • 分类: backend
  • id: 695cce7f1da553795624f75c | 官方: 是 | 付费: 否

答案:

TL;DR可以通过 Express 中间件拦截请求并记录信息(如 method、url、时间等)。原文示例以图片形式给出。
以下是一个在 Express.js(Express.js)中记录传入请求(incoming request)的中间件(middleware)示例(原文以图片提供):

92. 在 Node.js(Node.js)中,http 或 fs 等模块中的 Event(Event)对象有什么作用?

  • 知识点: 后端 / 操作系统与网络 / 系统设计/架构 (主题: nodejs;标签: nodejs, events, event-driven, http, fs)
  • 类型: technical | 难度: hard | 子类型:
  • 分类: backend
  • id: 695cce7f1da553795624f763 | 官方: 是 | 付费: 否

答案:

TL;DR Event 对象用于发射事件(emit event)以通知状态变化、资源可用或错误。事件驱动编程(event-driven programming)让 Node.js 在 I/O 密集场景中更高效、可扩展。
Node.js 模块通过 Event 对象来发射事件,用于表示状态变化、资源可用或错误。基于 Event 对象的事件驱动编程方式可以帮助构建高效且高度可扩展的应用,尤其适合处理 I/O 密集型工作负载(I/O-intensive workload)。

93. 你能给出一个使用 async/await(async/await)处理 Node.js 异步文件 I/O(asynchronous file I/O)的示例吗?

  • 知识点: 后端 (主题: nodejs;标签: nodejs, async-await, file-io, fs.promises)
  • 类型: technical | 难度: hard | 子类型:
  • 分类: backend
  • id: 695cce7f1da553795624f766 | 官方: 是 | 付费: 否

答案:

TL;DR可使用 async/await 配合 fs.promises(fs.promises)以异步方式读取文件。原文示例以图片形式给出。
下面是一个使用 async/await 与 fs.promises API 异步读取文件的简单示例(原文以图片提供):

94. 你会如何在 Express.js 中为 RESTful API(RESTful API)实现缓存(cache)?

  • 知识点: 后端 / 数据库 / 系统设计/架构 (主题: nodejs;标签: express, cache, rest, middleware, redis)
  • 类型: technical | 难度: hard | 子类型:
  • 分类: backend
  • id: 695cce7f1da553795624f769 | 官方: 是 | 付费: 否

答案:

TL;DR可以用中间件 + 内存对象实现简单缓存,或用 Redis(Redis)等更高效方案。原文给出内存缓存示例(图片)。
一个简单的缓存机制可以用中间件和内存中的 JavaScript 对象实现,或使用更高效的缓存系统(如 Redis)。下面是一个内存缓存示例(原文以图片形式给出):

95. 你会如何在 Koa.js(Koa.js)服务器中实现一个中间件来衡量请求处理时间?

  • 知识点: 后端 (主题: nodejs;标签: koa, middleware, performance, timing)
  • 类型: technical | 难度: hard | 子类型:
  • 分类: backend
  • id: 695cce7f1da553795624f772 | 官方: 是 | 付费: 否

答案:

TL;DR可以用 Koa 中间件在请求前后记录时间差并输出日志或写入响应头(response header)。原文示例以图片给出。
下面是一个用于衡量请求处理时间的 Koa.js 中间件示例(原文以图片提供):

96. 在 Python Web 应用中,如何在服务器与 WebSocket 客户端(WebSocket client)之间实现消息传递(message passing)?

  • 知识点: 后端 / 操作系统与网络 / 编程语言基础 (主题: python;标签: python, websocket, flask-socketio, django-channels, event-based)
  • 类型: technical | 难度: hard | 子类型:
  • 分类: backend
  • id: 695cce7f1da553795624f77b | 官方: 是 | 付费: 否

答案:

TL;DR可以使用 Flask-SocketIO(Flask-SocketIO)或 Django Channels(Django Channels)实现 WebSocket 通信,利用事件监听(event listening)与 emit(emit)在服务端和客户端之间发送/接收消息。
在 Python Web 应用中,你可以使用 Flask-SocketIO 或 Django Channels 等库实现 WebSocket 通信,并管理服务器与 WebSocket 客户端之间的消息传递。服务器和客户端通过基于事件的监听器(listener)与发射器(emitter)在 WebSocket 通道(WebSocket channel)中发送与接收消息。

97. 你会如何为 Node.js 应用实现一个性能基准测试工具(performance benchmarking tool)?

  • 知识点: 后端 (主题: nodejs;标签: nodejs, benchmarking, perf_hooks, benchmark.js, profiling)
  • 类型: technical | 难度: hard | 子类型:
  • 分类: backend
  • id: 695cce7f1da553795624f78c | 官方: 是 | 付费: 否

答案:

TL;DR可使用 Node 内置 perf_hooks 或第三方 Benchmark.js 测量函数运行时间并分析性能特征(performance characteristics)。原文提供了 perf_hooks 示例(图片)。
要实现 Node.js 应用的性能基准测试工具(performance benchmarking tool),可以使用内置模块 perf_hooks 或第三方库 Benchmark.js。这些工具能测量特定函数或代码片段的运行时间(runtime),并提供关于性能特征(performance characteristics)的洞察。
下面是一个使用 perf_hooks 的示例(原文以图片提供):

98. 在系统设计面试(system design interview)中,如何用结构化方法回答一道系统设计题?请给出逐步流程,并说明每一步要做什么、要问哪些关键问题。

  • 知识点: 后端 / 数据库 / 系统设计/架构 / UI/UX 设计 / 编程语言基础 (主题: system-design;标签: system design interview, requirement clarification, capacity estimation, high-level design, database design, api design, scalability, reliability, trade-offs)
  • 类型: technical | 难度: hard | 子类型:
  • 分类: backend
  • id: 695cd9d31da5537956268da2 | 官方: 是 | 付费: 否

答案:

TL;DR系统设计面试(system design interview)可以用7 步结构化方法来回答:1)澄清需求(functional requirements / non-functional requirements),2)容量估算(capacity estimation)(用户、QPS、存储、带宽),3)高层架构设计(high-level design)(组件划分+数据流图),4)数据库设计(database design)(建模、选型、Schema、访问模式),5)API 与通信协议(communication protocol)(REST/GraphQL/RPC、数据格式、协议),6)关键组件深挖(缓存、分片、负载均衡、容灾、权限、限流),7)解决核心问题(性能、扩展性、可靠性、安全、成本)。核心在于清晰表达权衡、用数据驱动决策、展示系统化思考。

Step 1: 澄清需求(Clarify Requirements)
第一步是彻底理解题目,消除歧义,确保你和面试官对系统的范围达成一致。需求分为功能性需求(functional requirements)与非功能性需求(non-functional requirements),最好的方式是通过提问来确认。

功能性需求(Functional Requirements)要问什么?

  • 系统必须支持的核心功能是什么?
  • 哪些功能最关键、优先级最高?
  • 系统的用户是谁(客户/内部团队等)?
  • 用户可以在系统上执行哪些操作?
  • 用户如何接入系统(Web/Mobile/API 等)?
  • 是否需要多语言或多地区支持(locale)?
  • 系统需要处理哪些数据类型(文本/图片/结构化数据等)?这会影响数据库选择。
  • 是否需要接入外部系统或第三方服务?

非功能性需求(Non-functional Requirements)要问什么?

  • 预期用户规模与请求规模是多少?
  • 预期数据量(data volume)是多少?
  • 系统的输入与输出是什么?
  • 读写比例(read-to-write ratio)是多少?
  • 是否允许停机?还是必须高可用?
  • 是否有明确的延迟(latency)目标?
  • 一致性要求有多严格?可以容忍最终一致性吗?
  • 重点关注哪些指标:性能/可扩展/可靠性?

提示:尽早确定范围可以避免你在错误方向上设计。

Step 2: 容量估算(Capacity Estimation)
在明确需求后,对系统规模做粗略估算,帮助你在后续做出合理的架构选型(architecture selection)(例如是否需要分片(sharding)、CDN、缓存等)。并不是每次面试都必须算得很细,但建议至少给出一个数量级估计,并可先问面试官是否需要做估算。

估算维度

  • Users:日活用户、峰值并发用户
  • Traffic:读写 QPS(每秒请求数),峰值与突增情况
  • Storage:不同数据类型的存储需求与增长率
  • Memory:缓存是否有价值?需要多少内存存热点数据?
  • Network:带宽需求(请求量 × 响应大小)

还需要考虑未来增长,保证系统能横向扩容(horizontal scaling)。

Step 3: 高层设计(High-Level Design)
基于需求与容量估算(Capacity Estimation),设计系统的宏观架构(Architecture)。把系统拆成主要组件(Component),并画出请求与数据流动的块图(Block Diagram)。

高层架构图(High-level Architecture Diagram)应包含哪些组件?

  • Client Applications:Web/Mobile/桌面端等
  • Web Servers:处理请求入口
  • Load Balancers:分发流量,支撑高并发
  • Application Services:核心业务逻辑层
  • Databases:SQL vs NoSQL,并说明原因
  • Caching Layer:如 Redis/Memcached,降低 DB 压力
  • Message Queues:异步处理与削峰填谷(如 Kafka/RabbitMQ)
  • External Services:第三方依赖(支付、短信等)

画图技巧(Diagram Tips)

  • 保持简洁,只画大组件与关键数据流
  • 用方框+箭头表达方向,不要写过多细节
  • 清晰表达数据流:请求从哪里来、怎么处理、存储在哪里
  • 强调你做选择时的权衡,例如:需要强一致,所以选关系型数据库

Step 4: 数据库设计(Database Design)
数据库设计(Database Design)包括:数据建模(Data Modeling)、数据库选型(Database Selection)、Schema 设计(Schema Design)、以及根据访问模式(Access Pattern)优化读写。

4.1 数据建模(Data Modeling)

  • 识别核心实体(例如 users / products / orders)
  • 确定实体关系(1-to-many / many-to-many)
  • 确定字段属性(email、name、address 等)
  • 定义唯一标识(primary key / unique id)
  • 合理规范化(normalization)保证一致性、减少冗余

4.2 数据库选型(Database Selection)

  • Relational(MySQL/PostgreSQL):结构化数据、复杂关系、ACID
  • NoSQL(MongoDB/Cassandra):非结构化/半结构化、高扩展、最终一致性
  • 也可混用:不同数据子集使用不同数据库满足不同需求

4.3 Schema 设计(Schema Design)

  • 定义表/字段/类型/关系
  • 添加主键、外键、索引优化查询
  • 必要时使用反规范化(denormalization)提升读性能

4.4 访问模式(Data Access Patterns)

  • 识别系统常见 query 与读写路径
  • 针对访问模式优化索引与 schema
  • 使用缓存存热点数据,降低数据库压力
  • 必要时分区/分片(partition/sharding)提升可扩展性

Step 5: API 与通信协议设计(API & Protocols)
定义组件之间如何交互:接口功能(Interface Functionality)、API 风格(API Style)、接口定义(Interface Definition)、数据格式(Data Format)、以及通信协议(Communication Protocol)。

5.1 识别 API 需求(Identify API Requirements)

  • 系统要暴露哪些核心能力?
  • 有哪些 client 类型(Web/Mobile/第三方)?
  • 每个 endpoint 的输入输出是什么?

5.2 选择 API 风格(Choose API Style)

  • REST:最常见,资源导向,统一接口
  • GraphQL:客户端灵活选择字段,减少 over-fetching
  • RPC:过程式调用,适合内部服务通信

5.3 定义 Endpoint(Define API Endpoints)

  • 使用清晰直观的路径
  • 用 HTTP Verb 表达操作语义:GET/POST/PUT/DELETE

5.4 数据格式(Data Format)

  • 常用 JSON 或 XML
  • 考虑可读性、解析效率与客户端兼容性

5.5 通信协议(Communication Protocols)

  • HTTPS:REST/API 通用
  • WebSockets:实时双向通信(聊天、实时通知)
  • gRPC:高效服务间通信
  • Messaging Protocols:AMQP/MQTT 支撑异步消息队列

Step 6: 深挖关键组件(Deep Dive)
面试官通常会选择某些关键点深入问。你需要准备可扩展性(Scalability)与可靠性(Reliability)的细节。

常见深挖方向

  • 数据库:数据暴涨如何处理?分片、复制、读写分离
  • Web/App Servers:如何水平扩容?如何无状态化?
  • 负载均衡:算法选择(轮询、最少连接等)
  • 缓存:加在哪?如何失效(invalidation)?
  • 单点故障:识别并消除(多副本、故障切换)
  • 鉴权授权:如何安全管理访问权限
  • 限流:如何防止滥用与攻击(Rate limiting)

Step 7: 解决核心问题(Address Key Issues)
最后聚焦系统可能遇到的挑战:性能(Performance)、扩展性(Scalability)、可靠性(Reliability)、安全(Security)与成本(Cost)。

7.1 扩展性与性能(Scalability & Performance)

  • 水平扩容(scale-out):加节点 + 负载均衡
  • 垂直扩容(scale-up):提升单机资源(CPU/内存/存储)
  • 缓存减少 DB 压力、降低延迟
  • 选择高效的数据结构与算法
  • 优化查询与索引,必要时反规范化
  • 分区/分片提升查询性能
  • CDN 加速静态资源
  • 异步模型提升并发处理能力

7.2 可靠性(Reliability)

  • 识别单点故障(Single Point of Failure)
  • 冗余设计(多负载均衡器、多数据库副本)
  • 跨地域容灾(geographical redundancy)
  • 数据复制保证可用性与持久性
  • 断路器(circuit breaker)防止级联故障
  • 重试 + 指数退避(exponential backoff)处理暂时失败
  • 监控与告警(monitoring & alerting)快速定位异常

总结
系统设计面试(System Design Interview)的目标不是给出“完美答案”,而是展示你能拆解问题、做出有依据的架构决策(Architecture Decision)、清晰说明权衡(Trade-off)并把思考过程讲明白。以上 7 步能帮助你结构化回答并覆盖关键维度。

99. 排行榜系统(Leaderboard System)如何通过推送通知(Push Notifications)向玩家发送分数更新?请说明触发方式、消息队列(Message Queue)的作用以及如何避免重复通知。

  • 知识点: 后端 / 算法与数据结构 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: push-notifications, db-trigger, change-feed, message-queue, bloom-filter)
  • 类型: technical | 难度: hard | 子类型:
  • 分类: backend
  • id: 695dfa151da5537956361db4 | 官方: 是 | 付费: 否

答案:

TL;DR可以通过数据库触发器(Database Trigger) / 变更馈送(Change Feed)捕获排名变化,当某玩家被超越时触发无服务器函数(Serverless Function)。函数将事件写入消息队列(Message Queue)进行异步处理(Asynchronous Processing)并向推送服务(Push Notification Service)发送通知。为避免同一事件重复通知,可使用布隆过滤器(Bloom Filter)存储已通知过的 player_id,实现“一次性通知”。
关键机制- 触发源:数据库触发器(Database Trigger)(如 PostgreSQL trigger)或变更馈送(Change Feed)(如 Cosmos DB change feed)捕获数据变化。

  • 触发动作:trigger/change feed 调用 serverless function,生成“排名变动事件”。
  • 异步扩展:serverless function 将事件写入 message queue(如 Kafka/SQS/RabbitMQ)进行异步 fan-out,提升吞吐与稳定性。
  • 推送发送:消费队列事件后调用 Push Notification Service(APNS/FCM/Web Push)。
    如何避免重复通知- 使用布隆过滤器(Bloom Filter)存储已通知过的 player_id(或 player_id + event_id),确保每个排名变化只通知一次。
  • 也可以结合幂等 key(idempotency key)或去重表(dedup table)。
    适用场景示例- 玩家 A 的分数被玩家 B 超越 → 触发“rank beaten”事件 → 推送给 A。

100. 为什么通知系统需要消息队列(Notification Queue)?它如何支持至少一次(At-least-once)和仅一次(Exactly-once)投递语义(Delivery Semantics)?

  • 知识点: 后端 / 算法与数据结构 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: queue, kafka, rabbitmq, decoupling, buffering, delivery-semantics, at-least-once, exactly-once)
  • 类型: technical | 难度: hard | 子类型:
  • 分类: backend
  • id: 695dfe121da553795636790c | 官方: 是 | 付费: 否

答案:

TL;DR队列用于解耦请求提交与实际发送、削峰填谷(Peak Shaving)并提高系统可扩展性(Scalability)。队列可配置不同投递语义:至少一次(At-least-once)保证不丢消息但可能重复;仅一次(Exactly-once)避免重复但需要更复杂的幂等性(Idempotency)与去重机制配合。
为什么需要队列- 解耦(Decoupling):Notification Service 不直接做发送,降低耦合。

  • 削峰:高峰期(如秒杀)将突发流量缓冲到队列。
  • 可扩展:Channel Processors 可独立扩容。
  • 可靠性:队列可提供持久化、重试、消费确认等机制。
    At-least-once- 保证每条消息至少投递一次。
  • 极少数情况下可能重复发送。
    Exactly-once- 保证每条消息只发送一次。
  • 通常需要:幂等发送、去重存储、唯一 messageId/requestId 以及事务/一致性机制。

101. 分布式计数器(Distributed Counter)通常暴露哪些 API(Application Programming Interface)?如何通过 REST(Representational State Transfer) + WebSocket/SSE(Server-Sent Events)实现“读实时、写幂等”的计数更新?

  • 知识点: 后端 / 操作系统与网络 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: rest, websocket, sse, idempotency, counter-api, put)
  • 类型: technical | 难度: hard | 子类型:
  • 分类: backend
  • id: 695dff721da55379563694b4 | 官方: 是 | 付费: 否

答案:

TL;DR常见 API 包括:GET /:webpage-id/counter 用于读取计数,PUT /:webpage-id/counter 用于更新计数(increment/decrement)。实时展示可通过 WebSocket/SSE 推送更新;写操作使用 PUT 保证幂等语义(Idempotent Semantics)。
读取计数(Fetch counter)/:webpage-id/counter
method: GET

方法:GET
accept: application/json, text/html成功返回示例:
status code: 200 OK
状态代码:200 OK
content-encoding: gzip
内容编码:gzip
content-type: application/json
内容类型:application/json
cache-control: no-store
缓存控制:不存储
{
count: 715,
计数:715,
updated_at: "2030-10-10T12:11:42Z"
更新时间:“2030-10-10T12:11:42Z”
}更新计数(Update counter)使用 PUT 是因为其具备幂等语义(适合分布式重试)。
/:webpage-id/counter
/:网页标识-计数器
method: PUT
方法:PUT
content-length: 15
内容长度:15
{
action: "increment"
操作:“增加”
}成功返回示例:
status code: 200 OK
状态代码:200 OK
content-encoding: gzip
内容编码:gzip
content-type: application/json
内容类型:application/json
{
count: 812,
计数:812,
updated_at: "2030-10-10T12:11:42Z"
更新时间:“2030-10-10T12:11:42Z”
}实时通信协议(Real-time Communication Protocol)- WebSocket:双向通信,适合持续推送计数变化。
  • SSE:单向推送,适合服务器持续向客户端推送。

102. ZooKeeper 的角色有哪些?它的工作原理是什么?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design;标签: ZooKeeper, Leader, Follower, Observer, Client, Leader Election, 一致性算法)
  • 类型: technical | 难度: hard | 子类型:
  • 分类: backend
  • id: 6960bb950e32007ea0d1d270 | 官方: 是 | 付费: 否

答案:

核心答案ZooKeeper 中常见的角色包括:Leader、Follower(Learner)、Observer、Client。

  • Leader:负责决策与调度,并处理写请求。
  • Follower / Observer:都会把来自 Client 的请求提交给 Leader;区别是 Observer 不参与写(没有写职能),主要用于提升扩展能力、缓解投票压力。
  • Client:发起读写请求的客户端。
    工作原理(选举与协作)ZooKeeper 采用分布式一致性算法(Distributed Consensus Algorithm),包含 Leader 选举机制(Leader Election Mechanism)。其描述中可理解为:节点会在指定目录下生成对应的 id,然后通过类似 getChildren() 的方式获取节点列表,通常 id 最小的节点成为 Leader;当 Leader 挂掉后,会由次小 id 的节点顶上。
    配置文件中常见形式:
    Server.x=AAAA:BBBB:CCCC- x:节点编号
  • AAAA:ZooKeeper 节点 IP
  • BBBB:接收 Client 请求端口
  • CCCC:Leader 重新选举端口

103. 匿名类(Anonymous Class)与 Lambda 表达式(Lambda Expression)有什么区别?

  • 知识点: 后端 / 编程语言基础 (主题: java;标签: Lambda Expression, Anonymous Class, Functional Interface)
  • 类型: technical | 难度: hard | 子类型:
  • 分类: backend
  • id: 6960c5a90e32007ea0d2abaf | 官方: 是 | 付费: 否

答案:

核心答案这是Java(Java) 语言层面的问题:匿名类(Anonymous Class)与 Lambda 表达式(Lambda Expression)都可用于实现接口(Interface),但语义与作用域行为不同。
主要区别- 语法与可读性:Lambda 更简洁,适合函数式接口(Functional Interface)。

  • this 指向:匿名类里的 this 指向匿名类实例;Lambda 的 this 指向外层类实例。
  • 变量捕获:两者都只能捕获“effectively final”的局部变量,但细节表现不同。
  • 字节码实现:匿名类通常生成额外类;Lambda 通常通过 invokedynamic 等机制实现(实现细节由 JVM 决定)。

104. 什么是事件驱动架构(EDA,Event-Driven Architecture)?在Taobao中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: alibaba, generated)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: backend
  • 公司: 阿里巴巴
  • id: 69b3792358d557c902b97bb0 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

105. 什么是事件驱动架构(EDA,Event-Driven Architecture)?在AWS中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: amazon, generated)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: backend
  • 公司: 亚马逊
  • id: 69b3792d58d557c902b983a4 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

106. 什么是事件驱动架构(EDA,Event-Driven Architecture)?在Alipay中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: ant-group, generated)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: backend
  • 公司: 蚂蚁集团(支付宝)
  • id: 69b3793158d557c902b988c5 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

107. 什么是事件驱动架构(Event-Driven Architecture,EDA)?在Claude中有哪些应用场景(Use Cases)?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: anthropic, generated)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: backend
  • 公司: Anthropic
  • id: 69b3793358d557c902b98a7c | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

108. 什么是事件驱动架构(Event-Driven Architecture,EDA)?在Asana Work Management中有哪些应用场景(Use Cases)?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: asana, generated)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: backend
  • 公司: Asana
  • id: 69b3794158d557c902b996e7 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

109. 什么是事件驱动架构(Event-Driven Architecture,EDA)?在Baidu Search中有哪些应用场景(Use Cases)?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: baidu, generated)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: backend
  • 公司: 百度
  • id: 69b3796158d557c902b9b109 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

110. 什么是事件驱动架构(Event-Driven Architecture,EDA)?在Bloomberg Terminal中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: bloomberg, generated)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: backend
  • 公司: 彭博
  • id: 69b3798958d557c902b9cebe | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

111. 什么是事件驱动架构(Event-Driven Architecture,EDA)?在TikTok中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: bytedance, generated)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: backend
  • 公司: 字节跳动
  • id: 69b3799b58d557c902b9db71 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

112. 什么是事件驱动架构(Event-Driven Architecture,EDA)?在Confluent Cloud中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: confluent, generated)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: backend
  • 公司: Confluent
  • id: 69b37a5058d557c902ba5374 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

113. 什么是事件驱动架构(Event-Driven Architecture,EDA)?在Falcon Platform中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: crowdstrike, generated)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: backend
  • 公司: CrowdStrike
  • id: 69b37a5558d557c902ba56c0 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

114. 什么是事件驱动架构(EDA,Event-Driven Architecture)?在Lakehouse Platform中有哪些应用场景?

  • 知识点: 后端 / 数据工程与数据科学/AI / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: databricks, generated)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: backend
  • 公司: Databricks
  • id: 69b37a6658d557c902ba6441 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

115. 什么是事件驱动架构(EDA,Event-Driven Architecture)?在APM(Application Performance Monitoring)中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: datadog, generated)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: backend
  • 公司: Datadog
  • id: 69b37a6858d557c902ba6567 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

116. 什么是事件驱动架构(EDA,Event-Driven Architecture)?在Discord App中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: discord, generated)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: backend
  • 公司: Discord
  • id: 69b37a7b58d557c902ba7182 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

117. 什么是事件驱动架构(EDA,Event-Driven Architecture)?在Mavic Series中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: dji, generated)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: backend
  • 公司: 大疆创新
  • id: 69b37a9058d557c902ba7e8c | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

118. 什么是事件驱动架构(EDA,Event-Driven Architecture)?在Google Search中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: google, generated)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: backend
  • 公司: Google
  • id: 69b37b1858d557c902bace6d | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?

119. 什么是事件驱动架构(EDA,Event-Driven Architecture)?在Terraform中有哪些应用场景?

  • 知识点: 后端 / 系统设计/架构 / UI/UX 设计 (主题: system-design, microservices;标签: hashicorp, generated)
  • 类型: technical | 难度: hard | 子类型: concept
  • 分类: backend
  • 公司: HashiCorp
  • id: 69b37b3258d557c902badd64 | 官方: 是 | 付费: 是

答案:

思路分析从事件生产者(Event Producer)、消费者(Consumer)、事件总线(Event Bus)/消息中间件(Message Broker)的角度解释架构。
参考答案核心概念:事件(Event)作为一等公民,松耦合(Loosely Coupled)的生产者-消费者模型(Producer-Consumer Model)。常见模式:事件通知(Event Notification)、事件溯源(Event Sourcing)、CQRS(Command Query Responsibility Segregation)。消息中间件(Message Broker):Kafka、RabbitMQ。
评分要点- EDA(Event-Driven Architecture)架构模式理解

  • 事件溯源和 CQRS
  • 实际应用经验
    常见追问- 如何处理事件的幂等性(Idempotency)?
  • 事件 schema 如何演进?
0

评论

博主关闭了当前页面的评论
EN