Consider streaming services like Max, Netflix, and Hulu. The companies developing these services provide media content to a wide array of users on different platforms (e.g. browsers, apps, devices).
If you were tasked with designing the pieces to support a web-based streaming platform, which would eventually expand out to other services, what kind of components would you design?
Coding aspect: define data structures, what kind of components/classes would be needed.
Requirements:
- Describe data structure to be stored
- Describe how data will be fetched
- Create components that will retrieve this content for:
- Lists (collection of media); filter could be possible by type
- Returning metadata
- Returning content
Example of describing connection between user-facing call to data structure:
List collection of media
GET /{endpoint}
-> Retrieves data from [component]
-> [componentA] -> gets data from [componentB] using {reference}
这道题考察的是一个面向流媒体平台的组件设计问题,重点不是具体算法,而是如何把“用户请求”映射到“内容数据结构”和“服务组件”。你需要先定义媒体内容的核心数据模型,例如媒体列表、媒体元数据、播放内容以及它们之间的引用关系;然后设计获取流程,比如通过 REST 接口按 endpoint 拉取列表、按类型过滤内容、返回 metadata 或完整 content。回答时通常要说明哪些类或服务负责聚合列表、哪些负责查详情、哪些负责根据引用加载底层资源,并把前端调用链路描述清楚,体现可扩展到浏览器、App 和设备端的通用架构思路。