Skip to content

Instantly share code, notes, and snippets.

@ikouchiha47
Last active May 11, 2026 09:16
Show Gist options
  • Select an option

  • Save ikouchiha47/e0ccdd2c8d8167895f8989418640b86b to your computer and use it in GitHub Desktop.

Select an option

Save ikouchiha47/e0ccdd2c8d8167895f8989418640b86b to your computer and use it in GitHub Desktop.

Thinking Framework

  1. User Journey
  2. Systems Core Features (Functional Requirements)
  3. Qualities of System (Non Functional Requirements): a. Expected Load b. Load change over time c. R/W Data Access Patterns, based off 2. c. CAP tradeoffs, everytime new functional req. e. Fault Tolerance, Idempotency, Replication, Sharding
  4. Core Entities and Relationships (Rails ActiveRecord, nearest to uml)
  5. API or Interface
  6. High Level Design, to satisfy FR
  7. Deep dives, to satisy non-FR

Tips

General Tips:

  • Consider latency
  • Reduce cardinality
  • Always start from the simplest system, and then consider the non-FR at each component
  • Know some real life numbers by head

General Numbers:

  • 1K = 10 * 100 = 10^3 (ms)
  • 1M = 10 * 100K = 1K * 1K = 10^6 (us)
  • 1G/B = 10 * 100M = 1K * 1M = 10^9 (ns)
  • 1T = 10 * 100G/B = 1K * 1B = 10^12 (ps)
  • quadrillion = 10^15
  • quintillion = 10^18

Powers of 2 (every 10 bits ≈ 1000, since 2^10 = 1024 ≈ 10^3):

  • 2^10 ≈ thousand = 10^3
  • 2^20 ≈ million = 10^6
  • 2^30 ≈ billion = 10^9
  • 2^40 ≈ trillion = 10^12
  • 2^50 ≈ quadrillion = 10^15
  • 2^60 ≈ quintillion = 10^18
  • 2^64 ≈ 16 × 2^60 ≈ 16 quintillion

Formula:


2^P = 10^Q

P(i) = 10*X(i)
Q(i) = 3*Y(i)

X(i) = 0.3*Y(i)


Ex:

2^20
= 10^(0.3*20)
= 10^6


10^9
= 2^(9/0.3)
= 2^30

Metals:

  • CPU Cache: 1ns
  • L2 Cache: 4ns
  • RAM: 100ns
  • NvMe SSD: 100us
  • Network flatency (same region): 0.3ms - 1ms
  • Cross Region: 50ms - 150ms (100x slower than same)

Real life base metric:

  • Single server
  • App + DB
  • 5 ms app processing
  • 1 ms local DB query
  • 0.5 ms network overhead

Total ≈ 6–10 ms P50

Mental Math

QPS -> Latency

Formula: Rps = Cores / Each action time

Example:

1 core cpu, 1 request takes 100ms

Rps = 1 / 0.1s = 10 rps


Bandwith Estimation:

Formula: Bandwith = Payload Size * QPS

1KB payload, 1K rps/qps, Bandwith = 1MB/s


Queue Throughputs

Formula is Little's Law

L = Rps * Avg Latency, where is total concurrent supported

1K Rps, 200ms Latency, L = 1K * 0.2s = 200 concurrent capacity

If you want to process 100K Rps, avg latency 2ms, needs 200cpu cores.

Examples

