All fields

“Design Patterns in React” in Information Technology

35 questions across 4 technologies.

Information Technology

35 questions in 4 technologies

#QuestionTechnologyTopicLevel
1What is the single responsibility principle and how does it apply to writing React components? React › Design Patterns in ReactReactDesign Patterns in ReactBeginner
2What is the container and presentational component pattern in React? React › Design Patterns in ReactReactDesign Patterns in ReactIntermediate
3What is the compound component pattern in React, and when is it useful? React › Design Patterns in ReactReactDesign Patterns in ReactAdvanced
4What is the provider pattern in React and how does it relate to the Context API? React › Design Patterns in ReactReactDesign Patterns in ReactAdvanced
5What is the controlled component pattern and why is it considered a best practice for forms? React › Design Patterns in ReactReactDesign Patterns in ReactIntermediate
6How does the Observer pattern let objects react automatically to events occurring in another object, and where is this pattern commonly used in PHP applications? PHP › Design Patterns in PHPPHPDesign Patterns in PHPIntermediate
7How do you handle pluralization correctly across different languages in an internationalized React app? React › Internationalization (i18n) in ReactReactInternationalization (i18n) in ReactAdvanced
8How would you implement the Observer pattern in Java, and how does it compare to using the built-in PropertyChangeSupport or a reactive streams library? Java › Design Patterns in JavaJavaDesign Patterns in JavaAdvanced
9What are CSS Modules and how do they prevent class names from clashing between components? React › Styling in React (CSS Modules, Styled Components & Tailwind)ReactStyling in React (CSS Modules, Styled Components & Tailwind)Beginner
10What is a general guideline for choosing between plain CSS, CSS Modules, styled components, and Tailwind for a new project? React › Styling in React (CSS Modules, Styled Components & Tailwind)ReactStyling in React (CSS Modules, Styled Components & Tailwind)Beginner
11What is dangerouslySetInnerHTML and why does its name include the word dangerously? React › Security in React (XSS & dangerouslySetInnerHTML)ReactSecurity in React (XSS & dangerouslySetInnerHTML)Intermediate
12How does styled components let you write CSS directly inside your JavaScript files? React › Styling in React (CSS Modules, Styled Components & Tailwind)ReactStyling in React (CSS Modules, Styled Components & Tailwind)Intermediate
13How would you conditionally apply different CSS classes based on a component's state, such as showing an active style? React › Styling in React (CSS Modules, Styled Components & Tailwind)ReactStyling in React (CSS Modules, Styled Components & Tailwind)Advanced
14What is the difference between a unit test and a component test in a React app? React › TestingReactTestingBeginner
15What is snapshot testing in React, and what are its benefits and drawbacks? React › TestingReactTestingIntermediate
16How would you create a reusable, generic React component using TypeScript, such as a list component that works with any data type? React › TypeScript with ReactReactTypeScript with ReactAdvanced
17Why is using an array's index as a key generally considered a bad practice? React › Conditional Rendering & Lists (Keys)ReactConditional Rendering & Lists (Keys)Intermediate
18How would you show multiple separate loading states for different sections of a page using several Suspense boundaries? React › Suspense & Concurrent RenderingReactSuspense & Concurrent RenderingIntermediate
19How do you conditionally render one of several possible components cleanly, without a long chain of if statements? React › Conditional Rendering & Lists (Keys)ReactConditional Rendering & Lists (Keys)Advanced
20How would you validate a form in React and show an error message to the user? React › Forms: Controlled & Uncontrolled ComponentsReactForms: Controlled & Uncontrolled ComponentsIntermediate
21What is a higher order component in React? React › Higher-Order Components (HOCs)ReactHigher-Order Components (HOCs)Intermediate
22Why should you avoid overusing useMemo and React.memo throughout an entire app? React › Performance (memo/useMemo)ReactPerformance (memo/useMemo)Intermediate
23What are Symfony events and event listeners, and how do they let different parts of an application react to something happening without tightly coupling that logic together? PHP › Symfony Framework EssentialsPHPSymfony Framework EssentialsIntermediate
24What is a React Portal and why would you use one? React › Portals & FragmentsReactPortals & FragmentsBeginner
25How do you decide which state management library, if any, is right for a specific React project? React › State Management Libraries (Redux, Zustand & Recoil)ReactState Management Libraries (Redux, Zustand & Recoil)Beginner
26How would you build a custom hook to make using a specific Context simpler and safer? React › Context APIReactContext APIIntermediate
27How would you manage a multi step form's state using useReducer instead of several separate useState calls? React › useReducer & Complex State LogicReactuseReducer & Complex State LogicIntermediate
28How do you pass extra data along with an action when using useReducer? React › useReducer & Complex State LogicReactuseReducer & Complex State LogicIntermediate
29How would you build a flexible component using multiple named slots instead of a single children prop? React › Component Composition & Children PropsReactComponent Composition & Children PropsAdvanced
30What 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
31How would you build a tooltip using a Portal so it always appears above everything else on the page? React › Portals & FragmentsReactPortals & FragmentsAdvanced
32How does MutationObserver let you react to DOM changes made by other code? JavaScript › DOM & EventsJavaScriptDOM & EventsAdvanced
33How is a custom hook different from a regular helper function? React › Custom HooksReactCustom HooksBeginner
34What does it mean for state to be normalized, and why does this matter for larger apps? React › State ManagementReactState ManagementIntermediate
35How would you build a reusable error boundary that lets the user retry after an error occurs? React › Error BoundariesReactError BoundariesAdvanced