Web Servers Flashcards

1
Q

How does Go handle many requests at the same time?

A

Go spawns a new goroutine for each request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an http.ServeMux?

A

It is a request multiplexer, which essentially a router for HTTP requests.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a fileserver?

A

A web server that serves static files from the host machine.

e.g.
- HTML
- CSS
- JS
- Images

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is http.Server?

A

A struct that describes a server configuration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a readiness endpoint?

A

Readiness endpoints are commonly used by external systems to check if our server is ready to receive traffic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What can make the code of handlers more DRY?

A

Middleware

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What other libraries apart from Go standard are used for routing?

A
  1. Gorilla Mux
  2. Chi
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which type of HTTP request is more common to send JSON data in the requested body?

A

POST request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is JSON Marshalling?

A

Marshaling a JSON file refers to the process of converting data structures or object instances into a JSON format

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the JSON keys in the following struct?
type parameters struct {
Name string json:"name"
Age int json:"age"
School struct {
Name string json:"name"
Location string json:"location"
} json:"school"
}

A

name, age, school, school.name, school.location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the JSON keys in the following struct?
type parameters struct {
name string json:"name"
Age int json:"age"
}

A

age

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the JSON keys in the following struct?
type parameters struct {
Name string
Age int
}

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly