Filter interviews by
I applied via Naukri.com
Hoisting is a JavaScript mechanism where variables and function declarations are moved to the top of their scope.
Variables declared with var are hoisted to the top of their scope
Function declarations are hoisted before variables
Function expressions are not hoisted
Let and const declarations are not hoisted
Promises are a way to handle asynchronous operations in JavaScript.
Promises represent a value that may not be available yet.
They have three states: pending, fulfilled, and rejected.
Promises can be chained using .then() and .catch() methods.
They help avoid callback hell and make code more readable.
Example: new Promise((resolve, reject) => { ... }).then(result => { ... }).catch(error => { ... })
ES6 features are modern JavaScript syntax and features that make code more concise and readable.
Arrow functions for concise function syntax
Template literals for easier string interpolation
Let and const for block-scoped variables
Destructuring for easily extracting values from objects and arrays
Spread and rest operators for easily manipulating arrays and objects
Classes for object-oriented programming
Modules for better co
Given an array of integers, return the sum of all even numbers.
Use Array.reduce() method to iterate over the array and sum the even numbers.
Use the modulo operator (%) to check if a number is even.
I applied via Naukri.com and was interviewed in Nov 2021. There was 1 interview round.
Top trending discussions
I applied via LinkedIn and was interviewed in Jun 2022. There was 1 interview round.
Event loop is a mechanism in JavaScript that allows for asynchronous operations to be executed in a non-blocking way.
Event loop is responsible for handling asynchronous operations in JavaScript.
It allows for non-blocking execution of code by moving asynchronous tasks to the event queue.
Event loop continuously checks the call stack and the event queue, moving tasks from the queue to the stack when the stack is empty.
Exa...
Closures are functions that have access to their own scope, as well as the scope in which they were defined.
Closures allow functions to access variables from their outer scope even after the outer function has finished executing.
They are commonly used to create private variables in JavaScript.
Closures are created whenever a function is defined within another function.
I applied via LinkedIn and was interviewed in Aug 2024. There was 1 interview round.
Event Loop is a mechanism in JavaScript that allows asynchronous operations to be executed in a non-blocking way.
Event Loop is responsible for handling the execution of code, callbacks, and I/O operations in JavaScript.
It continuously checks the call stack for any pending tasks and executes them in a sequential manner.
Event Loop ensures that the JavaScript engine is not blocked by long-running tasks, allowing for a smo...
Promises in JavaScript are objects representing the eventual completion or failure of an asynchronous operation.
Promises are used to handle asynchronous operations in JavaScript.
They can be in one of three states: pending, fulfilled, or rejected.
Promises can be chained using .then() to handle success and .catch() to handle errors.
Example: const myPromise = new Promise((resolve, reject) => { ... });
Dsa question were asked
Question related to profit loss
I applied via Naukri.com and was interviewed in Feb 2022. There was 1 interview round.
posted on 8 Mar 2021
React and Javascript
Coding test with technical discussion
posted on 8 Apr 2025
I appeared for an interview before Apr 2024, where I was asked the following questions.
In React, keys are unique identifiers for elements in a list, helping React optimize rendering and updates.
Keys help React identify which items have changed, are added, or are removed.
They should be unique among siblings but can be reused across different lists.
Using indexes as keys can lead to issues with component state and performance.
Example: <Component key={item.id} /> where item.id is a unique identifier.
Components in React re-render when state or props change, or when a parent component re-renders.
1. State Change: When a component's state is updated using setState, it triggers a re-render. Example: <MyComponent state={this.state} />.
2. Props Change: If a parent component passes new props to a child, the child re-renders. Example: <ChildComponent prop={newValue} />.
3. Context Change: If a component subscrib...
State and props are core concepts in React for managing data and component behavior.
State is a mutable object that holds data specific to a component.
Props (short for properties) are immutable data passed from parent to child components.
State can be updated using the setState method, while props are read-only.
Example of state: <Component state={{ count: 0 }} />; state can change with user interaction.
Example of p...
Flattening an array in JavaScript without using the flat method can be achieved using recursion or iteration.
Use recursion to iterate through each element and check if it's an array. Example: `function flatten(arr) { return arr.reduce((acc, val) => Array.isArray(val) ? acc.concat(flatten(val)) : acc.concat(val), []); }`
Utilize a loop to push elements into a new array. Example: `function flatten(arr) { let result = [...
Context in React allows for sharing values between components without prop drilling.
Context provides a way to pass data through the component tree without having to pass props down manually at every level.
It is created using React.createContext() which returns a Context object.
Components can subscribe to this Context object to read its current value using the useContext hook or Context.Consumer.
Example: const MyContext...
Code splitting in React allows loading parts of an application on demand, improving performance and reducing initial load time.
Use React.lazy() to dynamically import components: `const LazyComponent = React.lazy(() => import('./LazyComponent'));`
Wrap lazy-loaded components with Suspense to handle loading states: `<Suspense fallback={<div>Loading...</div>}><LazyComponent /></Suspense>`.
I...
Event looping in JavaScript manages asynchronous operations, allowing non-blocking execution of code.
JavaScript is single-threaded, meaning it can execute one command at a time.
The event loop allows JavaScript to perform non-blocking I/O operations by using a callback queue.
When an asynchronous operation completes, its callback is pushed to the queue, waiting for the call stack to be empty.
Example: setTimeout(() => ...
Unmounting components in React involves removing them from the DOM, typically during component lifecycle events.
Use the componentWillUnmount lifecycle method in class components to perform cleanup tasks.
In functional components, use the useEffect hook with a return function to handle cleanup.
Example: In a class component, you can clear timers or cancel network requests in componentWillUnmount.
Example: In a functional c...
In React, data can be passed from child to parent using callback functions as props.
Define a function in the parent component that will handle the data.
Pass this function as a prop to the child component.
In the child component, call the function with the data you want to send.
The parent component can then access the data through the function's parameters.
Example: In Parent, define 'handleData = (data) => { console.l...
based on 1 review
Rating in categories
Software Engineer
3.4k
salaries
| ₹2.7 L/yr - ₹12.8 L/yr |
Senior Software Engineer
2k
salaries
| ₹6 L/yr - ₹19.8 L/yr |
QA Engineer
1k
salaries
| ₹3.9 L/yr - ₹11 L/yr |
Senior QA Engineer
776
salaries
| ₹6.2 L/yr - ₹15 L/yr |
System Analyst
747
salaries
| ₹9.6 L/yr - ₹25 L/yr |
Mphasis
eClerx
L&T Technology Services
Coforge