Thursday, November 2, 2023

Backend API interview Question

1) How to improve performance?

2) PATCH  (Partial Update):PUT (Replace or Full Update):

3) Do you know what is Database Indexes ? Database Primary Index have only one / Secondary Index 

4) Concept of middleware in Express.js

    execute code during the request-response cycle. Middleware functions have access to the request object (req), the response object (res), and the next function in the application's request-response cycle. They can perform tasks, modify the request or response objects, and either terminate the cycle or pass control to the next middleware function by invoking the next function. Middleware functions in Express.js can be used for various purposes, such as logging, authentication, handling errors, modifying the request or response, and more.

5) What is the purpose of the async and await keywords in Node.js?

  • Answer: async and await are used to work with Promises in a more synchronous style. The async keyword is used to declare an asynchronous function, and await is used inside an async function to pause execution until the Promise is resolved.

No comments:

Post a Comment