Display the source blob
Display the rendered blob
Raw
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1143.0272208969645 441.1375543564766" ><!-- svg-source:excalidraw --><metadata><!-- payload-type:application/vnd.excalidraw+json --><!-- payload-version:2 --></metadata><defs><style class="style-fonts">|
|@font-face { font-family: Comic Shanns; src: url(data:font/woff2;base64,d09GMgABAAAAABnkAAsAAAAALkAAABmVAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAABmAAgRwRCArBFLYlC1oAATYCJANcBCAFlRgHIBu2JzOjtpPVoosoYpf9HxLoIap5im8K4nY2tq7YujI9CQO6f2CZ7WhpYq8+lIMJzqif3BQ5KHykpPe7R2jsk9zhaU7/yd1FznNRkhCBhABBQwkEKAkJSSiWYGFYqVCVzauK1GSiQjur/a0+saowb7vt93/nbOBi1H9TDKrEKQxlId0yoKTXt9PnxbVAAAB8/nm5Z+e9/S2LAs44oAQTKLXIEm77NwD+T2f2fzvTasT2GmQIoe+9tIdgWWEor2isdt0mOcMiwMB1wH+/wAYEWLzuR3NvjW19fXug7Rk7z87YJfgQOgLO/vj/rfVmp0PcUZEEjoRJVKTKqdyprpo3byo9/3P1+4TdgYEAkDC8gArIA6FctZELDt3KXUl4/ArjUEaYFUquic3JWVPdwcXsDAdffajq3FeubskbGSyWgnOc1a1Hv2/McYgcQYIEsfOvrwDgdcJeJIDe2woqoPpwT+ATVO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uqhy0MjGNHGMHPE0wxKasizqAMDXRm6bRgABcSnN8ZlCo4yKTdajuU/PNjWjjZpSrRY67cq8RXcERDnP08lRdFrAycxws5/4DPEnHBo10R2yGoad6vgQbvhCMnNoXhHVdtKj67NIrRw0xmd/UgNipnNpahzv9eBI0IpFaF7JIxJhO6Kbtgh+cILibltwEGOXFgBTWFICOaY1iNsvXq5zYSPkxL/fJ0tXWmx4XJcqBFwWPvP8lpNjzyBRBxzCSR/DmsXsupDoI+hmPiTXG+0+AGGE+GwTLbjLNL1s4uhGh5rQbYXwz9keg8+QrwjpcDKStgpRhY3qpC9ifB42zmYp/BKXihHwDIc4JRsiKfMiXrAixoBCU+ELHIL5HRO9cAtsrNrxxfrG0sdJR5+g1fvqDQlbUoO0h2RiM0wQ0VusDmUDSMTJRMF9rCL8BV7jKydIQ/0AApcJm+dHxgEW+9j1qnJnULKHn+nFuZgNRyhrp9Te6DG7YaoB2zdjpOIkLitdg6Z9GkoYz6iRTcmYbNToHZ1SqouJGXnh0lkSmI5CYRCPymTuCLrITEOc6AyA7LadDdgGYfN5sQXlqVBhykC5EjrQsN1awzCowTyvoVjVEjHD9sOyGVM7lAzDT7GFCYKtR7GYRp9TrB6mENr8ZbhKHQMwlGaZnJRqC3wyNCb36/fAwAAAA==); }</style></defs><rect x="0" y="0" width="1143.0272208969645" height="441.1375543564766" fill="#ffffff"></rect><g stroke-linecap="round" transform="translate(34.14453125 306.0046844482422) rotate(0 76.98828125 59.001953125)"><path d="M29.5 0 C66.08 0.36, 97.45 0.71, 124.48 0 C146.31 2.68, 153.95 8.28, 153.98 29.5 C156.86 44.82, 153.91 60.64, 153.98 88.5 C153.03 106.37, 146.17 116.26, 124.48 118 C103.77 119.96, 81.97 117.04, 29.5 118 C10.58 118.19, -0.16 109.2, 0 88.5 C3.14 74.7, -2.73 64.24, 0 29.5 C1.79 12.99, 12.85 1.27, 29.5 0" stroke="none" stroke-width="0" fill="#ffffff"></path><path d="M29.5 0 C65.21 1.29, 98.03 -0.37, 124.48 0 M29.5 0 C62 0.77, 96.04 0.62, 124.48 0 M124.48 0 C143.97 1.38, 152.1 8.45, 153.98 29.5 M124.48 0 C142.15 -0.11, 155.11 10.62, 153.98 29.5 M153.98 29.5 C154.45 49.01, 152.81 71.24, 153.98 88.5 M153.98 29.5 C153.41 45.85, 154.83 62.89, 153.98 88.5 M153.98 88.5 C153.81 109.75, 144.19 118.43, 124.48 118 M153.98 88.5 C154.88 108.08, 146.02 115.84, 124.48 118 M124.48 118 C94.63 119.31, 62.95 119.44, 29.5 118 M124.48 118 C93.41 118.08, 64.4 117.05, 29.5 118 M29.5 118 C10.88 117.45, -1.45 106.42, 0 88.5 M29.5 118 C9.4 119.25, -1.29 107.51, 0 88.5 M0 88.5 C1.7 69.52, -1.39 54.68, 0 29.5 M0 88.5 C-0.4 75.95, -0.17 63.88, 0 29.5 M0 29.5 C-0.26 7.97, 8.11 -1.41, 29.5 0 M0 29.5 C-0.18 7.74, 10.19 -1.58, 29.5 0" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(45.1328125 352.5066375732422) rotate(0 66 12.5)"><text x="66" y="17.5" font-family="Comic Shanns, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">Requirements</text></g><g stroke-linecap="round" transform="translate(10 277.6687469482422) rotate(0 24.908203125 24.908203125)"><path d="M10.26 4.94 C10.26 4.94, 10.26 4.94, 10.26 4.94 M10.26 4.94 C10.26 4.94, 10.26 4.94, 10.26 4.94 M1.47 21.15 C5.86 15.81, 9.62 9.86, 17.21 3.04 M1.47 21.15 C5.17 16.72, 8.97 12.79, 17.21 3.04 M1.86 26.79 C9.42 18.61, 17.13 10.51, 24.17 1.13 M1.86 26.79 C8.47 18.85, 15.71 11.25, 24.17 1.13 M2.26 32.44 C10.08 23.58, 18.32 12.77, 29.16 1.49 M2.26 32.44 C13.36 20.24, 23.48 8.31, 29.16 1.49 M3.96 36.57 C12.09 26.81, 21.2 17.26, 32.83 3.36 M3.96 36.57 C12.86 27.05, 21.58 16.96, 32.83 3.36 M6.33 39.95 C13.45 32.65, 18.92 24.66, 37.16 4.48 M6.33 39.95 C16.29 28.47, 26.57 16.53, 37.16 4.48 M9.35 42.57 C14.96 35.85, 21.27 27.57, 40.84 6.35 M9.35 42.57 C22.16 28.61, 34.24 13.9, 40.84 6.35 M12.36 45.2 C21.11 34.26, 32.34 22.13, 43.85 8.97 M12.36 45.2 C23.1 32.91, 33.68 21.11, 43.85 8.97 M15.38 47.82 C24.97 37.08, 35.31 24.95, 45.56 13.11 M15.38 47.82 C21.24 40.36, 27.15 33.85, 45.56 13.11 M20.37 48.18 C27.1 41.83, 33.85 33.69, 47.27 17.24 M20.37 48.18 C26.38 41.3, 32.52 34.25, 47.27 17.24 M25.36 48.54 C30.92 41.72, 35.03 36.49, 49.63 20.62 M25.36 48.54 C30.92 42.68, 35.67 37.02, 49.63 20.62 M29.69 49.66 C35.17 42.6, 41.56 35.41, 49.37 27.02 M29.69 49.66 C37.7 41.04, 45.3 31.59, 49.37 27.02 M40.58 43.23 C42.16 41.78, 43.79 39.66, 46.48 36.43 M40.58 43.23 C42.04 41.39, 43.39 39.59, 46.48 36.43 M14.39 47.46 C14.39 47.46, 14.39 47.46, 14.39 47.46 M14.39 47.46 C14.39 47.46, 14.39 47.46, 14.39 47.46 M21.54 48.38 C15.05 43.29, 9.77 37.21, 1.92 31.32 M21.54 48.38 C16.86 43.99, 11.72 40.06, 1.92 31.32 M27.94 48.64 C18.97 41.16, 9.61 33.29, 1.53 25.68 M27.94 48.64 C20.97 42.57, 14.05 37.03, 1.53 25.68 M32.83 47.59 C23.85 39.87, 13.78 31.85, 1.13 20.04 M32.83 47.59 C24.17 39.82, 15.68 31.89, 1.13 20.04 M36.21 45.23 C24.34 34.49, 12.08 25.94, 3 16.36 M36.21 45.23 C24.19 34.51, 11.81 24.16, 3 16.36 M39.59 42.87 C27.27 32.58, 13.96 20.36, 4.87 12.69 M39.59 42.87 C29.1 33.87, 19.91 25.5, 4.87 12.69 M42.97 40.5 C33.08 30.66, 23 23.03, 7.49 9.67 M42.97 40.5 C34.05 33.12, 25.54 25.3, 7.49 9.67 M45.59 37.49 C31.1 25.17, 18.73 13.24, 9.36 5.99 M45.59 37.49 C31.69 25.34, 16.78 12.57, 9.36 5.99 M46.7 33.15 C38.26 25.11, 26.98 16.02, 12.74 3.63 M46.7 33.15 C35.52 23.78, 24.79 13.92, 12.74 3.63 M47.82 28.82 C35.27 17.66, 23.1 6.95, 17.63 2.58 M47.82 28.82 C36.2 18.52, 24.68 9.11, 17.63 2.58 M48.93 24.49 C41.07 18.15, 35 11.62, 22.52 1.53 M48.93 24.49 C42.9 20.06, 37.94 15.12, 22.52 1.53 M49.29 19.51 C40.01 11.31, 31.38 5.37, 27.41 0.48 M49.29 19.51 C44.75 15.48, 40.68 11.9, 27.41 0.48 M44.37 9.93 C42.83 8.06, 40.44 6.65, 39.09 5.33 M44.37 9.93 C43.15 8.59, 41.58 7.48, 39.09 5.33" stroke="#299a8d" stroke-width="0.5" fill="none"></path><path d="M26.93 0.27 C32.06 0.39, 38.51 3.46, 42.36 7.09 C46.22 10.72, 49.59 16.79, 50.05 22.04 C50.5 27.29, 48.18 34.05, 45.1 38.57 C42.01 43.09, 36.61 47.62, 31.55 49.15 C26.5 50.69, 19.66 50.05, 14.76 47.79 C9.87 45.53, 4.48 40.49, 2.18 35.61 C-0.11 30.73, -0.36 23.62, 0.98 18.52 C2.32 13.42, 5.72 8.01, 10.22 4.99 C14.71 1.97, 24.82 1.14, 27.97 0.39 C31.13 -0.36, 29.25 0.04, 29.16 0.47 M21.91 0.34 C26.97 -0.69, 34.22 1.23, 38.79 4 C43.36 6.77, 47.81 11.83, 49.35 16.94 C50.89 22.06, 50.13 29.59, 48.03 34.7 C45.94 39.81, 41.55 45.13, 36.79 47.59 C32.03 50.05, 24.74 50.7, 19.49 49.44 C14.23 48.18, 8.6 44.43, 5.26 40.04 C1.91 35.65, -0.75 28.36, -0.58 23.09 C-0.41 17.82, 2.41 12.29, 6.26 8.43 C10.11 4.57, 19.86 1.26, 22.54 -0.07 C25.23 -1.4, 22.5 0.12, 22.35 0.47" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(29.295443788140545 289.96419073638276) rotate(0 5.5 12.5)"><text x="5.5" y="17.5" font-family="Comic Shanns, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">1</text></g><g stroke-linecap="round" transform="translate(222.1796875 306.8640594482422) rotate(0 76.98828125 59.001953125)"><path d="M29.5 0 C64.52 -0.18, 98.62 3.89, 124.48 0 C142.67 0.2, 151.53 8.89, 153.98 29.5 C151.72 47.55, 151.8 59.27, 153.98 88.5 C157.25 107.59, 144.49 118.75, 124.48 118 C93.04 119.99, 65.15 122.07, 29.5 118 C9.69 115.71, 3.07 109.96, 0 88.5 C-3.95 65.53, 0.39 44.49, 0 29.5 C1.39 7.42, 9.88 1.07, 29.5 0" stroke="none" stroke-width="0" fill="#ffffff"></path><path d="M29.5 0 C61.28 1.33, 92.44 0.37, 124.48 0 M29.5 0 C63.69 0.61, 100.1 1, 124.48 0 M124.48 0 C144.98 -1, 153.85 10.6, 153.98 29.5 M124.48 0 C143.39 -1, 155.6 9.54, 153.98 29.5 M153.98 29.5 C152.83 50.73, 153.03 69.29, 153.98 88.5 M153.98 29.5 C154.39 51.83, 154.81 73.29, 153.98 88.5 M153.98 88.5 C154.53 108.27, 145.73 119.28, 124.48 118 M153.98 88.5 C154.61 108.98, 144.92 118.48, 124.48 118 M124.48 118 C105.17 119.17, 82.38 118.48, 29.5 118 M124.48 118 C98.44 117.71, 72.22 116.89, 29.5 118 M29.5 118 C9.74 116.22, 0.92 109.34, 0 88.5 M29.5 118 C8.05 115.8, 1.19 106.04, 0 88.5 M0 88.5 C-1.02 68.27, -0.7 47.37, 0 29.5 M0 88.5 C0.43 75.4, 0.66 63.43, 0 29.5 M0 29.5 C1.05 9.37, 10.46 1.73, 29.5 0 M0 29.5 C0.57 10.48, 10.63 1.38, 29.5 0" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(227.66796875 353.3660125732422) rotate(0 71.5 12.5)"><text x="71.5" y="17.5" font-family="Comic Shanns, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">Core Entities</text></g><g stroke-linecap="round" transform="translate(414.86798095703125 310.1476287841797) rotate(0 76.98828125 59.001953125)"><path d="M29.5 0 C54.1 -1.29, 79.2 -2.44, 124.48 0 C142.35 2.03, 152.23 6.98, 153.98 29.5 C156.43 52.02, 153.51 76.44, 153.98 88.5 C154.16 108.01, 145.17 115.54, 124.48 118 C91.9 117.41, 62.68 121.49, 29.5 118 C12.99 121.02, 1.27 105.11, 0 88.5 C1.01 68.54, -0.33 54.47, 0 29.5 C-1.04 10.53, 7.98 1.78, 29.5 0" stroke="none" stroke-width="0" fill="#ffffff"></path><path d="M29.5 0 C63.07 -1.79, 92.49 -1.65, 124.48 0 M29.5 0 C57.95 -0.83, 85.5 0.06, 124.48 0 M124.48 0 C143.49 -0.87, 155.39 9.58, 153.98 29.5 M124.48 0 C145.03 0.11, 152.15 8.48, 153.98 29.5 M153.98 29.5 C155.27 50.93, 154.12 73.04, 153.98 88.5 M153.98 29.5 C154.73 47.02, 155.25 65.08, 153.98 88.5 M153.98 88.5 C154.53 108.88, 144.82 118.42, 124.48 118 M153.98 88.5 C152.09 106.66, 142.77 119.62, 124.48 118 M124.48 118 C87.21 117.05, 49.3 118.12, 29.5 118 M124.48 118 C90.79 116.84, 57.66 118.32, 29.5 118 M29.5 118 C8.28 116.09, 1.04 106.32, 0 88.5 M29.5 118 C10.9 119.45, -0.29 107.42, 0 88.5 M0 88.5 C-1.77 68.48, -1.31 51.74, 0 29.5 M0 88.5 C0.43 75.93, 0.22 64.69, 0 29.5 M0 29.5 C0.5 10.39, 10.52 1.2, 29.5 0 M0 29.5 C1.71 9.82, 8.84 -0.35, 29.5 0" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(442.35626220703125 344.1495819091797) rotate(0 49.5 25)"><text x="49.5" y="17.5" font-family="Comic Shanns, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">API or</text><text x="49.5" y="42.5" font-family="Comic Shanns, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">Interface</text></g><g stroke-linecap="round" transform="translate(781.71484375 311.1960906982422) rotate(0 76.98828125 59.001953125)"><path d="M29.5 0 C56.73 2.47, 85.81 -2.41, 124.48 0 C147.43 -2.77, 154.23 13.11, 153.98 29.5 C154.26 46.09, 155.11 60.54, 153.98 88.5 C155.47 106.8, 147.72 117.86, 124.48 118 C105.18 121.87, 80.84 115.79, 29.5 118 C9.74 119.29, 1.75 109.56, 0 88.5 C-1.05 75.46, -1.87 62.8, 0 29.5 C-1.01 9.81, 6.32 1.67, 29.5 0" stroke="none" stroke-width="0" fill="#ffffff"></path><path d="M29.5 0 C48.97 1.81, 69.33 1.66, 124.48 0 M29.5 0 C52.92 -0.8, 77.7 -0.49, 124.48 0 M124.48 0 C144.92 0.09, 152.39 8.66, 153.98 29.5 M124.48 0 C145.58 -1.12, 153.78 11.65, 153.98 29.5 M153.98 29.5 C154.02 48.99, 152.22 65.76, 153.98 88.5 M153.98 29.5 C154.72 47.85, 154.78 65.69, 153.98 88.5 M153.98 88.5 C152.34 106.86, 142.95 119.41, 124.48 118 M153.98 88.5 C155.97 107.4, 145.35 117.36, 124.48 118 M124.48 118 C103.94 116.7, 80.66 117.73, 29.5 118 M124.48 118 C103.67 117.6, 84.93 117.63, 29.5 118 M29.5 118 C10.76 119.26, -0.25 107.52, 0 88.5 M29.5 118 C10.07 117.63, -0.29 106.02, 0 88.5 M0 88.5 C-1.4 76.19, -0.96 64.31, 0 29.5 M0 88.5 C0.06 72.46, 0.16 56.47, 0 29.5 M0 29.5 C1.49 9.82, 8.97 -0.31, 29.5 0 M0 29.5 C-0.59 8.54, 11.85 -0.94, 29.5 0" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(803.703125 345.1980438232422) rotate(0 55 25)"><text x="55" y="17.5" font-family="Comic Shanns, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">High-level</text><text x="55" y="42.5" font-family="Comic Shanns, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">Design</text></g><g stroke-linecap="round" transform="translate(757.45703125 285.4460906982422) rotate(0 24.908203125 24.908203125)"><path d="M8.36 5.95 C8.36 5.95, 8.36 5.95, 8.36 5.95 M8.36 5.95 C8.36 5.95, 8.36 5.95, 8.36 5.95 M0.23 21.4 C5.92 16.24, 10.43 9.18, 15.98 3.29 M0.23 21.4 C5.17 16.08, 9.24 10.79, 15.98 3.29 M1.94 25.53 C7.44 17.86, 14.77 11.06, 23.59 0.63 M1.94 25.53 C8.52 18.01, 15.15 10.23, 23.59 0.63 M2.99 30.42 C10.9 21.94, 19.43 10.89, 27.92 1.74 M2.99 30.42 C12.94 19.44, 21.7 8.2, 27.92 1.74 M4.04 35.31 C12.76 24.38, 23.19 13.19, 32.25 2.86 M4.04 35.31 C12.99 24.87, 21.66 14.74, 32.25 2.86 M5.74 39.44 C11.39 31.69, 19.33 25.16, 35.92 4.73 M5.74 39.44 C16.61 26.75, 27.42 14.75, 35.92 4.73 M8.76 42.07 C16.46 33.34, 22.74 27.42, 40.25 5.84 M8.76 42.07 C17.57 32.43, 25.95 22, 40.25 5.84 M11.78 44.69 C23.14 31.6, 33.87 18.93, 42.62 9.22 M11.78 44.69 C20.16 34.94, 29.06 24.31, 42.62 9.22 M15.46 46.56 C26.27 34.88, 34.4 23.43, 44.98 12.6 M15.46 46.56 C26.47 33.95, 36.15 22.27, 44.98 12.6 M19.13 48.43 C29.69 35.52, 40.11 23.06, 47.34 15.98 M19.13 48.43 C28.89 37.39, 38.43 26.46, 47.34 15.98 M24.12 48.79 C33.14 38.05, 42.31 29.27, 49.71 19.36 M24.12 48.79 C30.14 41.58, 36.15 34.28, 49.71 19.36 M29.76 48.4 C35.86 41.54, 40.52 34.49, 49.44 25.76 M29.76 48.4 C36.27 40.06, 43.87 33.03, 49.44 25.76 M38.69 44.23 C42.32 40.11, 44.72 36.2, 47.87 33.66 M38.69 44.23 C41.68 40.91, 45.03 37.13, 47.87 33.66 M3.93 38.16 C3.93 38.16, 3.93 38.16, 3.93 38.16 M3.93 38.16 C3.93 38.16, 3.93 38.16, 3.93 38.16 M21.65 48.26 C15.1 43.23, 7.7 37.35, 2.03 31.2 M21.65 48.26 C14.22 42.03, 7.24 36.13, 2.03 31.2 M27.29 47.86 C18.41 40.89, 10.75 33.07, 0.88 24.9 M27.29 47.86 C19.54 40.35, 11.51 33.9, 0.88 24.9 M33.69 48.13 C21.26 38.76, 11.03 27.9, 1.24 19.91 M33.69 48.13 C21.73 37.71, 10.12 26.84, 1.24 19.91 M37.07 45.76 C27.1 37.18, 18.33 29.98, 3.11 16.24 M37.07 45.76 C28.98 38.31, 20.07 30.47, 3.11 16.24 M39.69 42.74 C31.16 35.29, 20.47 25.87, 4.98 12.56 M39.69 42.74 C30.52 34.98, 20.86 26.14, 4.98 12.56 M43.07 40.38 C29.27 27.1, 15.21 14.72, 6.85 8.89 M43.07 40.38 C30.35 29.62, 18 18.53, 6.85 8.89 M45.7 37.36 C35.87 29.19, 28.08 22.21, 9.47 5.87 M45.7 37.36 C31.72 24.83, 17.79 12.46, 9.47 5.87 M47.57 33.69 C36.8 23.8, 28.13 15.4, 13.61 4.16 M47.57 33.69 C35.05 23.02, 22.3 12.12, 13.61 4.16 M47.93 28.7 C39.8 20.69, 31.02 15.07, 17.74 2.46 M47.93 28.7 C39.92 21.97, 31.75 14.4, 17.74 2.46 M49.04 24.37 C41.76 19.37, 34.7 11.96, 21.87 0.75 M49.04 24.37 C39.99 16.3, 30.79 8.16, 21.87 0.75 M49.4 19.38 C43.86 15.02, 39.68 11.26, 29.03 1.67 M49.4 19.38 C43.87 14.53, 38.84 9.6, 29.03 1.67 M42.22 7.83 C41.5 7.12, 40.51 6.49, 39.2 5.21 M42.22 7.83 C41.1 6.81, 39.91 5.82, 39.2 5.21" stroke="#299a8d" stroke-width="0.5" fill="none"></path><path d="M24.28 0.36 C29.3 0.01, 36.36 2.52, 40.54 5.76 C44.72 9, 48.41 14.52, 49.39 19.78 C50.36 25.04, 49.02 32.59, 46.39 37.32 C43.75 42.04, 38.44 46.27, 33.57 48.13 C28.7 49.99, 22.16 50.17, 17.17 48.46 C12.18 46.76, 6.46 42.42, 3.65 37.91 C0.84 33.4, -0.45 26.67, 0.29 21.39 C1.04 16.11, 3.95 9.73, 8.12 6.23 C12.28 2.73, 22.26 1.33, 25.3 0.4 C28.34 -0.53, 26.33 0.28, 26.34 0.66 M25.76 0.56 C31.05 0.55, 38.49 2.92, 42.54 6.43 C46.58 9.95, 49.57 16.43, 50.02 21.66 C50.48 26.88, 48.25 33.23, 45.26 37.81 C42.27 42.39, 37.14 47.5, 32.06 49.13 C26.97 50.77, 19.66 49.89, 14.76 47.62 C9.87 45.36, 4.98 40.2, 2.68 35.56 C0.39 30.91, -0.13 24.96, 0.98 19.75 C2.09 14.54, 5.06 7.7, 9.33 4.3 C13.6 0.9, 23.73 -0.11, 26.59 -0.66 C29.46 -1.21, 26.63 0.51, 26.53 1" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(776.7524750381406 297.74153448638276) rotate(0 5.5 12.5)"><text x="5.5" y="17.5" font-family="Comic Shanns, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">5</text></g><g stroke-linecap="round" transform="translate(979.0506583969645 313.1336481064766) rotate(0 76.98828125 59.001953125)"><path d="M29.5 0 C50.09 -1.21, 72.59 -1.37, 124.48 0 C143.99 1.03, 151.51 11.33, 153.98 29.5 C152.74 48.02, 156.82 63.57, 153.98 88.5 C156.99 109.44, 141.08 117.91, 124.48 118 C90.19 118.71, 61.8 117.63, 29.5 118 C10.53 116.15, 1.78 107.16, 0 88.5 C-2.29 68.39, 2.7 50.53, 0 29.5 C-1.71 13.21, 10.58 2.2, 29.5 0" stroke="none" stroke-width="0" fill="#ffffff"></path><path d="M29.5 0 C56.5 1.72, 84.98 1.08, 124.48 0 M29.5 0 C59.06 0.07, 87.29 1.35, 124.48 0 M124.48 0 C144.19 0.43, 154.77 9.76, 153.98 29.5 M124.48 0 C146.02 -2.16, 154.61 9.95, 153.98 29.5 M153.98 29.5 C155.06 52.57, 154.77 72.65, 153.98 88.5 M153.98 29.5 C154.49 43, 154.15 56.89, 153.98 88.5 M153.98 88.5 C152.53 106.42, 143.76 119.09, 124.48 118 M153.98 88.5 C152.69 107.51, 144.04 115.95, 124.48 118 M124.48 118 C89.71 118.3, 56.91 118.19, 29.5 118 M124.48 118 C90.1 117.53, 55.39 116.76, 29.5 118 M29.5 118 C8.11 116.6, -0.15 106.35, 0 88.5 M29.5 118 C10.19 116.42, 1.21 107.63, 0 88.5 M0 88.5 C0.05 69.65, 0.69 50.91, 0 29.5 M0 88.5 C0 70.28, 1.13 52.77, 0 29.5 M0 29.5 C0.11 8.48, 9.31 -1, 29.5 0 M0 29.5 C1.29 8.72, 8.01 2.1, 29.5 0" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(1001.0389396469645 359.6356012314766) rotate(0 55 12.5)"><text x="55" y="17.5" font-family="Comic Shanns, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">Deep Dives</text></g><g stroke-linecap="round" transform="translate(953.11328125 287.1921844482422) rotate(0 24.908203125 24.908203125)"><path d="M5.63 8.87 C5.63 8.87, 5.63 8.87, 5.63 8.87 M5.63 8.87 C5.63 8.87, 5.63 8.87, 5.63 8.87 M2.74 18.28 C6.16 13.93, 9.67 9.26, 16.52 2.43 M2.74 18.28 C5.75 14.81, 9.2 10.42, 16.52 2.43 M0.51 26.94 C9.46 16.95, 17.93 7.16, 22.82 1.28 M0.51 26.94 C6.12 21.02, 10.47 15.53, 22.82 1.28 M2.22 31.08 C11.16 20.09, 19.5 11.27, 27.15 2.4 M2.22 31.08 C10.86 21.31, 19.4 11.26, 27.15 2.4 M3.92 35.21 C10.85 26.21, 18.33 18.19, 32.13 2.76 M3.92 35.21 C10.15 28.26, 17.03 20.58, 32.13 2.76 M5.63 39.35 C17.65 25.29, 30.98 10.27, 37.12 3.12 M5.63 39.35 C12.23 31.24, 20.24 22.77, 37.12 3.12 M7.99 42.72 C20.18 29.37, 30.83 16.23, 40.14 5.74 M7.99 42.72 C15.85 33.2, 24 24.52, 40.14 5.74 M11.67 44.59 C20.34 34.76, 27.34 26.53, 42.5 9.12 M11.67 44.59 C22 31.89, 32.54 20.45, 42.5 9.12 M15.34 46.46 C24.26 34.17, 35.06 24.77, 44.87 12.5 M15.34 46.46 C25.84 33.94, 36.46 22.51, 44.87 12.5 M19.02 48.33 C30.77 35.09, 42.74 22.39, 47.89 15.13 M19.02 48.33 C26.73 39.45, 35.37 29.34, 47.89 15.13 M23.35 49.45 C31.51 39.4, 39.43 30.14, 48.28 20.77 M23.35 49.45 C31 40.06, 38.61 31.47, 48.28 20.77 M29.65 48.3 C34 42.96, 41.03 36.9, 48.67 26.41 M29.65 48.3 C33.91 42.69, 38.31 38.09, 48.67 26.41 M35.95 47.15 C40.33 43.16, 43.44 38.63, 48.41 32.81 M35.95 47.15 C38.56 43.4, 42.32 39.78, 48.41 32.81 M6.41 41.4 C6.41 41.4, 6.41 41.4, 6.41 41.4 M6.41 41.4 C6.41 41.4, 6.41 41.4, 6.41 41.4 M21.87 49.54 C16.84 44.83, 12.33 40.51, 3 33.13 M21.87 49.54 C15.77 44.03, 9.29 38.86, 3 33.13 M26.75 48.48 C17.87 42.17, 10.95 35.34, 0.34 25.52 M26.75 48.48 C19.86 42.27, 12.09 35.82, 0.34 25.52 M31.64 47.43 C21.47 39.14, 10.2 29.35, 1.45 21.19 M31.64 47.43 C21.9 39.15, 12.99 30.84, 1.45 21.19 M36.53 46.38 C29.88 40.49, 22.24 34.27, 3.32 17.52 M36.53 46.38 C25.45 36.24, 13.23 26.3, 3.32 17.52 M39.91 44.02 C30.14 35.83, 18.68 26.91, 4.44 13.19 M39.91 44.02 C31.86 37.78, 24.12 30.71, 4.44 13.19 M42.53 41 C28.44 28.63, 13.94 16.18, 5.55 8.85 M42.53 41 C27.59 28.26, 13.32 15.88, 5.55 8.85 M44.4 37.33 C34.13 29.82, 24.25 20.25, 8.93 6.49 M44.4 37.33 C35.35 30.07, 26.89 22.44, 8.93 6.49 M47.03 34.31 C38.14 25.48, 28.47 17.15, 13.07 4.79 M47.03 34.31 C39.63 27.77, 33.34 22.02, 13.07 4.79 M48.9 30.63 C42.24 25.29, 34.33 17.45, 16.44 2.42 M48.9 30.63 C41.78 23.37, 33.32 17.4, 16.44 2.42 M48.5 24.99 C41.07 18.9, 33.31 11.14, 19.82 0.06 M48.5 24.99 C37.6 15.22, 26.86 5.79, 19.82 0.06 M48.11 19.35 C39.72 12.61, 30.96 4.79, 26.98 0.98 M48.11 19.35 C43.59 15.25, 39.22 11.86, 26.98 0.98 M43.94 10.42 C41.95 8.87, 40.22 6.76, 34.88 2.55 M43.94 10.42 C42.04 8.35, 39.42 6.85, 34.88 2.55" stroke="#299a8d" stroke-width="0.5" fill="none"></path><path d="M19.75 0.45 C24.77 -0.91, 32.49 0.46, 37.23 3.06 C41.98 5.65, 46.33 10.99, 48.21 16.02 C50.09 21.06, 50.29 28.22, 48.49 33.27 C46.69 38.32, 41.96 43.53, 37.41 46.31 C32.86 49.09, 26.35 50.73, 21.2 49.93 C16.06 49.13, 10.04 45.55, 6.54 41.51 C3.04 37.47, 0.35 31.11, 0.18 25.68 C0.02 20.25, 2.12 13.23, 5.55 8.95 C8.98 4.67, 17.93 1.31, 20.78 -0.01 C23.63 -1.32, 22.55 0.57, 22.64 1.07 M23.03 0.47 C28.09 -0.13, 34.8 1.59, 39.13 4.54 C43.47 7.5, 47.63 12.93, 49.04 18.22 C50.46 23.51, 50.07 31.48, 47.64 36.27 C45.21 41.06, 39.32 44.97, 34.45 46.95 C29.58 48.93, 23.4 49.43, 18.43 48.16 C13.45 46.88, 7.67 43.66, 4.6 39.31 C1.54 34.96, -0.47 27.46, 0.04 22.06 C0.56 16.65, 3.85 10.65, 7.69 6.87 C11.52 3.08, 20.6 0.5, 23.08 -0.64 C25.56 -1.78, 22.53 -0.39, 22.56 0.03" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(972.4087250381406 299.48762823638276) rotate(0 5.5 12.5)"><text x="5.5" y="17.5" font-family="Comic Shanns, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">6</text></g><g stroke-linecap="round"><g transform="translate(379.72413155721074 370.55228502500506) rotate(0 16.828266918803536 0.27745791887764426)"><path d="M0.34 -0.27 C6.02 -0.05, 28.06 0.83, 33.61 0.99 M-0.15 0.79 C5.49 0.88, 27.58 0.16, 33.16 0.25" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(379.72413155721074 370.55228502500506) rotate(0 16.828266918803536 0.27745791887764426)"><path d="M17.4 6.18 C20.49 4.75, 25.03 3.53, 33.16 0.25 M17.4 6.18 C22.8 3.88, 27.63 2.39, 33.16 0.25" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(379.72413155721074 370.55228502500506) rotate(0 16.828266918803536 0.27745791887764426)"><path d="M17.28 -5.33 C20.35 -4.22, 24.93 -2.9, 33.16 0.25 M17.28 -5.33 C22.74 -3.93, 27.61 -1.72, 33.16 0.25" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g></g><mask></mask><g stroke-linecap="round"><g transform="translate(940.9820816768297 372.4030752294308) rotate(0 17.193696349445304 -0.29218180068869515)"><path d="M-0.05 0.43 C5.63 0.4, 28.63 -0.29, 34.4 -0.47 M-0.73 0.18 C4.84 0, 28.13 -1.34, 33.98 -1.37" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(940.9820816768297 372.4030752294308) rotate(0 17.193696349445304 -0.29218180068869515)"><path d="M18.03 5.07 C24.5 2.77, 29.79 0.75, 33.98 -1.37 M18.03 5.07 C22.85 3.26, 27.79 1.6, 33.98 -1.37" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(940.9820816768297 372.4030752294308) rotate(0 17.193696349445304 -0.29218180068869515)"><path d="M17.62 -6.69 C24.21 -4.73, 29.64 -2.49, 33.98 -1.37 M17.62 -6.69 C22.61 -5.01, 27.67 -3.19, 33.98 -1.37" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g></g><mask></mask><g stroke-linecap="round"><g transform="translate(827.2904504244825 293.9539031982422) rotate(0 -345.1777648700922 -52.38514709472656)"><path d="M0.03 0.26 C-62.89 -17.37, -262.74 -104.52, -377.64 -104.82 C-492.54 -105.12, -637.31 -18.95, -689.38 -1.54 M-1.41 -0.65 C-64.44 -18.16, -263.64 -103.28, -378.34 -103.3 C-493.04 -103.33, -637.75 -18.16, -689.63 -0.81" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(827.2904504244825 293.9539031982422) rotate(0 -345.1777648700922 -52.38514709472656)"><path d="M-671.5 -18.03 C-676.22 -12.22, -682.02 -6.35, -689.63 -0.81 M-671.5 -18.03 C-674.39 -13.84, -678.64 -10.58, -689.63 -0.81" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(827.2904504244825 293.9539031982422) rotate(0 -345.1777648700922 -52.38514709472656)"><path d="M-664.67 -2.35 C-671.51 -1.11, -679.29 0.18, -689.63 -0.81 M-664.67 -2.35 C-669.01 -1.39, -674.67 -1.35, -689.63 -0.81" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g></g><mask></mask><g stroke-linecap="round"><g transform="translate(1059.7809723462392 301.4456522054563) rotate(0 -504.15041998894753 -118.15329943036488)"><path d="M0.47 -0.05 C-99.17 -39.66, -429.77 -232.73, -597.85 -237.44 C-765.92 -242.14, -939.72 -63.26, -1007.97 -28.29 M-0.74 -1.12 C-100.46 -40.65, -430.31 -232.19, -598.28 -236.49 C-766.25 -240.79, -940.51 -61.4, -1008.56 -26.94" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(1059.7809723462392 301.4456522054563) rotate(0 -504.15041998894753 -118.15329943036488)"><path d="M-994.29 -47.47 C-998.64 -39.57, -1004.76 -34.44, -1008.56 -26.94 M-994.29 -47.47 C-998.2 -40.76, -1002.49 -34.65, -1008.56 -26.94" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(1059.7809723462392 301.4456522054563) rotate(0 -504.15041998894753 -118.15329943036488)"><path d="M-984.43 -33.49 C-991.8 -29.78, -1000.9 -28.88, -1008.56 -26.94 M-984.43 -33.49 C-991.46 -30.99, -998.76 -29.13, -1008.56 -26.94" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g></g><mask></mask><g transform="translate(358.20105743408203 10) rotate(0 118.79983520507812 20)"><text x="118.79983520507812" y="14" font-family="Comic Shanns, Segoe UI Emoji" font-size="16px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">Primary Goal: Satisfy</text><text x="118.79983520507812" y="34" font-family="Comic Shanns, Segoe UI Emoji" font-size="16px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">Non-functional Requirements</text></g><g transform="translate(371.63861083984375 133.70701599121094) rotate(0 101.19985961914062 20)"><text x="101.19985961914062" y="14" font-family="Comic Shanns, Segoe UI Emoji" font-size="16px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">Primary Goal: Satisfy </text><text x="101.19985961914062" y="34" font-family="Comic Shanns, Segoe UI Emoji" font-size="16px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">Functional Requirements</text></g><g stroke-linecap="round" transform="translate(598.6640625 310.6707000732422) rotate(0 76.98828125 59.001953125)"><path d="M29.5 0 C66.08 0.36, 97.45 0.71, 124.48 0 C146.31 2.68, 153.95 8.28, 153.98 29.5 C156.86 44.82, 153.91 60.64, 153.98 88.5 C153.03 106.37, 146.17 116.26, 124.48 118 C103.77 119.96, 81.97 117.04, 29.5 118 C10.58 118.19, -0.16 109.2, 0 88.5 C3.14 74.7, -2.73 64.24, 0 29.5 C1.79 12.99, 12.85 1.27, 29.5 0" stroke="none" stroke-width="0" fill="#ffffff"></path><path d="M29.5 0 C61.89 -0.21, 92.44 -0.08, 124.48 0 M124.48 0 C144.56 -1.64, 152.67 8.64, 153.98 29.5 M153.98 29.5 C155.53 50.79, 153.04 71.43, 153.98 88.5 M153.98 88.5 C153.6 109.25, 143.02 117.43, 124.48 118 M124.48 118 C97.59 116.89, 66.45 119.48, 29.5 118 M29.5 118 C7.98 118.93, 1.26 107.92, 0 88.5 M0 88.5 C-0.32 70.85, -1.78 55.52, 0 29.5 M0 29.5 C-0.15 8.02, 10.15 -1.38, 29.5 0" stroke="#1e1e1e" stroke-width="1.5" fill="none" stroke-dasharray="8 9"></path></g><g transform="translate(626.15234375 357.1726531982422) rotate(0 49.5 12.5)"><text x="49.5" y="17.5" font-family="Comic Shanns, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">Data Flow</text></g><g stroke-linecap="round" transform="translate(199.2734375 277.3054656982422) rotate(0 24.908203125 24.908203125)"><path d="M4.97 9.62 C4.97 9.62, 4.97 9.62, 4.97 9.62 M4.97 9.62 C4.97 9.62, 4.97 9.62, 4.97 9.62 M2.09 19.04 C6.07 15.05, 10.72 8.46, 15.21 3.95 M2.09 19.04 C7.52 13.34, 11.74 7.34, 15.21 3.95 M1.17 26.19 C7.71 17.81, 15.94 9.15, 22.82 1.29 M1.17 26.19 C8.01 18.18, 14.58 10.46, 22.82 1.29 M2.22 31.08 C6.76 24.59, 13.61 19.32, 27.15 2.4 M2.22 31.08 C11.22 20.58, 20.14 10.76, 27.15 2.4 M3.93 35.22 C10.91 27.3, 16.49 22.19, 32.14 2.76 M3.93 35.22 C11.85 26.6, 19.34 17.19, 32.14 2.76 M5.64 39.35 C17.24 25.97, 28.21 13.02, 37.13 3.12 M5.64 39.35 C14.2 29.39, 23.29 18.54, 37.13 3.12 M8 42.73 C19.46 30.27, 28.25 18.06, 39.49 6.5 M8 42.73 C19.71 29.31, 30.1 16.81, 39.49 6.5 M11.67 44.6 C23.25 30.52, 34.69 16.89, 42.51 9.13 M11.67 44.6 C22.32 32.51, 32.77 20.54, 42.51 9.13 M15.35 46.47 C25.7 34.21, 36.19 23.91, 44.87 12.51 M15.35 46.47 C22.31 38.15, 29.27 29.76, 44.87 12.51 M19.02 48.34 C27.74 38.43, 35.03 28.35, 47.89 15.13 M19.02 48.34 C28.76 36.32, 39.57 25.6, 47.89 15.13 M23.35 49.45 C33.02 38.49, 40.86 27.81, 48.94 20.02 M23.35 49.45 C31.94 39.75, 41.02 29.41, 48.94 20.02 M29.65 48.3 C34.41 42.03, 38.51 38.19, 48.68 26.42 M29.65 48.3 C33.75 43.62, 38.33 38.26, 48.68 26.42 M36.61 46.4 C40.84 42.4, 44.31 37.71, 48.42 32.81 M36.61 46.4 C40.71 41.52, 45.21 36.86, 48.42 32.81 M6.02 41.85 C6.02 41.85, 6.02 41.85, 6.02 41.85 M6.02 41.85 C6.02 41.85, 6.02 41.85, 6.02 41.85 M20.72 49.33 C13.71 44.74, 8.91 38.59, 3.36 34.24 M20.72 49.33 C14.33 43.76, 8.26 37.71, 3.36 34.24 M25.61 48.27 C18.13 41.82, 11.84 36.77, 0.71 26.62 M25.61 48.27 C19.77 42.83, 13.14 36.98, 0.71 26.62 M30.5 47.22 C23.39 41.03, 14.13 32.84, 1.07 21.64 M30.5 47.22 C22.79 40.71, 14.59 33.14, 1.07 21.64 M35.39 46.17 C23.08 34.22, 10.53 23.14, 2.94 17.96 M35.39 46.17 C23.97 36.53, 12.91 26.56, 2.94 17.96 M39.52 44.47 C29.88 36.46, 22.28 29.64, 4.05 13.63 M39.52 44.47 C25.84 32.19, 12.2 20.08, 4.05 13.63 M42.15 41.45 C30.48 30.76, 20.9 21.58, 5.16 9.3 M42.15 41.45 C28.51 29.81, 14.65 17.94, 5.16 9.3 M44.02 37.77 C34.49 28.52, 24.31 21.68, 8.54 6.94 M44.02 37.77 C34.56 29.79, 24.92 20.95, 8.54 6.94 M46.64 34.75 C37.7 28.27, 28.95 19.4, 12.68 5.23 M46.64 34.75 C35.29 24.66, 23.77 14.51, 12.68 5.23 M48.51 31.08 C40.19 24.29, 33.27 18.14, 16.06 2.87 M48.51 31.08 C39.76 23.43, 31.56 15.75, 16.06 2.87 M48.11 25.44 C41.06 18.82, 32.65 12.62, 20.19 1.16 M48.11 25.44 C37.65 16.02, 26.8 6.79, 20.19 1.16 M48.47 20.45 C42.78 16.96, 37.91 10.94, 25.83 0.77 M48.47 20.45 C40.83 13.34, 33.04 6.86, 25.83 0.77 M48.08 14.81 C43.94 10.71, 41.11 7.58, 33.74 2.34 M48.08 14.81 C44.45 12.01, 40.97 8.49, 33.74 2.34" stroke="#299a8d" stroke-width="0.5" fill="none"></path><path d="M20.19 0.95 C25.12 -0.3, 31.92 0.84, 36.54 3.23 C41.15 5.63, 45.98 10.42, 47.91 15.32 C49.84 20.22, 49.73 27.54, 48.12 32.62 C46.52 37.7, 42.77 42.99, 38.28 45.81 C33.79 48.63, 26.58 50.22, 21.18 49.53 C15.78 48.85, 9.36 45.76, 5.88 41.72 C2.4 37.68, 0.47 30.6, 0.3 25.27 C0.14 19.94, 1.49 13.86, 4.87 9.74 C8.25 5.62, 17.62 2.06, 20.58 0.53 C23.54 -0.99, 22.51 0.19, 22.63 0.57 M23.25 -0.51 C28.31 -1.03, 35.72 1.25, 40.07 4.51 C44.42 7.77, 48.14 13.77, 49.36 19.07 C50.57 24.37, 49.82 31.38, 47.36 36.3 C44.9 41.22, 39.58 46.5, 34.61 48.6 C29.64 50.69, 22.62 50.5, 17.54 48.85 C12.45 47.2, 6.91 43.23, 4.12 38.68 C1.33 34.14, 0.17 26.96, 0.78 21.58 C1.4 16.2, 3.99 10.04, 7.81 6.38 C11.63 2.72, 20.91 0.63, 23.7 -0.4 C26.5 -1.43, 24.51 -0.19, 24.57 0.21" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(218.56888128814057 289.60090948638276) rotate(0 5.5 12.5)"><text x="5.5" y="17.5" font-family="Comic Shanns, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">2</text></g><g stroke-linecap="round" transform="translate(393.09375 279.1921844482422) rotate(0 24.908203125 24.908203125)"><path d="M1.34 15.74 C1.34 15.74, 1.34 15.74, 1.34 15.74 M1.34 15.74 C1.34 15.74, 1.34 15.74, 1.34 15.74 M1.08 22.14 C8.75 14.85, 15.58 7.36, 18.13 2.51 M1.08 22.14 C7.06 15.8, 12.79 8.65, 18.13 2.51 M0.82 28.53 C8.09 19.87, 15.5 11.91, 24.43 1.36 M0.82 28.53 C7.55 20.01, 15.31 11.85, 24.43 1.36 M1.87 33.42 C9.61 25.9, 17.08 16.87, 30.73 0.22 M1.87 33.42 C9.85 23.22, 18.72 14.31, 30.73 0.22 M4.23 36.8 C9.92 30.4, 15.86 23.5, 33.75 2.84 M4.23 36.8 C14.39 25.32, 24.31 14.15, 33.75 2.84 M7.25 39.43 C17.03 27.69, 26.21 15.9, 37.43 4.71 M7.25 39.43 C18.01 27.7, 28.7 15.93, 37.43 4.71 M9.61 42.8 C19.15 33.02, 27.17 23.51, 40.45 7.33 M9.61 42.8 C16.78 35.52, 22.43 27.52, 40.45 7.33 M11.97 46.18 C20.97 37.54, 28.91 27.29, 44.12 9.2 M11.97 46.18 C22.91 33.58, 33.29 21.52, 44.12 9.2 M16.3 47.3 C21.7 40.53, 29.19 32.92, 45.83 13.34 M16.3 47.3 C24.95 37.52, 33.95 27.75, 45.83 13.34 M20.64 48.41 C28.43 39.98, 34.65 31.12, 47.53 17.47 M20.64 48.41 C26.39 41.58, 31.61 35.73, 47.53 17.47 M24.97 49.53 C31.5 42.54, 37.28 35.34, 49.24 21.6 M24.97 49.53 C34.3 38.13, 44.22 27.37, 49.24 21.6 M30.61 49.13 C34.03 44.74, 38.74 39.38, 50.29 26.49 M30.61 49.13 C37.34 41.77, 43.98 34.18, 50.29 26.49 M40.84 43.46 C42.82 41.36, 44.13 39.26, 45.44 38.17 M40.84 43.46 C42.3 41.82, 43.76 40, 45.44 38.17 M11.98 45.66 C11.98 45.66, 11.98 45.66, 11.98 45.66 M11.98 45.66 C11.98 45.66, 11.98 45.66, 11.98 45.66 M20.64 47.89 C13.6 41.65, 4.81 34.61, 1.02 30.83 M20.64 47.89 C14.53 42.68, 9.07 37.15, 1.02 30.83 M28.55 49.46 C21.6 42.93, 15.11 38.88, 1.38 25.85 M28.55 49.46 C19.88 42.21, 11.18 35, 1.38 25.85 M31.93 47.1 C20.32 37.04, 10.01 28.01, 1.74 20.86 M31.93 47.1 C20.62 36.52, 8.14 27.02, 1.74 20.86 M36.06 45.4 C27.99 38.83, 19.7 30.44, 1.35 15.22 M36.06 45.4 C25.74 36.99, 16.09 27.34, 1.35 15.22 M39.44 43.03 C31.74 35.38, 22.35 28.54, 4.73 12.85 M39.44 43.03 C30.24 34.81, 20.84 26.88, 4.73 12.85 M43.58 41.33 C36.61 34.55, 27.73 28.15, 7.35 9.83 M43.58 41.33 C30.07 29.32, 16.64 18.05, 7.35 9.83 M45.45 37.65 C38.04 30.64, 31.9 25.56, 9.98 6.82 M45.45 37.65 C31.51 25.62, 17.93 13.86, 9.98 6.82 M46.56 33.32 C33.78 21.26, 19.6 10.37, 12.6 3.8 M46.56 33.32 C35.66 24.6, 25.18 14.68, 12.6 3.8 M48.43 29.64 C39.43 22.98, 30.39 14.33, 16.73 2.09 M48.43 29.64 C39.51 21.52, 30.76 14.58, 16.73 2.09 M50.3 25.97 C42.45 17.47, 33.08 11.15, 21.62 1.04 M50.3 25.97 C41.96 18.73, 34.71 11.78, 21.62 1.04 M48.4 19.01 C40.95 11.2, 32.69 5.27, 27.26 0.65 M48.4 19.01 C43.21 14.55, 38.57 10.15, 27.26 0.65 M45.74 11.4 C43.65 9.57, 41.71 8.12, 37.44 4.19 M45.74 11.4 C42.58 8.76, 39.61 6.31, 37.44 4.19" stroke="#299a8d" stroke-width="0.5" fill="none"></path><path d="M30.12 0.22 C35.09 0.94, 40.88 5.37, 44.2 9.61 C47.53 13.86, 50.24 20.32, 50.07 25.67 C49.89 31.01, 46.88 37.65, 43.16 41.68 C39.44 45.71, 32.98 49.18, 27.76 49.83 C22.54 50.47, 16.37 48.41, 11.86 45.55 C7.34 42.7, 2.43 37.68, 0.69 32.7 C-1.05 27.72, -0.75 20.64, 1.42 15.65 C3.58 10.66, 8.74 5.24, 13.68 2.77 C18.63 0.31, 28.04 1.08, 31.09 0.87 C34.15 0.66, 32.17 1.2, 32.02 1.52 M20.66 -0.13 C25.67 -1.25, 33.08 0.29, 37.72 3.14 C42.37 6, 46.74 11.92, 48.54 17 C50.33 22.08, 50.33 28.62, 48.51 33.6 C46.7 38.59, 42.21 44.27, 37.65 46.91 C33.1 49.55, 26.53 50.45, 21.18 49.44 C15.83 48.43, 9.09 44.99, 5.53 40.83 C1.97 36.68, -0.35 29.89, -0.19 24.53 C-0.04 19.16, 3 12.73, 6.46 8.62 C9.92 4.51, 18.26 1.23, 20.59 -0.12 C22.92 -1.48, 20.3 0.07, 20.44 0.5" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(412.3891937881406 291.48762823638276) rotate(0 5.5 12.5)"><text x="5.5" y="17.5" font-family="Comic Shanns, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">3</text></g><g stroke-linecap="round" transform="translate(580.021484375 280.8542938232422) rotate(0 24.908203125 24.908203125)"><path d="M5.68 8.91 C5.68 8.91, 5.68 8.91, 5.68 8.91 M5.68 8.91 C5.68 8.91, 5.68 8.91, 5.68 8.91 M2.14 19.08 C7.47 12.37, 12.14 7.77, 16.57 2.48 M2.14 19.08 C7.15 13.49, 12.03 7.65, 16.57 2.48 M0.57 26.99 C6.2 19.48, 12.38 12.97, 23.53 0.58 M0.57 26.99 C5.59 21.42, 11.25 15.14, 23.53 0.58 M2.27 31.13 C12.03 19.72, 23.05 7.34, 27.86 1.69 M2.27 31.13 C7.55 24.57, 14.22 17.63, 27.86 1.69 M3.98 35.26 C14.71 23.58, 23.92 12.09, 32.19 2.81 M3.98 35.26 C10.88 26.85, 18.07 19.28, 32.19 2.81 M5.69 39.39 C14.53 29.37, 21.71 20.94, 37.18 3.17 M5.69 39.39 C16.24 26.42, 27 14.73, 37.18 3.17 M8.05 42.77 C17.62 29.72, 29.07 19.57, 39.54 6.55 M8.05 42.77 C19.25 29.44, 30.58 17.21, 39.54 6.55 M11.72 44.64 C23.99 30.8, 36.48 17.5, 41.9 9.92 M11.72 44.64 C19.8 35.33, 28.82 24.8, 41.9 9.92 M15.4 46.51 C25.08 34.7, 34.53 23.67, 44.92 12.55 M15.4 46.51 C24.49 35.44, 33.55 25.18, 44.92 12.55 M18.42 49.14 C25.5 40.73, 35.23 31.55, 47.28 15.93 M18.42 49.14 C25.02 40.81, 31.75 33.53, 47.28 15.93 M23.4 49.5 C31.31 41.53, 37.88 32.96, 48.33 20.82 M23.4 49.5 C29.03 42.23, 35.87 35.11, 48.33 20.82 M29.7 48.35 C36.59 41.38, 42.12 33.78, 48.73 26.46 M29.7 48.35 C36.25 40.95, 42.46 34.35, 48.73 26.46 M36 47.2 C39.8 42.94, 44.12 38.98, 49.12 32.1 M36 47.2 C40.28 42.23, 44.15 37.48, 49.12 32.1 M6.55 41.24 C6.55 41.24, 6.55 41.24, 6.55 41.24 M6.55 41.24 C6.55 41.24, 6.55 41.24, 6.55 41.24 M22 49.38 C15.66 44.43, 8.22 37.97, 3.14 32.98 M22 49.38 C15.8 44.17, 10.4 38.92, 3.14 32.98 M26.89 48.33 C21.48 43.49, 15.08 38.36, -0.28 24.71 M26.89 48.33 C17.9 39.98, 7.78 31.87, -0.28 24.71 M31.78 47.28 C23.6 40.42, 13.7 32.86, 1.59 21.03 M31.78 47.28 C24.89 42.04, 18.32 35.98, 1.59 21.03 M37.42 46.88 C24.18 35.25, 10.54 23.54, 2.71 16.7 M37.42 46.88 C23.38 34.93, 10.01 23.32, 2.71 16.7 M39.29 43.21 C29.23 35.88, 19.56 26.49, 4.58 13.03 M39.29 43.21 C30.43 36.12, 22.14 28.64, 4.58 13.03 M41.92 40.19 C32.4 30.8, 22.07 21.91, 5.69 8.7 M41.92 40.19 C34.05 33.24, 27.31 27.09, 5.69 8.7 M44.54 37.17 C37.19 31.24, 28.6 22.81, 9.07 6.33 M44.54 37.17 C36.72 29.28, 27.55 22.68, 9.07 6.33 M47.17 34.15 C38.35 26.85, 29.19 17.89, 13.2 4.63 M47.17 34.15 C34.28 22.62, 21.54 11.44, 13.2 4.63 M48.28 29.82 C35.83 19.51, 22.96 8.12, 16.58 2.26 M48.28 29.82 C41.49 23.76, 34.84 18.38, 16.58 2.26 M48.64 24.83 C42.71 19.99, 37.22 14.2, 20.72 0.56 M48.64 24.83 C42.44 18.72, 35.09 13.63, 20.72 0.56 M48.25 19.19 C42.92 15.43, 38.89 10.73, 27.11 0.82 M48.25 19.19 C41.99 14.42, 36.28 8.8, 27.11 0.82 M40.3 6.98 C39.23 5.72, 37.56 4.5, 35.02 2.39 M40.3 6.98 C38.62 5.45, 37.03 4.2, 35.02 2.39" stroke="#299a8d" stroke-width="0.5" fill="none"></path><path d="M20.7 0.13 C25.68 -1.09, 32.56 0.51, 37.08 3.23 C41.6 5.96, 45.88 11.53, 47.81 16.47 C49.74 21.41, 50.46 27.86, 48.66 32.89 C46.86 37.92, 41.75 43.86, 37.02 46.66 C32.29 49.46, 25.41 50.64, 20.28 49.7 C15.15 48.75, 9.65 45.08, 6.25 40.98 C2.84 36.88, -0.06 30.46, -0.16 25.12 C-0.26 19.78, 2.13 13.17, 5.64 8.96 C9.15 4.74, 18.17 1.22, 20.9 -0.18 C23.62 -1.57, 21.94 0.1, 22.01 0.59 M20.88 1.02 C25.79 -0.1, 32.98 0.93, 37.6 3.58 C42.22 6.23, 46.72 11.92, 48.59 16.9 C50.47 21.88, 50.79 28.57, 48.85 33.48 C46.92 38.4, 41.74 43.81, 36.98 46.4 C32.23 48.98, 25.42 49.98, 20.33 49.01 C15.24 48.03, 9.82 44.67, 6.44 40.56 C3.06 36.45, 0.17 29.68, 0.04 24.33 C-0.09 18.99, 2.17 12.53, 5.67 8.47 C9.18 4.42, 18.66 1.16, 21.07 0 C23.48 -1.15, 20.23 1.07, 20.14 1.54" stroke="#1e1e1e" stroke-width="1" fill="none"></path></g><g transform="translate(599.3169281631406 293.14973761138276) rotate(0 5.5 12.5)"><text x="5.5" y="17.5" font-family="Comic Shanns, Segoe UI Emoji" font-size="20px" fill="#1e1e1e" text-anchor="middle" style="white-space: pre;" direction="ltr" dominant-baseline="alphabetic">4</text></g><g stroke-linecap="round"><g transform="translate(193.3515625 364.1062469482422) rotate(0 10.326171875 -0.71875)"><path d="M-0.1 0.3 C3.35 0.11, 16.89 -1.22, 20.34 -1.6" stroke="#1e1e1e" stroke-width="1.5" fill="none" stroke-dasharray="8 9"></path></g><g transform="translate(193.3515625 364.1062469482422) rotate(0 10.326171875 -0.71875)"><path d="M11.02 2.91 C13.45 1.6, 15.14 0.84, 20.34 -1.6" stroke="#1e1e1e" stroke-width="1.5" fill="none"></path></g><g transform="translate(193.3515625 364.1062469482422) rotate(0 10.326171875 -0.71875)"><path d="M10.31 -4.13 C12.86 -3.84, 14.72 -2.99, 20.34 -1.6" stroke="#1e1e1e" stroke-width="1.5" fill="none"></path></g></g><mask></mask><g stroke-linecap="round"><g transform="translate(574.9453125 369.0554656982422) rotate(0 7.900390625 -0.3828125)"><path d="M-0.31 -0.16 C2.34 -0.42, 13.05 -1.21, 15.78 -1.26" stroke="#1e1e1e" stroke-width="1.5" fill="none" stroke-dasharray="8 9"></path></g><g transform="translate(574.9453125 369.0554656982422) rotate(0 7.900390625 -0.3828125)"><path d="M8.49 1.82 C10.41 0.96, 12.22 0.29, 15.78 -1.26" stroke="#1e1e1e" stroke-width="1.5" fill="none"></path></g><g transform="translate(574.9453125 369.0554656982422) rotate(0 7.900390625 -0.3828125)"><path d="M8.22 -3.59 C10.23 -2.93, 12.12 -2.07, 15.78 -1.26" stroke="#1e1e1e" stroke-width="1.5" fill="none"></path></g></g><mask></mask><g stroke-linecap="round"><g transform="translate(763.0703125 377.4031219482422) rotate(0 7.291015625 -1.26953125)"><path d="M-0.03 -0.49 C2.5 -0.83, 12.47 -1.79, 14.83 -2.22" stroke="#1e1e1e" stroke-width="1.5" fill="none" stroke-dasharray="8 9"></path></g><g transform="translate(763.0703125 377.4031219482422) rotate(0 7.291015625 -1.26953125)"><path d="M8.27 1.2 C9.55 0.54, 11.69 -0.75, 14.83 -2.22" stroke="#1e1e1e" stroke-width="1.5" fill="none"></path></g><g transform="translate(763.0703125 377.4031219482422) rotate(0 7.291015625 -1.26953125)"><path d="M7.61 -3.82 C9.04 -3.26, 11.35 -3.32, 14.83 -2.22" stroke="#1e1e1e" stroke-width="1.5" fill="none"></path></g></g><mask></mask></svg>
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Leetcode Competitons

