Advertisement
Guest User

Testing

a guest
Oct 16th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. We'll scope the problem to handle only the following use cases
  2.  
  3. User enters a block of text and gets a randomly generated link
  4. Expiration
  5. Default setting does not expire
  6. Can optionally set a timed expiration
  7. User enters a paste's url and views the contents
  8. User is anonymous
  9. Service tracks analytics of pages
  10. Monthly visit stats
  11. Service deletes expired pastes
  12. Service has high availability
  13. Out of scope
  14.  
  15. User registers for an account
  16. User verifies email
  17. User logs into a registered account
  18. User edits the document
  19. User can set visibility
  20. User can set the shortlink
  21. Constraints and assumptions
  22.  
  23. State assumptions
  24.  
  25. Traffic is not evenly distributed
  26. Following a short link should be fast
  27. Pastes are text only
  28. Page view analytics do not need to be realtime
  29. 10 million users
  30. 10 million paste writes per month
  31. 100 million paste reads per month
  32. 10:1 read to write ratio
  33. Calculate usage
  34.  
  35. Clarify with your interviewer if you should run back-of-the-envelope usage calculations.
  36.  
  37. Size per paste
  38. 1 KB content per paste
  39. shortlink - 7 bytes
  40. expiration_length_in_minutes - 4 bytes
  41. created_at - 5 bytes
  42. paste_path - 255 bytes
  43. total = ~1.27 KB
  44. 12.7 GB of new paste content per month
  45. 1.27 KB per paste * 10 million pastes per month
  46. ~450 GB of new paste content in 3 years
  47. 360 million shortlinks in 3 years
  48. Assume most are new pastes instead of updates to existing ones
  49. 4 paste writes per second on average
  50. 40 read requests per second on average
  51. Handy conversion guide:
  52.  
  53. 2.5 million seconds per month
  54. 1 request per second = 2.5 million requests per month
  55. 40 requests per second = 100 million requests per month
  56. 400 requests per second = 1 billion requests per month
  57. Step 2: Create a high level design
  58.  
  59. Outline a high level design with all important components.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement