Birlasoft
Larsen & Toubro Limited Interview Questions and Answers
JavaScript design patterns are reusable solutions to common problems in software design.
Some common design patterns in JavaScript include Module, Singleton, Observer, Factory, and Prototype.
Module pattern helps in creating encapsulated modules with private and public methods.
Singleton pattern ensures a class has only one instance and provides a global point of access to it.
Observer pattern allows objects to subscribe and unsubscribe to events and be notified of changes.
Factor...read more
A state in React is a JavaScript object that stores data relevant to a component and can be updated over time.
State is initialized in a component's constructor using this.state = {}
State can be updated using this.setState() method
State changes trigger re-rendering of the component
Slice is a method that extracts a portion of an array without modifying the original array, while splice is a method that adds or removes elements from an array.
Slice returns a shallow copy of a portion of an array based on start and end index parameters.
Splice can add new elements to an array or remove existing elements by specifying the start index and number of elements to remove.
Example: const arr = [1, 2, 3, 4, 5]; arr.slice(1, 3) will return [2, 3], while arr.splice(1, ...read more
Prototype chain in JavaScript is the mechanism by which objects inherit properties and methods from other objects.
In JavaScript, each object has a private property which holds a link to another object called its prototype.
If a property or method is not found on an object, JavaScript will look for it in the object's prototype, and so on up the chain.
This allows for inheritance in JavaScript, where objects can inherit properties and methods from their prototypes.
React context is a built-in feature for passing data through the component tree, while React Redux is a library for managing global state in React applications.
React context is used for passing data down the component tree without having to pass props manually at every level.
React Redux is a library that provides a centralized store for managing global state in a React application.
React context is built into React, while React Redux is a separate library that needs to be inst...read more
Closures are functions that have access to variables from their containing scope even after the function has finished executing.
Closures allow functions to access variables from their outer scope
They maintain a reference to the variables even after the outer function has finished executing
Closures are commonly used in event handlers and callbacks
Q7. Xa and non xa difference
XA is a distributed transaction protocol while non-XA is not.
XA is used for distributed transactions that involve multiple resources.
Non-XA is used for local transactions that involve a single resource.
XA ensures transactional consistency across multiple resources.
Non-XA does not provide transactional consistency across multiple resources.
XA involves a two-phase commit protocol while non-XA does not.
Interview Process at Larsen & Toubro Limited
Top Senior Software Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month