Xcelore
10+ Adam Vacations Interview Questions and Answers
Q1. Difference Between RestApi and Graphql ?
REST API is a standard protocol for web services using HTTP, while GraphQL is a query language for APIs.
REST API follows a client-server architecture with stateless communication, while GraphQL allows clients to request only the data they need.
REST API typically uses multiple endpoints for different resources, while GraphQL uses a single endpoint for flexible data retrieval.
REST API has predefined data structures, while GraphQL allows clients to define the structure of the re...read more
Q2. What is Callback Hell?
Callback Hell is a situation in asynchronous programming where multiple nested callbacks make the code hard to read and maintain.
Occurs when multiple asynchronous operations are nested within each other
Leads to deeply nested code which is hard to read and maintain
Can be avoided by using Promises or async/await syntax
Q3. What is Async/Await ?
Async/Await is a feature in JavaScript that allows for asynchronous programming using promises.
Async/Await is syntactic sugar built on top of promises in JavaScript.
It allows for writing asynchronous code that looks synchronous, making it easier to read and maintain.
Async functions return a promise, which allows for chaining multiple asynchronous operations.
Await keyword is used inside async functions to wait for a promise to resolve before continuing.
Example: async function ...read more
Q4. Code A Todo List in React ?
A simple Todo List app built using React
Create a new React project using create-react-app
Create a Todo component to display the list of todos
Use state to manage the list of todos and input field for adding new todos
Implement functionality to add, delete, and mark todos as completed
Q5. What is Hoisting?
Hoisting is a JavaScript mechanism where variable and function declarations are moved to the top of their containing scope during compilation.
Variable and function declarations are hoisted to the top of their scope.
Only declarations are hoisted, not initializations.
Function declarations take precedence over variable declarations.
Hoisting can lead to unexpected behavior if not understood properly.
Q6. What is Closures?
Closures are functions that have access to variables from their containing scope even after the parent function has finished executing.
Closures allow functions to maintain access to variables from their outer scope
They are created when a function is defined within another function
Closures are commonly used in event handlers and callbacks
Q7. What is Promises?
Promises are a way to handle asynchronous operations in JavaScript, providing a cleaner alternative to callbacks.
Promises represent the eventual completion (or failure) of an asynchronous operation.
They allow you to chain multiple asynchronous operations together.
Promises have states: pending, fulfilled, or rejected.
You can handle the result of a promise using .then() and .catch() methods.
Example: const myPromise = new Promise((resolve, reject) => { ... });
Q8. What is event loop in javascript?
Event loop in JavaScript is a mechanism that allows asynchronous non-blocking code execution.
Event loop is responsible for handling asynchronous operations in JavaScript.
It continuously checks the call stack and the callback queue to see if there are any functions that need to be executed.
Event loop ensures that JavaScript remains single-threaded and non-blocking.
Example: setTimeout() function in JavaScript uses the event loop to schedule the execution of a function after a s...read more
Q9. What is cors middleware?
CORS middleware is used to enable Cross-Origin Resource Sharing in web applications.
CORS middleware allows servers to specify who can access their resources
It adds necessary headers to HTTP responses to allow cross-origin requests
Common CORS middleware libraries include 'cors' in Node.js and 'django-cors-headers' in Django
Q10. Explain Middlewares in NodeJS Express
Q11. Explain about API Security
Q12. NodeJS Event Loop in Depth
Interview Process at Adam Vacations
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month