All fields

“Custom Hooks” in Information Technology

50 questions across 5 technologies.

Information Technology

50 questions in 5 technologies

#QuestionTechnologyTopicLevel
1What are the rules you must follow when writing and using hooks, including custom hooks? React › Custom HooksReactCustom HooksIntermediate
2What is a custom hook in React and why would you create one? React › Custom HooksReactCustom HooksBeginner
3How is a custom hook different from a regular helper function? React › Custom HooksReactCustom HooksBeginner
4How would you write a custom hook to fetch data from an API and share that logic across components? React › Custom HooksReactCustom HooksIntermediate
5How would you build a custom hook that debounces a fast changing value, such as text typed into a search box? React › Custom HooksReactCustom HooksAdvanced
6What are the downsides of higher order components that led many developers to prefer custom hooks instead? React › Higher-Order Components (HOCs)ReactHigher-Order Components (HOCs)Advanced
7Why can you not use React hooks like useState inside the custom Document component? Next.js › Custom App & Document in Pages RouterNext.jsCustom App & Document in Pages RouterIntermediate
8What are hooks in React and why were they introduced? React › HooksReactHooksBeginner
9What are the rules of hooks, and why do they exist? React › HooksReactHooksAdvanced
10How do lifecycle hooks in Auto Scaling Groups let you customize instance launch and termination behavior? AWS › Auto Scaling GroupsAWSAuto Scaling GroupsAdvanced
11How does useDeferredValue help improve performance when rendering a large list based on user input? React › Concurrent Hooks (useTransition, useDeferredValue & useLayoutEffect)ReactConcurrent Hooks (useTransition, useDeferredValue & useLayoutEffect)Advanced
12How do you create and use a custom Context in React step by step? React › Context APIReactContext APIIntermediate
13How would you build a custom hook to make using a specific Context simpler and safer? React › Context APIReactContext APIIntermediate
14How does the async pipe simplify working with observables directly in an Angular template? Angular › Pipes (Built-in & Custom)AngularPipes (Built-in & Custom)Intermediate
15How would you rewrite a render props component as a custom hook instead? React › Render Props PatternReactRender Props PatternAdvanced
16How do you make a custom React component keyboard accessible? React › Accessibility (a11y) in ReactReactAccessibility (a11y) in ReactIntermediate
17How do you handle CRDs and their custom resources syncing in the right order? ArgoCD › Sync & HealthArgoCDSync & HealthAdvanced
18How can you customize health checks for third-party or custom resources? ArgoCD › Sync & HealthArgoCDSync & HealthAdvanced
19How would you animate a button so it grows slightly when a user hovers over it? React › Animation in React (Framer Motion & React Spring)ReactAnimation in React (Framer Motion & React Spring)Beginner
20How do you render a list of items in React using the map function? React › Conditional Rendering & Lists (Keys)ReactConditional Rendering & Lists (Keys)Beginner
21What problem does the Context API solve in React? React › Context APIReactContext APIBeginner
22What 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
23Why 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
24What is the useEffect hook used for in React? React › Effects & LifecycleReactEffects & LifecycleBeginner
25What is internationalization in a React app and why is it important? React › Internationalization (i18n) in ReactReactInternationalization (i18n) in ReactBeginner
26How would you let a user switch the language of an app using a simple dropdown menu? React › Internationalization (i18n) in ReactReactInternationalization (i18n) in ReactBeginner
27What is a simple real world example of when useMemo actually helps a React app? React › Performance (memo/useMemo)ReactPerformance (memo/useMemo)Beginner
28What is a simple real world example of the render props pattern being useful? React › Render Props PatternReactRender Props PatternBeginner
29What is Redux and what problem does it solve for larger React apps? React › State Management Libraries (Redux, Zustand & Recoil)ReactState Management Libraries (Redux, Zustand & Recoil)Beginner
30Should you leave Strict Mode enabled in your app permanently, or only use it temporarily? React › Strict Mode & Concurrent FeaturesReactStrict Mode & Concurrent FeaturesBeginner
31What is React Testing Library and how does its approach to testing differ from testing internal implementation details? React › TestingReactTestingBeginner
32What is the difference between a unit test and a component test in a React app? React › TestingReactTestingBeginner
33How does React Spring differ from Framer Motion in the way it creates animations? React › Animation in React (Framer Motion & React Spring)ReactAnimation in React (Framer Motion & React Spring)Intermediate
34What is the container and presentational component pattern in React? React › Design Patterns in ReactReactDesign Patterns in ReactIntermediate
35How do you clean up an effect in React, and why is it important? React › Effects & LifecycleReactEffects & LifecycleIntermediate
36What is a higher order component in React? React › Higher-Order Components (HOCs)ReactHigher-Order Components (HOCs)Intermediate
37How would you use a higher order component to add authentication protection to a page? React › Higher-Order Components (HOCs)ReactHigher-Order Components (HOCs)Intermediate
38How would you use a ref to keep track of a component's previous prop value? React › Refs, useRef & forwardRefReactRefs, useRef & forwardRefIntermediate
39What is the render props pattern in React? React › Render Props PatternReactRender Props PatternIntermediate
40What is a common naming alternative to render props, using children as a function instead? React › Render Props PatternReactRender Props PatternIntermediate
41What is a downside of the render props pattern that developers should be aware of? React › Render Props PatternReactRender Props PatternIntermediate
42How do middleware, such as Redux Thunk, help handle asynchronous operations like API calls in Redux? React › State Management Libraries (Redux, Zustand & Recoil)ReactState Management Libraries (Redux, Zustand & Recoil)Intermediate
43Why does Strict Mode call component functions and certain effects twice during development? React › Strict Mode & Concurrent FeaturesReactStrict Mode & Concurrent FeaturesIntermediate
44How do you properly type the useState hook in a React component using TypeScript? React › TypeScript with ReactReactTypeScript with ReactIntermediate
45Why is it important to unsubscribe from an RxJS observable, and what are common ways to do this correctly in Angular? Angular › RxJS & ObservablesAngularRxJS & ObservablesIntermediate
46How would you build a reusable error boundary that lets the user retry after an error occurs? React › Error BoundariesReactError BoundariesAdvanced
47How does React Hook Form simplify building forms compared to managing every field with useState manually? React › Forms: Controlled & Uncontrolled ComponentsReactForms: Controlled & Uncontrolled ComponentsAdvanced
48How would you use the React Profiler to find which components are causing performance problems? React › Performance (memo/useMemo)ReactPerformance (memo/useMemo)Advanced
49How would you protect certain routes so only logged in users can access them? React › RoutingReactRoutingAdvanced
50How does the useFormStatus hook help show loading feedback while a server action is running? React › Server Actions & Data MutationsReactServer Actions & Data MutationsAdvanced