Design PasteBin

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