Filter interviews by
I applied via Job Portal and was interviewed in Jun 2024. There was 1 interview round.
Strategy pattern is a behavioral design pattern that allows selecting an algorithm at runtime.
Used strategy pattern in a shopping cart application to dynamically apply different discount strategies based on user type (e.g. regular customer, premium customer)
Implemented strategy pattern in a payment processing system to handle different payment methods (e.g. credit card, PayPal, Apple Pay)
Utilized strategy pattern in a ...
Dependency injection is a design pattern where components are provided with their dependencies rather than creating them internally.
Dependency injection helps in making components more modular and easier to test.
It allows for better separation of concerns by decoupling the creation of dependencies from their usage.
There are different types of dependency injection such as constructor injection, setter injection, and int...
Singleton pattern ensures a class has only one instance and provides a global point of access to it.
Used to control access to a shared resource such as a database connection or a logger instance
Implemented by creating a class with a method that creates a new instance only if one doesn't exist, and returns the existing instance if it does
Commonly used in React applications for managing global state with Redux or Context
Virtual DOM is a lightweight copy of the actual DOM in React, used for efficient updates.
Virtual DOM is a concept where a lightweight copy of the actual DOM is created in memory.
React uses the virtual DOM to efficiently update the actual DOM when there are changes in the application state.
By comparing the virtual DOM with the actual DOM, React determines the minimal number of changes needed to update the UI.
This helps ...
SCSS provides benefits such as variables, nesting, mixins, and inheritance for more efficient and maintainable CSS code.
Variables allow for easy reuse of values throughout stylesheets.
Nesting helps to organize CSS rules in a more intuitive way.
Mixins enable the reuse of styles across different elements.
Inheritance allows styles to be inherited from one selector to another.
SCSS can help improve code readability and main
Flexbox is a layout model in CSS used for creating flexible and responsive layouts.
Flexbox allows for easy alignment and distribution of items within a container.
It provides a more efficient way to design complex layouts compared to traditional CSS methods.
Flexbox properties include justify-content, align-items, flex-direction, and flex-wrap.
I applied via Naukri.com and was interviewed in Dec 2024. There was 1 interview round.
I applied via Recruitment Consulltant and was interviewed in Sep 2024. There was 1 interview round.
Hosting is the process of storing a website or application on a server, while closure is a function that retains access to variables from its parent scope.
Hosting involves storing a website or application on a server to make it accessible on the internet.
Closure is a function that retains access to variables from its parent scope, even after the parent function has finished executing.
var, let, and const are used to declare variables in JavaScript. var has function scope, let has block scope, and const is a constant with block scope.
var has function scope, meaning it is accessible throughout the function it is declared in.
let has block scope, meaning it is only accessible within the block it is declared in.
const is similar to let in terms of block scope, but the value cannot be reassigned.
Asynchronous programming allows tasks to run independently of the main program flow, improving performance and responsiveness.
Asynchronous code does not block the main thread, allowing other tasks to continue while waiting for a response.
Callbacks, promises, and async/await are common ways to handle asynchronous operations in JavaScript.
Example: fetching data from an API while the rest of the application continues to r
The output for the given code snippets will be: 1) 20 2) ReferenceError: Cannot access 'b' before initialization 3) ReferenceError: b is not defined
In the first snippet, variable 'a' is declared using 'var' after it is assigned a value, so it logs 20 without any issues.
In the second snippet, variable 'b' is declared using 'let' after it is assigned a value, so it throws a ReferenceError as 'b' is accessed before initia...
Centered div with text and animation using HTML and CSS
Create a div element with text inside
Apply CSS styles to center the div on the page
Use CSS animations to add animation effects
Semantic tags are HTML tags that provide meaning to the content they enclose, helping search engines and screen readers understand the structure of a webpage.
Semantic tags help improve SEO by providing context to search engines.
They also improve accessibility for screen readers by clearly defining the structure of a webpage.
Examples of semantic tags include
Use media queries, flexible grids, and relative units to create a responsive web page.
Use media queries to apply different styles based on screen size
Create flexible grids using CSS Grid or Flexbox
Use relative units like percentages or ems for sizing elements
Consider using frameworks like Bootstrap or Material-UI for responsive design
Test your design on different devices and screen sizes
SASS is a preprocessor scripting language that is interpreted into CSS, offering more features and flexibility.
SASS is a preprocessor for CSS, allowing for variables, nesting, and mixins to be used in stylesheets.
SASS code needs to be compiled into CSS before being used in a web project.
SASS helps in writing cleaner and more organized CSS code, making it easier to maintain and update styles.
CSS is the styling language ...
Form validation can be done using HTML attributes like required, pattern, and maxlength. Phone number validation with country code can be achieved using regex.
Use the 'required' attribute to make fields mandatory
Use the 'pattern' attribute with regex to validate input format
Use the 'maxlength' attribute to limit the number of characters in a field
For phone number validation with country code, use regex to match the des...
I use Jest for testing React applications due to its simplicity and integration with React ecosystem.
Jest is the most popular test library for React applications
It comes pre-configured with Create React App and has great support for snapshot testing
Jest also has built-in mocking capabilities which make it easy to test components with dependencies
Mounting is the process of rendering a component into the DOM, while shallow rendering allows testing a component without rendering its children.
Mounting is the initial phase of the component lifecycle where the component is rendered into the DOM.
Shallow rendering in testing library renders only the component itself, not its children.
Shallow rendering is useful for isolating the component being tested and avoiding rend...
Redux Toolkit is the official, recommended way to write Redux logic. It simplifies the process of managing state in React applications.
Redux Toolkit provides a set of tools and best practices to streamline Redux development.
It includes utilities like createSlice, createReducer, and configureStore to simplify the code and reduce boilerplate.
Redux Toolkit also includes built-in Immer integration for writing immutable upd...
API calls in Redux are typically handled using middleware like Redux Thunk. User name can be retrieved from Redux state and displayed in components.
Use Redux Thunk middleware to make API calls in Redux
Dispatch actions to update Redux state with API response data
Access user name from Redux state in components to display it
Thunk middleware in Redux allows for asynchronous logic to be handled in Redux actions.
Thunk middleware allows for dispatching functions instead of just plain objects in Redux actions.
It enables handling asynchronous API calls within Redux actions.
Thunk middleware helps in simplifying the code by moving complex logic outside of components.
Example: Thunk middleware can be used to dispatch an action after a delay or to f...
posted on 10 Dec 2024
I applied via Approached by Company and was interviewed in Nov 2024. There were 2 interview rounds.
Virtual DOM is a lightweight copy of the actual DOM, React key features include component-based architecture, declarative syntax, and virtual DOM, React Hooks are functions that let you use state and other React features without writing a class.
Virtual DOM is a lightweight copy of the actual DOM that React uses to improve performance by updating only the necessary parts of the DOM.
Key features of React include componen...
Counter application using Reactjs
Create a React component for the counter
Use state to keep track of the count
Implement functions to increment and decrement the count
Display the count on the screen
I applied via LinkedIn and was interviewed in Oct 2024. There was 1 interview round.
React offers advantages such as virtual DOM for improved performance, reusable components, and easy integration with other libraries.
Virtual DOM for efficient updates and improved performance
Reusable components for easier development and maintenance
Easy integration with other libraries like Redux for state management
Support for server-side rendering for better SEO performance
Performance optimization in React Js can be achieved through code splitting, memoization, virtualization, and minimizing re-renders.
Implement code splitting to load only necessary components when needed
Use memoization techniques like useMemo and useCallback to prevent unnecessary re-renders
Implement virtualization for long lists or tables to render only visible items
Minimize re-renders by using shouldComponentUpdate or
useMemo and useCallback are hooks in React used for optimizing performance by memoizing values and functions respectively.
useMemo is used to memoize the result of a function so that it is only recomputed when its dependencies change.
useCallback is used to memoize a function instance so that it is not recreated on every render unless its dependencies change.
Both hooks help in optimizing performance by preventing unneces...
Prop drilling is the process of passing props down multiple levels of nested components in React.
Prop drilling occurs when a prop needs to be passed through multiple levels of components that do not need the prop themselves.
It can lead to unnecessary passing of props through intermediate components, making the code harder to maintain.
To avoid prop drilling, you can use Context API, Redux, or React's useContext and useR...
Hoisting is a JavaScript mechanism where variable and function declarations are moved to the top of their containing scope during the compilation phase.
Variable declarations are hoisted to the top of their scope, but not their assignments.
Function declarations are fully hoisted, meaning they can be called before they are declared.
Hoisting can lead to unexpected behavior if not understood properly.
useContext hook allows components to access data from a context without passing props down manually
useContext hook is used to consume a context created by React.createContext
It takes the context object as an argument and returns the current context value for that context
It allows components to subscribe to context changes and re-render when the context value changes
posted on 8 Nov 2024
I applied via Naukri.com and was interviewed in May 2024. There were 2 interview rounds.
CORS error occurs when a web application makes a request to a different domain than the one it originated from.
CORS stands for Cross-Origin Resource Sharing
It is a security feature implemented by browsers to prevent unauthorized access to resources on a different domain
CORS error can be resolved by configuring the server to include the appropriate CORS headers in the response
Common CORS error messages include 'Access-C...
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() method to handle success and failure cases.
Promises help in avoiding callback hell and writing cleaner asynchronous code.
I applied via Job Portal and was interviewed in Aug 2024. There was 1 interview round.
They asked , some cording question related to react js , html
TCS
Accenture
Wipro
Cognizant