goodwish Sep 21st, 2019 (edited) 134 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- Design PasteBin.
- Step 1: Requirements clarifications
- 问问题, 确定 problem scope. E.g.
- Will paste bin contain photos and videos?
- Should Users optionally be able to pick a custom alias for their paste?
- Step 2: System interface definition
- 设计系统需要的 APIs,
- i.e. upload paste contents, return URL or paste key.
- addPaste(api_dev_key, paste_data, custom_url=None user_name=None, paste_name=None, expire_date=None)
- Step 3: 草纸 estimation.
- 每个 API 的响应时间,吞吐量,网络带宽,存储, archive and housekeeping..etc.
- Step 4: Defining data model
- user: user_id, name, email, last_login
- paste: ..
- Step 5: High-level design
- Draw a block diagram with 5-8 boxes representing the core components of the system.
- Step 6: Detailed design
- 根据面试官的反馈和引导, Dig deeper into two or three components.
- i.e. How to handle a write request? Key Generation Service.
- Scalability/ Non - Functional:
- scaling, partitioning, load balancing and caching.
- present different approaches, their pros and cons,
- and explain why we will prefer one approach on the other. there is no single answer.
- Step 7: Identifying and resolving bottlenecks.
- Is there any single point of failure in our system? What are we doing to mitigate it?
- Do we have enough replicas of the data?
- do we have enough copies of different services?
- How are we monitoring the performance of our service? alerts of failure or their performance degrades?
- 弹性. 自动重启, 自动修复, idempotency 提交消息的次数和顺序无关 - 数据失败, 消息数据再来一遍就好了.
- preparation and being organized during the interview are the keys to be successful in system design interviews.
RAW Paste Data