Questions

  • What kinds of competitions, which fields? (DSA, SQL?)
  • Are these competitions long running?
  • What are the business objectives? - only ranking? or companies can organise?
  • How are the tie-breaks/performance measured? (features: time taken, attempts, partial correct?)
  • How man competitions daily/monthly?
  • Expected participation per competitions? Limits on seats available per competition?
  • How will penalties work
  • If competition is cross regional, how much would be the minumum time frame to start a competition? (depends on the lowest latency in different regions or replication lag)

FR

  • Create competitions: set answers, test cases, features to track and score multipliers, penalties, start/end dates, rewards
  • User registers
  • Register for competitions, get notified
  • Browse questions, submit solutions, execute (dry-run/test cases), view scores
  • See rankings (live and final)
  • Set rewards
  • See submissions by participating people once competition is done
  • Use as practice competition after competition is done (if organiser allows it)

Components:

  • Metadata Service (for competition, and problems)

  • User / Auth (competitors, organisers, admins)

  • Infra Config / Policies

  • Code Runners

  • Timer Module

  • Submissions and Plagarism, metadata valiadtions

  • Scorer & Ranker

  • Notification / Event Bus

  • Blob Store (test cases)

Non FR

(Assuming that competitor organisers have been given a time frame, so anyone can start a competition at any time, and competition then can have a fixed duration)

