981377660LMT / ts

ts学习
6 stars 1 forks source link

以前端为重点和以后端为中心的系统设计访谈 #390

Open 981377660LMT opened 9 months ago

981377660LMT commented 9 months ago

相似之处

以前端为重点和以后端为中心的系统设计访谈在解决设计问题的方法方面有很多相似之处:

  1. starting with gathering system requirements 从收集系统要求开始
  2. laying out a clear plan and identifying major distinguishable components of the system 制定清晰的计划并确定系统中的主要可区分组件
  3. proceeding to end to end api design 进行端到端 API 设计
  4. talking about optimization 谈论优化

    不同之处

    • 在以后端为中心的系统设计面试中,您将花费大部分时间谈论以下内容:
  5. backend/server side architecture, hand waving various backend services/components 后端/服务器端架构,挥手挥舞各种后端服务/组件
  6. discussing which type of database to use and how to aggregate data across different shards 讨论使用哪种类型的数据库以及如何跨不同分片聚合数据
  7. designing SQL table schema 设计 SQL 表架构
  8. choosing the right the cross-region strategy if your service has a global user base 选择正确的跨区域策略(如果您的服务具有全球用户群)
  9. any other kinds of system characteristics like latency, availability, fault tolerance, etc. 任何其他类型的系统特征,如延迟、可用性、容错等。
    • 对于以前端为中心的系统设计面试,你会花大部分时间谈论这样的事情:
  10. frontend/client side architecture, such as the appropriate rendering pattern to choose - client side rendering, or server side rendering or static generation or something in between? 前端/客户端架构,例如要选择的适当渲染模式 - 客户端渲染,或服务器端渲染或静态生成或介于两者之间?
  11. What kind of data fetching mechanism to use - REST vs. GRAPHQL vs. gRPC and what should the APIs look like? 使用哪种数据获取机制 - REST vs. GRAPHQL vs. gRPC,API 应该是什么样子的?
  12. Specifics about UI components 有关 UI 组件的详细信息
    • a newsfeed which has an infinite scroll behaviour with all the images lazily loaded while ensuring the client side has the aspect ratio of the images upfront to prevent layout shift. 具有无限滚动行为的新闻源,所有图像都延迟加载,同时确保客户端具有图像的纵横比以防止布局偏移。
    • an autocomplete UI component which fetches search result data incrementally in batches while receiving images from server pushes in parallel. 一个自动完成的 UI 组件,它以增量方式批量获取搜索结果数据,同时从服务器推送中并行接收图像。
    • a gallery page which pulls images and displays them in the correct order despite the asynchrony that comes with the network requests that might cause them to arrive out of order. 一个库页面,它拉取图像并以正确的顺序显示它们,尽管网络请求附带的异步可能会导致它们无序到达。
  13. How do you leverage different layers of cache to decrease latency or support offline mode. 如何利用不同的缓存层来减少延迟或支持脱机模式。
  14. if they want to get framework-specific, which is totally possible, they might even ask you to define a particular React components’s props or manage complex state in a React app. 如果他们想要获得特定于框架的(这是完全可能的),他们甚至可能会要求您定义特定 React 组件的 props 或在 React 应用程序中管理复杂状态。 很多时候,进行一种类型的系统设计面试意味着你可以过度简化相反的一面:

    其他

    In a backend system design interview, the client-side/frontend is reduced to an API layer - you don’t need to consider all the intricacies of the browser or the pesky rerenders your real-time updates would cause. 在后端系统设计面试中,客户端/前端被简化为 API 层 - 您无需考虑浏览器的所有复杂性或实时更新会导致的讨厌的重新渲染。

In a frontend system design interview, you can treat the backend as a black box and you don’t need to worry about how things like how to scale a database, or how your choice of using web sockets might affect the load balancers because of the need for sticky sessions support. 在前端系统设计面试中,您可以将后端视为黑盒,并且无需担心诸如如何扩展数据库之类的事情,或者由于需要粘性会话支持,因此选择使用Web套接字可能会如何影响负载均衡器。

981377660LMT commented 9 months ago

https://www.zhenghao.io/posts