Server Side Questions Flashcards

1
Q

What are the parts of this url https://github.com/mariusbanea/web-developers-toolkit/?key=value&anotherKey=differentValue?

A

http / https ===> the access protocol
github.com ===> domain name
mariusbanea / web-developers-toolkit ===> both are parameters / routes that we get to send to the domain name (mariusbanea = username; web-developers-toolkit = repository name)
/?key=value&anotherKey=differentValue ===> are usually query that we get to send to the domain name (mariusbanea = username; web-developers-toolkit = repository name)
URLS structure: PROTOCOL + DOMAIN NAME + PARAMETERS + QUERIES

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

What are the typical parts of a server js file?

A
  • import external resources (i.e. Express)
  • api end points (app.get)
  • app listen with the port settings (app.listen)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Is Node primarily a sync or async programing language?

A

Async ( it’s built on callbacks https://github.com/mariusbanea/web-developers-toolkit/blob/master/js/callback-function-example.html)

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

How many threads does node have?

A

1 thread (thread = an operation that is happening in the same time with another one)

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

What are the projects suitable for node?

A

Single thread websites with simple NoSQL DBs and API support

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

What are the three definitions of Mongoose?

A
  1. A middleware connecting the Controller with the Model
  2. “validation” layer (validates data between the controller and the model)
  3. Object Document Mapper (maps the connection between the Documents inside the DB with the Objects in the controller)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How many threads does node have

A

1 thread (thread = an operation that is happening in the same time with another one)

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

Is Node primarily a sync or async programing language

A

Async ( it’s built on callbacks )

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

What is a callback function?

A

A callback is function which is sent as a parameter to another function in order to be used after the initial function runs

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

What is the difference between a SQL database and a NoSQL database?

A

SQL (Structured Query Language) is a relational data model and NoSQL is a document data model

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

What projects are suitable for node?

A

Single thread websites with simple NoSQL DBs and API support

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

What is the DOM?

A

Document-Object-Model, a copy of the code from the server that can be manipulated with javascript

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

What are the parts of a url?

A

protocol: domain name/parameters ? queries

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

What is the difference between callback, closure, and recursive functions?

A
  • Callback functions are parameters inside of another function that are called after the initial function runs.
  • Closures are functions that is written inside another function so the scope of the inner function is protected
  • Recursive functions are functions that calls itself repeatedly until the function ends
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are RESTful web services?

A

Clients can make requests to a resources URI that elicits response in HTML, XML or JSON format
- Representational State Transfers

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

Difference between PUT and PATCH?

A

PUT is used to update a resource and PATCH is used to modify it

17
Q

What are CRUD operations?

A

Create, Read, Update and Delete - requests made to the server in order to get a response. Typically use GET, POST, PUT, PATCH and DELETE

18
Q

What does MCV stand for?

A

Model (database), Controller (server), View (client)

19
Q

What are the most common npm apps being used?

A

express, mocha, chai, morgan, faker, bcryptjs, body-parser, mongo, mongoose

20
Q

Describe the HTTP requests/response life cycle.

A

The client sends a request and the server sends a response

21
Q

Describe the architecture of a basic Express app. How is it organized?

A
  • a way to listen for HTTP requests over a port
  • a way to inspect and interact with HTTP request and response objects
  • a way to route HTTP requests from clients to the right request handlers
  • a way to serve static assets to client browsers (e.g., our route for /)
  • a way to serve data to clients
22
Q

Describe how a Mongo database is structured

A

Mongo is made up of collections of documents.
A document is an object comprised of keys and values. Mongo accepts strings, integers, floating point decimals, booleans, null, arrays, objects, timestamps, and object ids as value types.

23
Q

What is the purpose of bcrypt in the authentication process?

A

bcrypt is an adaptive function: over time, the iteration count can be increased to make it slower, so it remains resistant to brute-force search attacks

24
Q

How do JSON web tokens work?

A

JWT digitally signs tokens to prevent fraud. When the server generates the token, it generates a signature by combining the contents of the token with a secret private key using an encryption algorithm.