Competition Metadata Service & Blob Store

handles:

  • creating and scheduling competition

  • rules, scorings, problems, test cases

  • P: Ensure same rules and config for competitions (C > A)

  • E: Ensure updated data, (C > L)

  • Fairness

Submissions:

handles:

  • receives submissions for problem.

  • submitted versions

  • config rules validations like expired or not (signals ranking is needed or not)

  • logs

  • Ties with code runner cluster, but prefer C > A

Code Runners:

handles:

  • runing user code

  • sandbox, time and memory limits and networking configs

  • emit usage and success/failure metrics agains tes cases

  • Prefer availaility to be able execute code, Availability can be ensured by having multi cluster and sandboxing competition cluster to reduce impact

  • Could be multi cluster depending on type of competition and test case running we could set different set of policies

  • Injects and Emits metrics for scoring (runtime, memory, submission, success/failure rate)

  • Constrainted resources and sandboxing for execution

Failures:

  • Client to Server connection lost:

    • Keep a local timer, and accumulate changes in the client. Sync to server
  • Code runner cluster fails:

    • Region is failing: redirect to a different cluster in region
    • To ensure fairness: we need to reward with delta time, for the network trip required and re-scheduling.
    • Ensure a max cap on resources(cpu/memory/timeouts) to prevent resource hogging.

