Concepts back-front Flashcards

1
Q

Can you define what the front-end and the back-end of an application does?

A

The front-end is the code that is executed on the client side. This code (typically HTML, CSS, and JavaScript) runs in the user’s browser and creates the user interface.

The back-end is the code that runs on the server, that receives requests from the clients, and contains the logic to send the appropriate data back to the client. The back-end also includes the database, which will persistently store all of the data for the application.

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

Give examples of clients

A

Mobile application, application running on another server, web enabled smart appliance.

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

What does the back-end typically includes?

A

The server. This is the computer that receives requests.
The app. This is the application running on the server that listens for requests, retrieves information from the database, and sends a response.
The database. Databases are used to organize and persist data.

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

What is a database, and what are the advantages of it?

A

Databases provide an interface to save data in a persistent way to memory. Storing the data in a database both reduces the load on the main memory of the serverCPUand allows the data to be retrieved if the server crashes or loses power. Reading and writing from static memory is fairly slow, and the database might be on a different machine than the original server.

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

What is an API

A

More specifically, aWeb APIis the interface (collection of clearly defined methods) created by the back-end: the collection of endpoints and the resources these endpoints expose. It is defined by the types of requests that it can handle, which is determined by the routes that it defines, and the types of responses that the clients can expect to receive after hitting those routes.

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

Describe the steps involved in a request

A
  1. A cliente makes a request through a website, containing information about the kind of request (GET) and the URI (uniform resource identifier).
  2. The request travel across the internet to a server.
  3. The server receives the request, and event listeners that match this request (the HTTP verb and the URI) are triggered. Middleware code runs on the server and executes a database query.
  4. The server receives the data it needs ant constructs and send the response to the client.
  5. The response travels across the internet and it is rendered in a browser.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the upsides of frameworks?

A
  1. Prevent code repetition.
  2. Provides great organization (files and code are organized in a highly modular way and really clean)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a curl request

A

Curl is a CLI tool that allows making HTTP requests to send and receive data from an API with HTTP methods (GET, POST, PUT, DELETE, etc.). It’s used for testing APIs, download files, interact with web servers, etc.

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

What are the most common response family status?

A

1xx → Informative
2xx → Request succeded
3xx → Redirection needed
4xx → Error caused by the client
5xx → Error caused by the server

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

Could you give examples of most common status and what they mean?

A

200 → Request successful
201 → Created
204 → No content

400 → Bad request (malformed or invalid)
401 → Unauthorized (auth is required)
403 → Forbidden (refused access even with auth)
404 → Not found

500 → Internal server error (generic)
502 - Bad Gateway → received an invalid response while trying to reach another service.
503 - Service Unavailable → overloaded or under maintenance.
504 - Gateway Timeout → took too long to get a response from another service.

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