Infosys
Publicis Global Delivery Interview Questions and Answers
Q1. What is Stateless and Stateful component?
Stateless components are functional components that don't have state, while stateful components are class components that have state.
Stateless components are simpler and easier to test.
Stateful components can hold and modify state, and can trigger re-renders.
Stateless components can receive data through props.
Stateful components can have lifecycle methods.
Example of stateless component: const Button = ({ onClick }) =>
Example of stateful component: class Counter exten...read more
Q2. What are the lifecycle methods in React?
Lifecycle methods are methods that get called at various stages of a component's life.
componentDidMount() - called after component is mounted
shouldComponentUpdate() - determines if component should update
componentDidUpdate() - called after component is updated
componentWillUnmount() - called before component is unmounted
Q3. Difference between map and forEach method?
map returns a new array with modified elements, forEach executes a function for each element in an array.
map returns a new array, forEach does not
map modifies the elements of the array, forEach does not
map returns the same number of elements as the original array, forEach does not necessarily
forEach is used for side effects, map is used for transformation
Q4. What is Hoisting?
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 also hoisted to the top of their scope
Function expressions are not hoisted
Hoisting can lead to unexpected behavior if not understood properly
Q5. What is the sematic tag in HTML?
Semantic tags in HTML are special tags that provide meaning to the content they enclose.
Semantic tags help search engines and screen readers understand the structure of a webpage.
Examples of semantic tags include <header>, <footer>, <nav>, <article>, <section>, <aside>, <main>, <figure>, <figcaption>.
Using semantic tags improves SEO and accessibility of a website.
Q6. What is sdlc lifecycle?
SDLC lifecycle stands for Software Development Life Cycle, which is a process used by software development teams to design, develop, and test high-quality software.
SDLC lifecycle consists of several phases including planning, analysis, design, implementation, testing, and maintenance.
Each phase has its own set of activities and deliverables to ensure the successful completion of the software project.
Examples of SDLC models include Waterfall, Agile, and DevOps, each with its o...read more
Q7. How to do responsive design?
Responsive design is creating web applications that adapt to different screen sizes and devices.
Use media queries in CSS to adjust styles based on screen size
Utilize flexible grids and layouts to ensure content adjusts accordingly
Test the design on various devices and screen sizes to ensure responsiveness
Q8. What is Useeffect?
Useeffect is a hook in React that allows performing side effects in function components.
Useeffect is used to perform side effects in function components.
It runs after every render by default.
It can be used to fetch data, subscribe to events, or update the DOM.
It can also clean up effects by returning a function.
Dependencies can be specified to control when the effect runs.
Q9. What is useState?
useState is a hook in React that allows functional components to have state.
useState is a built-in hook in React.
It allows functional components to have stateful logic.
useState returns an array with two elements - the current state value and a function to update that value.
Example: const [count, setCount] = useState(0);
Interview Process at Publicis Global Delivery
Top React Developer Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month