Su In order to compensate for time lost in

Scoring & Ranking:

handles:

  • ingestion of code running events/metrics
  • apply scoring based on rules set
  • show the rank

Live vs Final Rankings:

  • Live, prefer A > C .. if some node goes down, stops processing its okay. it can come back online when updated (convey this with colors)
    • SLO, SLA
  • Final C > A .. even caches must be cleared on all cdns.
    • SLO, SLA:

Local Delivery Service

Deliver goods typically found in a convenience store via rapid delivery and 500+ micro distribution centers (DCs).

Questions

  • specific to country/continent or worldwide?
  • DC's managed by whom?
  • SLA of delivery based on radius?
  • Radius? static or area basis?
  • operating times? what happens during large scale events/riots etc.
  • User base, Items ? Region specific items?
  • How do you confirm order delivered?
  • Order completion: single order, club orders?
  • How does payouts happen?
  • Order cancellation time window, Returns
  • Price of items, how numbers to round off?

FR

  • User logs in, and see's items available in stores near 10km radiius

  • Depending on weather delivery can be now or schedule for later

  • Adds items to cart, wishlist(later or notify)

  • Places order, amount, coupouns and discount

  • Completes paynment, sees delivery time, order/driver status

  • Driver registers, complete self and vehicle kyc. Gets accepted/rejected

  • Driver can log-in, set active/inactive.

  • Gets order requests broadcasted, accepts 1 or multiple

  • Can move between locations

  • Sees earnings, payouts, heatmaps for traffic congestions, weather alerts etc.

  • Uploads photo or PIN to confirm delivery.

  • Store Management tracks inventory

  • Tracks order info (items, order, driver, status)

  • Batch updates every X interval

  • Recon Jobs validate earnings and inventory and delivery success/failures every Y intervals

  • Payout service records transactions, money received, money to be sent to drivers, cancellations, returns, lost or failed orders.

  • Adds new DC to network/mesh.

