All fields

“Effects & Lifecycle” in Information Technology

26 questions across 1 technology.

Information Technology

26 questions in 1 technology

#QuestionTechnologyTopicLevel
1What is the difference between useEffect and code that runs directly during rendering? React › Effects & LifecycleReactEffects & LifecycleBeginner
2How would you fetch data safely inside useEffect while avoiding a common bug called a race condition? React › Effects & LifecycleReactEffects & LifecycleAdvanced
3What is the useEffect hook used for in React? React › Effects & LifecycleReactEffects & LifecycleBeginner
4What does the dependency array in useEffect actually control? React › Effects & LifecycleReactEffects & LifecycleIntermediate
5How do you clean up an effect in React, and why is it important? React › Effects & LifecycleReactEffects & LifecycleIntermediate
6What does componentDidMount do in a class component and what is its equivalent using hooks? React › Class Components & Legacy Lifecycle MethodsReactClass Components & Legacy Lifecycle MethodsIntermediate
7What is componentDidUpdate used for, and what mistake should you watch out for when using it? React › Class Components & Legacy Lifecycle MethodsReactClass Components & Legacy Lifecycle MethodsAdvanced
8Why does Strict Mode call component functions and certain effects twice during development? React › Strict Mode & Concurrent FeaturesReactStrict Mode & Concurrent FeaturesIntermediate
9What is a custom hook in React and why would you create one? React › Custom HooksReactCustom HooksBeginner
10What problem do libraries like React Query and SWR solve compared to fetching data with plain useEffect? React › Data Fetching (React Query & SWR)ReactData Fetching (React Query & SWR)Beginner
11Why is it usually better to use a data fetching library instead of writing your own fetch logic in every component? React › Data Fetching (React Query & SWR)ReactData Fetching (React Query & SWR)Beginner
12What does the useState hook do, and how do you use it? React › HooksReactHooksBeginner
13What is a ref in React and what is it used for? React › Refs, useRef & forwardRefReactRefs, useRef & forwardRefBeginner
14What is React Strict Mode and what does it actually do? React › Strict Mode & Concurrent FeaturesReactStrict Mode & Concurrent FeaturesBeginner
15What is useLayoutEffect and how is it different from the regular useEffect hook? React › Concurrent Hooks (useTransition, useDeferredValue & useLayoutEffect)ReactConcurrent Hooks (useTransition, useDeferredValue & useLayoutEffect)Intermediate
16How would you write a custom hook to fetch data from an API and share that logic across components? React › Custom HooksReactCustom HooksIntermediate
17Why does React not catch errors that happen inside event handlers, like an onClick function, using error boundaries? React › Error BoundariesReactError BoundariesIntermediate
18What is the useMemo hook and how does it help with performance? React › HooksReactHooksIntermediate
19How is useRef different from useState when it comes to storing a value? React › Refs, useRef & forwardRefReactRefs, useRef & forwardRefIntermediate
20How would you use a ref to keep track of a component's previous prop value? React › Refs, useRef & forwardRefReactRefs, useRef & forwardRefIntermediate
21What is hydration mismatch, and what commonly causes this error in a React app using server rendering? React › Static Site Generation (SSG) & HydrationReactStatic Site Generation (SSG) & HydrationIntermediate
22How would you test a component that fetches data when it first appears on the screen? React › TestingReactTestingIntermediate
23How does React's reconciliation process handle components of a completely different type appearing in the same position? React › Virtual DOM & ReconciliationReactVirtual DOM & ReconciliationIntermediate
24How would you manage focus properly in a React modal to keep it accessible? React › Accessibility (a11y) in ReactReactAccessibility (a11y) in ReactAdvanced
25How would you build a custom hook that debounces a fast changing value, such as text typed into a search box? React › Custom HooksReactCustom HooksAdvanced
26How would you use React DevTools to find out why a component re rendered when you did not expect it to? React › React DevTools & DebuggingReactReact DevTools & DebuggingAdvanced