Betterhalf.ai
Bharat Parenterals Interview Questions and Answers
Q1. How will you optimise Component in React?
Optimizing components in React involves using shouldComponentUpdate, memoization, lazy loading, and code splitting.
Use shouldComponentUpdate to prevent unnecessary re-renders
Memoize expensive calculations using useMemo or useCallback
Implement lazy loading for components that are not immediately needed
Utilize code splitting to load only necessary components when required
Q2. Machine coding ques in react to create a form
Create a form using React for machine coding interview
Use React components to create form elements
Handle form submission using state and event handlers
Validate form inputs before submission
Q3. useMemo vs useCallback
useMemo is used for memoization of values, while useCallback is used for memoization of functions.
useMemo is used to memoize a value and only recompute it when its dependencies change.
useCallback is used to memoize a function instance and only re-create it when its dependencies change.
Example: useMemo can be used to memoize the result of a complex computation, while useCallback can be used to memoize a callback function passed to a child component.
Q4. flatlist vs scrollview in RN
FlatList is optimized for long lists with dynamic data, while ScrollView is for small lists or content that needs to be scrolled.
FlatList is more performant for long lists as it only renders the items that are currently visible on the screen.
ScrollView is more suitable for smaller lists or content that does not need to be dynamically loaded.
FlatList supports key extraction for efficient rendering, while ScrollView does not have built-in support for this.
FlatList provides buil...read more
Q5. Hoisting in javascript
Hoisting is a JavaScript mechanism where variable and function declarations are moved to the top of their containing scope.
Variable declarations are hoisted to the top of their scope but not their initializations.
Function declarations are fully hoisted, meaning they can be called before they are declared.
Hoisting can lead to unexpected behavior if not understood properly.
Q6. Left view of binary tree
The left view of a binary tree is the set of nodes visible when the tree is viewed from the left side.
Traverse the tree level by level from left to right
At each level, add the first node encountered to the result array
Repeat this process for each level of the tree
Example: For a binary tree with root node 1, left child 2, and right child 3, the left view would be [1, 2]
Interview Process at Bharat Parenterals
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month