UnderStanding Asynchronous Code, and API's
... About 1 min
# UnderStanding Asynchronous Code, and API's
1. What is the difference between asynchronous
code and synchronous
code?
Synchronus code is executed in order, meanwhile asyncrhonous code doesn't have to wait for the previous statement to finish, and your program can continue to run reducing wait time for the user.
1
2. What is an event listener?
A procedure in JavaScript that waits for an event to occur such as clicking the mouse.
1
3. What does the O
represent in the SOLID
principles?
Open Closed Principle.
1
4. What is a callback / higher order function?
A callback function is a function that is passed to another function with the expectation that the other function will call it.
1
2
2
5. What is a promise
? How do you capture an error from a promise
?
A promise basically is an asynchronous action. You can capture an error by using try catches and catching the error with console.error(error)
1
6. Name three processes used to make requests over HTTP
?
Get, Post, Delete
1
7. What does the API
acronym stand for?
Application Programming Interface.
1
2
2
8. In the MVC
design pattern, who is responsible for making calls to APIs
?
The Service
1
9. What is the purpose of encapsulation in programming?
Encapsulation is used to organize your application so that everything can be modified without completely breaking your application.
1
10. What is HTTP
response code for a successful request?
200-299
1
11. What is a 500 error?
500 Errors mean that something has gone wrong with the server, but the server can't be more specific on what the error was.
1