Unicorns VO 面试真题解析:Car Share Rental App 系统设计

20次阅读
没有评论

Systems Design – Car Share Rental App

We are building a car sharing rental app that enables users who want to rent a car to find users who have personal cars available for rent. It can be mobile web or native mobile (your preference).

For a car owner, you can:

  • add your car, and set per day price and parking location (address)
  • create an availability calendar for rentals
  • see all upcoming reservations your car has
  • see all past rentals your car has had

For a renter, you can:

  • browse availability of cars for your dates and price range on a map/list
  • rent a car
  • use your phone to unlock the car, which has keys in the glove box. Your phone itself cannot communicate to the car, but our servers can send/receive requests to an IoT device in the car (e.g. to unlock it, or lock it).
  • see all upcoming reservations
  • see all past trips you’ve been on

We expect to lay out rough data models and business logic to support the app. Prioritize design of the most complex parts. From there, we will explore some open-ended extensions to the product.

Note: Assume authentication is taken care of. Also, we do not expect designs for any hardware, or IoT components.

Feel free to ask questions, or state any assumptions!

What is the scale of the system?

  • # of car owners = 5 million
  • # of car renters = 10 million
  • # of rentals (varying length), weekly = 250k (5% of car owners)
  • 10x searches as the number of booked rentals (10% conversion)

这是一道典型的系统设计面试题,核心是设计一个支持车主发布车辆、租客检索与下单、以及车辆解锁 / 上锁联动的共享租车平台。题目重点不在前端页面,而在后端的数据模型、可用性与一致性设计:如何表示车辆、可用日历、预约单、历史行程,如何在高并发搜索和下单场景下避免重复预订,以及如何把同步的 IoT 控制请求安全地串到租车流程中。由于题目明确给出了用户规模、周租赁量和搜索量,回答时通常要先做容量预估,再围绕搜索、预约冲突处理、状态机和事件驱动的业务流程展开。

正文完
 0