Non FR

  • A:
    • Users should able to list items and place orders (99.99?) of the time.
    • Drivers should be able to move to locations if some area has problems
  • C:
    • Inventory deduction must be atomic to prevent overselling
    • Inventory listing can have slight delays, No double chargi
    • Rider assignment must be atomic, but can be delayed within the order delivery SLA (15-30mints)
    • Order status tracking can be approximate but should never go back.
    • Order creation should be idempotent, no double ordering or double payments.
  • L:
    • Browse Items (p95 < 200ms),
    • Order creation (p95 < 500ms),
    • Order Broadcast (p95 < 500ms),
    • Driver Assignment (2s-2mintues)
  • S:
    • Should be able to handle adding DC,
    • Dyamically scale up and down based on spikes or long low demand.
    • 100K orders a day per region maybe a total of 1-10million globally,
    • 1-100 million users,
    • 100K-1million drivers
    • Notifications: 4xorders = 4-40M to users (for order states) + 100K orders per region * 1 million drivers ~ 100-200Billion
  • Reliability:
    • Outages must be contained withing a region,
    • Item locks, orders should be recoverable,
    • Payments should have different modes and multiple gateways,
    • Orders once processed, must be delivered. If delvery fails must be refunded
    • Prevent over-selling and handle HOT items.
    • System performanc must be traceable and alertable, Handling hammering the system in case of failed systems.
  • Safety:
    • Trace payments and orders for audits
    • Dont expose users card or addresses
    • Donot overcharge

