diff --git a/.gitignore b/.gitignore index e4f2d48..7ff8bba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules docs/.vitepress/dist -.vscode \ No newline at end of file +.vscode +*.DS_Store* \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..36ef712 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,10 @@ +pipeline { + agent any + stages { + stage('Build') { + steps { + echo 'Building' + } + } + } +} \ No newline at end of file diff --git a/docs/interview/sd/basics.md b/docs/interview/sd/basics.md new file mode 100644 index 0000000..4d32313 --- /dev/null +++ b/docs/interview/sd/basics.md @@ -0,0 +1,23 @@ +# Basics of the Internet + +## Client-Server Model + +The internet is based on the client-server model. Servers are processes that provides services to clients, and clients are processes which request things from the servers. These machines find each other using their **IP addresses**, which are 4 numbers from 0 to 255 in a.b.c.d format, and communicate through **ports**. A **DNS**, or Domain Name Server, links domain names to IP addresses. + +::: details +Notable IP Addresses include 127.0.0.1 or localhost which is your own machine and +192.168.c.d are machines on your local network. Notable ports include 22 (ssh), 443 (https), +80 (http), and 53 (DNS lookup). +::: + +## Protocols + +The above method of communication is known as Internet Protocol. There are additional protocols built on top of IP. + +### TCP + +TCP allows for ordered, reliable data delivery between machines through connections. This also exposes **sockets** which allow applications to stream data through an open connection. + +### HTTP + +HTTP (HyperText Transfer Protocol) is implemented on top of TCP. This is the request-response model. Requests typically have a method, headers, and a body as well as origin information, and the request typically has a status and some kind of data. \ No newline at end of file diff --git a/docs/interview/sd/latency.md b/docs/interview/sd/latency.md new file mode 100644 index 0000000..8632962 --- /dev/null +++ b/docs/interview/sd/latency.md @@ -0,0 +1,13 @@ +# Latency + +Latency describes the time it takes for a machine to perform a certain operation. Every method of retrieving information has different time costs. A general rule of thumb: + +- Reading 1MB from RAM - 0.25ms +- Reading 1MB from SSD - 1ms +- Transfer 1MB over network - 10ms +- Reading 1MB from HDD - 20ms +- Intercontinental round-trip - 150ms + +## Throughput + +While latency measures the time operations take, throughput describes the number of operations that can be processed in a given amount of time, such as requests per second. \ No newline at end of file diff --git a/docs/interview/sidebar.json b/docs/interview/sidebar.json index 41326f8..63ca3d4 100644 --- a/docs/interview/sidebar.json +++ b/docs/interview/sidebar.json @@ -23,6 +23,8 @@ { "text": "System Design", "items": [ + {"text": "Basics of the Internet", "link": "/interview/sd/basics"}, + {"text": "Latency", "link": "/interview/sd/latency"}, {"text": "Scaling", "link": "/interview/sd/scaling"} ] }