Study for Interview COPY Flashcards
What are the parts of a url?
protocol: domain name/parameters ? queries
What is the DOM?
Document-Object-Model, a copy of the code from the server that can be manipulated with javascript
What are the typical parts of a server js file?
- import external resources (i.e. Express)
- api end points (app.get)
- app listen with the port settings (app.listen)
Is Node primarily a sync or async programing language?
Async - it’s built on callbacks
How many threads does node have?
1 thread (thread = an operation that is happening in the same time with another one)
What are the projects suitable for node?
Single thread websites with simple NoSQL DBs and API support
What is the difference between a SQL and NoSQL database?
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)
What are the three definitions of Mongoose?
- A middleware connecting the Controller with the Model
- “validation” layer (validates data between the controller and the model)
- Object Document Mapper (maps the connection between the Documents inside the DB with the Objects in the controller)
What is a callback function?
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"); });
What is a closure function?
A closure is an inner function that has access to the outer (enclosing) function’s variables and the global variables
What is a recursive function?
- 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));
What are RESTful web services?
- Representational State Transfers
Clients can make requests that elicits a response in HTML, XML or JSON format
Difference between PUT and PATCH?
PUT is used to update a resource and PATCH is used to modify it
What are common CRUD operations?
GET, POST, PUT, PATCH, DELETE
What are CRUD operations?
Create, Read, Update and Delete - requests made to the server in order to get a response.