Outline

Components:

  • Registration/Login (User and Driver Management)
  • Authentication, Blocking/BadUserDriver
  • Catalogue/Inventory Management
  • Order Mangement (Order auto delegation)
  • Store Management
  • Payments
  • Discounting & Coupons
  • Recon Jobs
  • Notifications

Delivery Framework

(This is from hello interview,)

The best way to structure your system design interviews to structure your thoughts and focus on the most important aspects, built by FAANG managers and staff engineers.


The easiest way to sabotage your chances of getting an offer in your system design interview is to fail to deliver a working system. This is the most common reason that mid-level candidates fail these interviews and it often manifests as the opaque "time management". This issue isn't (always) that you need to work twice as fast — many times you just need to focus on the right things.

Overall Structure

Our delivery framework is a sequence of steps and timings we recommend for your interview. By structuring your interview in this way, you'll stay focused on the bits that are most important to your interviewer. An added benefit is that you'll have a clear path to fall back if you're overwhelmed. Many candidates are (understandably!) nervous in their interview. It's easy to get lost if you aren't building up a solution in a linear way.

While a firm structure to your approach is important and your interviewer is not trained specifically to assess you on your delivery (often this gets bucketed into "communication"), in practice we've seen many candidates that perform significantly better by following a structure which both keeps them from getting stuck and ensures they deliver a working system.

Here's the framework! ![[framework.svg]]

Recommended system design interview structure

Requirements (~5 minutes)

The goal of the requirements section is to get a clear understanding of the system that you are being asked to design. To do this, we suggest you break your requirements into two sections.

1) Functional Requirements

Functional requirements are your "Users/Clients should be able to..." statements. These are the core features of your system and should be the first thing you discuss with your interviewer. Oftentimes this is a back and forth with your interviewer. Ask targeted questions as if you were talking to a client, customer, or product manager ("does the system need to do X?", "what would happen if Y?") to arrive at a prioritized list of core features.

For example, if you were designing a system like Twitter, you might have the following functional requirements:

  • Users should be able to post tweets
  • Users should be able to follow other users
  • Users should be able to see tweets from users they follow

A cache meanwhile might have requirements like:

  • Clients should be able to insert items
  • Clients should be able to set expirations
  • Clients should be able to read items

Keep your requirements targeted! The main objective in the remaining part of the interview is to develop a system that meets the requirements you've identified -- so it's crucial to be strategic in your prioritization. Many of these systems have hundreds of features, but it's your job to identify and prioritize the top 3. Having a long list of requirements will hurt you more than it will help you and many top FAANGs directly evaluate you on your ability to focus on what matters.

2) Non-functional Requirements

Non-functional requirements are statements about the system qualities that are important to your users. These can be phrased as "The system should be able to..." or "The system should be..." statements.

For example, if you were designing a system like Twitter, you might have the following non-functional requirements:

  • The system should be highly available, prioritizing availability over consistency
  • The system should be able to scale to support 100M+ DAU (Daily Active Users)
  • The system should be low latency, rendering feeds in under 200ms

It's important that non-functional requirements are put in the context of the system and, where possible, are quantified. For example, "the system should be low latency" is obvious and not very meaningful—nearly all systems should be low latency. "The system should have low latency search, < 500ms," is much more useful as it identifies the part of the system that most needs to be low latency and provides a target.

Coming up with non-functional requirements can be challenging, especially if you're not familiar with the domain. Here is a checklist of things to consider that might help you identify the most important non-functional requirements for your system. You'll want to identify the top 3-5 that are most relevant to your system.

  1. CAP Theorem: Should your system prioritize consistency or availability? Note, partition tolerance is a given in distributed systems.
  2. Environment Constraints: Are there any constraints on the environment in which your system will run? For example, are you running on a mobile device with limited battery life? Running on devices with limited memory or limited bandwidth (e.g. streaming video on 3G)?
  3. Scalability: All systems need to scale, but does this system have unique scaling requirements? For example, does it have bursty traffic at a specific time of day? Are there events, like holidays, that will cause a significant increase in traffic? Also consider the read vs write ratio here. Does your system need to scale reads or writes more?
  4. Latency: How quickly does the system need to respond to user requests? Specifically consider any requests that require meaningful computation. For example, low latency search when designing Yelp.
  5. Durability: How important is it that the data in your system is not lost? For example, a social network might be able to tolerate some data loss, but a banking system cannot.
  6. Security: How secure does the system need to be? Consider data protection, access control, and compliance with regulations.
  7. Fault Tolerance: How well does the system need to handle failures? Consider redundancy, failover, and recovery mechanisms.
  8. Compliance: Are there legal or regulatory requirements the system needs to meet? Consider industry standards, data protection laws, and other regulations.

3) Capacity Estimation

