Study for Interview Flashcards

1
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
2
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
3
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
4
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
5
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
6
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
7
Q

What is the difference between a SQL and NoSQL database?

A

SQL is a relational data model (all data is structured the same, vertically scalable)
NoSQL is a document data model (data can be structured differently, horizontally scalable)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
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
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
- example:
$("#btn_1").click(function() {
	  alert("Btn 1 Clicked");
	});
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a closure function?

A

A closure is an inner function that has access to the outer (enclosing) function’s variables and the global variables

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

What is a recursive function?

A
  • Recursive functions iterate over an operation repeatedly until it arrives at a result
  • Example:
    var factorial = function(number) {
    if (number <= 0) { // terminal case
    return 1;
    } else { // block to execute
    return (number * factorial(number - 1));
    }
    };
    console.log(factorial(6));
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are RESTful web services?

A
  • Representational State Transfers

Clients can make requests that elicits a response in HTML, XML or JSON format

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

Difference between PUT and PATCH?

A

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

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

What are common CRUD operations?

A

GET, POST, PUT, PATCH, DELETE

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

What are CRUD operations?

A

Create, Read, Update and Delete - requests made to the server in order to get a response.

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

What does MCV stand for?

A

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

17
Q

What are the most common npm apps being used?

A

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

18
Q

Describe the HTTP requests/response life cycle.

A

Client sends a request - request method and path are used to route to correct request handler.
Server sends a response object with status code and headers, and body if response has content

19
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
20
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.

21
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

22
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.