Codebuddy
Citicon Engineers Interview Questions and Answers
Q1. Write bug report. On scenario
Unable to login with correct credentials
Entered correct username and password
Clicked on login button
Error message displayed: 'Invalid username or password'
Q2. Write test case on apple
Test case for apple
Verify the apple is not rotten or spoiled
Check the weight and size of the apple
Ensure the apple is not bruised or damaged
Test the sweetness and texture of the apple
Confirm the apple is free from pesticides and chemicals
Q3. Is it advisable to use indexes as keys? If not, why?
No, it is not advisable to use indexes as keys in React components.
Using indexes as keys can lead to performance issues and incorrect behavior when reordering or deleting items in a list.
It is recommended to use unique IDs as keys to ensure proper component rendering and reconciliation.
Example:
- {items.map((item, index) =>
- {item} )}
Q4. When to use memoisation?
Memoisation should be used to optimize performance by caching expensive function calls.
Use memoisation when a function is computationally expensive and its output depends only on its input parameters.
Memoisation can be used to cache the results of recursive function calls to avoid redundant calculations.
In React, useMemo hook can be used to memoize the result of a function component to prevent unnecessary re-renders.
Memoisation is particularly useful in optimizing performance...read more
Q5. what are hooks in react
Hooks are a new addition in React 16.8 that allow you to use state and other React features without writing a class.
Hooks are functions that let you use state and other React features in functional components.
They allow you to reuse stateful logic without changing your component hierarchy.
Examples of hooks include useState, useEffect, useContext, etc.
Q6. What is hoisting?
Hoisting is a JavaScript mechanism where variable and function declarations are moved to the top of their containing scope.
Variable and function declarations are hoisted to the top of their scope during the compilation phase.
Only declarations are hoisted, not initializations.
Function declarations are hoisted before variable declarations.
Q7. What are keys and what are their uses?
Keys are unique identifiers for elements in a list in React, used for efficient rendering and updating.
Keys help React identify which items have changed, are added, or are removed in a list.
Keys should be unique among siblings, but don't need to be globally unique.
Using index as a key is not recommended as it can cause issues with component state.
Keys are important for performance optimization in React.
Example:
- {items.map((item) =>
- {item.name} )}
Q8. What is code splitting?
Code splitting is a technique used to split a large bundle of code into smaller chunks that can be loaded on demand.
Code splitting helps improve performance by reducing initial load times.
It allows for lazy loading of code, meaning only the necessary code is loaded when needed.
Commonly used in React applications using dynamic imports or React.lazy().
Q9. React without JSX
React can be used without JSX by using React.createElement() method.
React.createElement() method can be used to create React elements without JSX.
JSX is just syntactic sugar for React.createElement() calls.
Example: React.createElement('div', {className: 'container'}, 'Hello, World!')
Interview Process at Citicon Engineers
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month