Many guides you've read will suggest doing back-of-the-envelope calculations at this stage. We believe this is often unnecessary. Instead, perform calculations only if they will directly influence your design. In most scenarios, you're dealing with a large, distributed system – and it's reasonable to assume as much. Many candidates will calculate storage, DAU, and QPS, only to conclude, "ok, so it's a lot. Got it." As interviewers, we gain nothing from this except that you can perform basic arithmetic.

Our suggestion is to explain to the interviewer that you would like to skip on estimations upfront and that you will do math while designing when/if necessary. When would it be necessary? Imagine you are designing a TopK system for trending topics in FB posts. You would want to estimate the number of topics you would expect to see, as this will influence whether you can use a single instance of a data structure like a min-heap or if you need to shard it across multiple instances, which will have a big impact on your design.

Regardless of how you end up using it in the interview, learning to estimate relevant quantities quickly will help you quickly reason through design trade-offs in your design. Don't worry if you're not good at mental arithmetic under pressure, most people aren't.

Core Entities (~2 minutes)

Next you should take a moment to identify and list the core entities of your system. This helps you to define terms, understand the data central to your design, and gives you a foundation to build on. These are the core entities that your API will exchange and that your system will persist in a Data Model. In the actual interview, this is as simple as jotting down a bulleted list and explaining this is your first draft to the interviewer.

Why not list the entire data model at this point? Because you don't know what you don't know. As you design your system, you'll discover new entities and relationships that you didn't anticipate. By starting with a small list, you can quickly iterate and add to it as you go. Once you get into the high level design and have a clearer sense of exactly what state needs to update upon each request you can start to build out the list of relevant columns/fields for each entity.

For our Twitter example, our core entities are rather simple:

  • User
  • Tweet
  • Follow

A couple useful questions to ask yourself to help identify core entities:

  • Who are the actors in the system? Are they overlapping?
  • What are the nouns or resources necessary to satisfy the functional requirements?

Aim to choose good names for your entities. While most problems are small enough that you could probably sub in foo and bar for any entity in your system, some interviewers use this as an opportunity to see whether you're any good at one of the hardest problems in computer science.

API or System Interface (~5 minutes)

Before you get into the high-level design, you'll want to define the contract between your system and its users. Oftentimes, especially for full product style interviews, this maps directly to the functional requirements you've already identified (but not always!). You will use this contract to guide your high-level design and to ensure that you're meeting the requirements you've identified.

You have a quick decision to make here -- which API protocol should you use?

REST (Representational State Transfer): Uses HTTP verbs (GET, POST, PUT, DELETE) to perform CRUD operations on resources. This should be your default choice for most interviews.

GraphQL: Allows clients to specify exactly what data they want to receive, avoiding over-fetching and under-fetching. Choose this when you have diverse clients with different data needs.

RPC (Remote Procedure Call): Action-oriented protocol (like gRPC) that's faster than REST for service-to-service communication. Use for internal APIs when performance is critical.

Don't overthink this. Default to REST unless you have a specific reason not to. For real-time features, you'll also need WebSockets or Server-Sent Events, but design your core API first.

For Twitter, we would choose REST and design our endpoints using our core entities as resources. Resources should be plural nouns that represent things in your system:

POST /v1/tweets
body: {
  "text": string
}

GET /v1/tweets/{tweetId} -> Tweet

POST /v1/follows
body: {
  "followee_id": string
}

GET /v1/feed -> Tweet[]

Notice how we use plural resource names (tweets, not tweet). The current user is derived from the authentication token in the request header, not from request bodies or path parameters.

Never rely on sensitive information like user IDs from request bodies when they should come from authentication. Always authenticate requests and derive the current user from the auth token, not from user input.

[Optional] Data Flow (~5 minutes)

For some backend systems, especially data-processing systems, it can be helpful to describe the high level sequence of actions or processes that the system performs on the inputs to produce the desired outputs. If your system doesn't involve a long sequence of actions, skip this!

We usually define the data flow via a simple list. You'll use this flow to inform your high-level design in the next section.

For a web crawler, this might look like:

  1. Fetch seed URLs
  2. Parse HTML
  3. Extract URLs
  4. Store data
  5. Repeat

High Level Design (~10-15 minutes)

Now that you have a clear understanding of the requirements, entities, and API of your system, you can start to design the high-level architecture. This consists of drawing boxes and arrows to represent the different components of your system and how they interact. Components are basic building blocks like servers, databases, caches, etc. This can be done either in person on a whiteboard or virtually using whiteboarding software like Excalidraw. The Key Technologies section will give you a good sense of the most common components you'll need to know.

Ask your recruiter what software you'll be using for your interview and practice with it ahead of time. You don't want to be fumbling with the software during your interview.

Don't over think this! Your primary goal is to design an architecture that satisfies the API you've designed and, thus, the requirements you've identified. In most cases, you can even go one-by-one through your API endpoints and build up your design sequentially to satisfy each one.

Stay focused! It's incredibly common for candidates to start layering on complexity too early, resulting in them never arriving at a complete solution. Focus on a relatively simple design that meets the core functional requirements, and then layer on complexity to satisfy the non-functional requirements in your deep dives section. It's natural to identify areas where you can add complexity, like caches or message queues, while in the high-level design. We encourage you to note these areas with a simple verbal callout and written note, and then move on.

As you're drawing your design, you should be talking through your thought process with your interviewer. Be explicit about how data flows through the system and what state (either in databases, caches, message queues, etc.) changes with each request, starting from API requests and ending with the response. When your request reaches your database or persistence layer, it's a great time to start documenting the relevant columns/fields for each entity. You can do this directly next to your database visually. This helps keep it close to the relevant components and makes it easy to evolve as you iterate on your design. No need to worry too much about types here, your interviewer can infer and they'll only slow you down.

Don't waste your time documenting every column/field in your schema. For example, your interviewer knows that a User table has a name, email, and password hash so you don't need to write these down. Instead, focus on the columns/fields that are particularly relevant to your design.

For our simple Twitter example, here is how you might build up your design, one endpoint at a time:

![[hld.svg]]

Deep Dives (~10 minutes)

Astute readers probably noticed that our simple, high-level design of Twitter is going to be woefully inefficient when it comes to fetching users' feeds. No problem! That's exactly the sort of thing you'll iterate on in the deep dives section. Now that you have a high-level design in place you're going to use the remaining 10 or so minutes of the interview to harden your design by:

  • Ensuring it meets all of your non-functional requirements
  • Addressing edge cases
  • Identifying and addressing issues and bottlenecks
  • Improving the design based on probes from your interviewer.

The degree to which you're proactive in leading deep dives is a function of your seniority. More junior candidates can expect the interviewer to jump in here and point out places where the design could be improved. More senior candidates should be able to identify these places themselves and lead the discussion.

So for example, one of our non-functional requirements for Twitter was that our system needs to scale to >100M DAU. We could then lead a discussion oriented around horizontal scaling, the introduction of caches, and database sharding -- updating our design as we go. Another was that feeds need to be fetched with low latency. In the case of Twitter, this is actually the most interesting problem. We'd lead a discussion about fanout-on-read vs fanout-on-write and the use of caches.

A common mistake candidates make is that they try to talk over their interviewer here. There is a lot to talk about, sure, and for senior candidates being proactive is important, however, it's a balance. Make sure you give your interviewer room to ask questions and probe your design. Chances are they have specific signals they want to get from you and you're going to miss it if you're too busy talking. Plus, you'll hurt your evaluation on communication and collaboration.

URL Shortner

questions

  • how many read/writes?
  • latency?

read: p50: 10ms p99: 50ms

write: p50: 50-80ms p99: 100-200ms

Function R

  1. Create short url from long url
  2. User visits a short url -> redirected to original url
  3. Authenticated Users can have custom url, with saying custom meta:og urls
  4. Expiriy
  5. Check stats
  6. Custom URL

Non-FR

  1. User always see's their own result (SC)
  2. Rest can be EC.
  3. Hot short links (single flight and caching because of thundering heard)
  4. dont reuse ids, because ids are cached so, propagating those changes might be a hassle we dont deal with rn.

Outline

  • Resource (id, resource_type, email, hpass, created_at, blocked)
  • URL (short_url, allocated, created_at, reserved_at)
  • ResourceURL(resource_id, short_url, long_url, created_at, expires_at)

Flow

Write

flowchart LR
  Client -- Checks duplicates and domain exists, blacvklists --> API 
  API -- Generate unique short urls --> KeyGenerate
  KeyGenerate -- Return ID --> API
  API -- save to database --> DB

Loading

Read

flowchart LR
  Client -- Enters short URL --> API
  API -- Check in DB (maybe add cache) --> DB
  API -- 302 --> Redirect
Loading

Key Generation

  1. readable
  2. short (8-9)
  3. url SAfe
  4. collision rare

Writers

  • TPS: 1M/sec

  • Workers: 10, Growth 10x

  • Worker/Shard Bits: log2(10) ~ log2(100) ~ 7bits

  • 100k WPS Per worker = 100 wpms = log2(100) bits = 7bits

  • Bust: 10x = 1000 wpms

  • Seq Bits: log2(100) ~ log2(1000) ~ 10bits (3/0.3)

Using 64 bits we get 2^64 ~ 10^18 unique ids.

  • Domain name, ping check.
  • Malicious URLs:
    • Bloom Filters for knowns
    • Basic checks: ssl certs
    • Trustability of domains

Perf Analysis:

URL Record in DB: 200B 1M = 200MB/s Bandwidth

DB Write + index + wal = 5IOPS (assuming) 1M wps, 3shards = 333K writes per shard, 333*5 ~ 1.6M IOPS.

Write Pattern:

  • append-only
  • no updates
  • no range scans needed

Discussions:

  • Ebs: not possible.
  • NVME: local attached storage to EC2 or something
  • Postgres: Pros: Easy to maintain with strucutre, SC, Good for reads (range scans) because of b+ trees. Cons: VACCUM, single threaded bgwriter, Write and Updates/Deletes are costly because of tombstones and compaction seperately from WAL.
  • RocksDB-esque: Pros: Faster writes, different flavours, like yugabytes, distributed natively by design, WAL and tombstones are compacted, sorted sets make write sequential, Bloom filters come in built. Cons: hash based keys bad for range queries, tuning compaction uintervals.

In either case, EBS wont support, this kind of scale, native local nvme's are better.

Another option is to use dynamodb, which promises ms latency on writes and reads, managed by AWS, causing vendor lock-in. Deletions and compaction intervals need to be managed.

Fault Tolerance:

  • Database Crashes:

    • Have replication: out of 3, 1 master, 1 local sync replication, and 1 in different az
    • Shard the database, 10-100 nodes
    • Crash at WAL -> SST (recover uysing WAL)
    • SST -> Disk fail?
    • Leader election raft recovery stuff
  • KeyGenerator Crashes:

    • We would loose a bunch of keys, for the timeperiod it was down
    • Respawn a new generator instance.
    • Have a backfill service, which can be used to create new ids until the thing catches up with present time.
  • Compaction

Reader

  • TPS: 10M/s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment