Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

INT252 viva questions Web App Development With Reactjs

50 questions across 6 units, with answers. Say your answer out loud first, then check it.

All INT252 material

  1. Question 1 of 50Unit I, Refreshing JavaScriptEasy

    In the context of rendering lists in React, why do we prefer using the .map() array method over .forEach()?

  2. Question 2 of 50Unit I, ReactJS Installation & JSXIntermediate

    If I write a standard HTML 'class' attribute inside JSX, React throws a warning. Why does this happen, and what is the underlying technical reason regarding JavaScript?

  3. Question 3 of 50Unit I, ES6 RefresherIntermediate

    Scenario: You have a state object with user details. You want to update only the email address while keeping the rest of the properties intact. Which ES6 operator would you use and how?

  4. Question 4 of 50Unit II, React Virtual DOMHard

    Explain the concept of 'Reconciliation' in React. How does the Virtual DOM minimize performance costs compared to the real DOM?

  5. Question 5 of 50Unit II, Components and styles in ReactEasy

    What is the primary difference in scope between standard CSS stylesheets and CSS Modules in React?

  6. Question 6 of 50Unit II, Components (Functional vs Class)Intermediate

    Before Hooks were introduced, what was a major limitation of Functional Components compared to Class Components?

  7. Question 7 of 50Unit III, Understanding HooksIntermediate

    If I put a console.log immediately after a setFunction in useState (e.g., setCount(5); console.log(count)), I usually see the old value. Why?

  8. Question 8 of 50Unit III, Understanding HooksHard

    Compare useMemo and useCallback. In what specific scenario would you choose useCallback over useMemo?

  9. Question 9 of 50Unit III, Component LifecycleIntermediate

    In a Class Component, we use componentWillUnmount to clean up resources. How do we achieve this exact same behavior using the useEffect hook?

  10. Question 10 of 50Unit III, Understanding HooksIntermediate

    What happens if you use the useRef hook to store a value and then change that value? Does it trigger a re-render?

  11. Question 11 of 50Unit III, EventsEasy

    In React, event handlers are often named in camelCase (e.g., onClick). Is this the same as the native DOM onclick event?

  12. Question 12 of 50Unit IV, Working with FormsIntermediate

    Explain the difference between a 'Controlled' and an 'Uncontrolled' component in the context of React forms.

  13. Question 13 of 50Unit IV, Handling formsEasy

    When submitting a form in React, we almost always call e.preventDefault() as the first line in the handler. Why?

  14. Question 14 of 50Unit V, RoutingIntermediate

    Why should we use the <Link> component from React Router instead of a standard HTML <a> tag for navigation?

  15. Question 15 of 50Unit V, HTTP MethodsIntermediate

    Compare Axios and Fetch. Since Fetch is built into the browser, why does the syllabus include Axios? What is one convenience Axios offers?

  16. Question 16 of 50Unit V, RoutingHard

    Scenario: You need to pass a specific Product ID from a list page to a details page via the URL. How do you define this in the Route, and how do you access it in the destination component?

  17. Question 17 of 50Unit VI, ReduxHard

    In Redux, reducers must be 'pure functions'. If I need to update an array in the Redux store, why is it wrong to use .push()?

  18. Question 18 of 50Unit VI, ReduxIntermediate

    Briefly explain the 'Unidirectional Data Flow' in Redux.

  19. Question 19 of 50Unit VI, Debugging and DeploymentEasy

    When you run the command 'npm run build', what is being generated in the 'build' or 'dist' folder?

  20. Question 20 of 50Unit VI, Debugging the React AppIntermediate

    Code Defense: You see a warning in the console saying 'Each child in a list should have a unique key prop'. Why shouldn't you just use the array index as the key?

  21. Question 21 of 50Unit I, Refreshing JavaScriptEasy

    What is the specific advantage of using the 'Arrow Function' syntax when passing a callback to an event handler in a Class Component?

  22. Question 22 of 50Unit I, Refreshing JavaScriptIntermediate

    Explain 'Object Destructuring' in the context of receiving Props. Why do developers prefer ({ name, age }) over (props) in the function signature?

  23. Question 23 of 50Unit I, ReactJS InstallationEasy

    When you look at the folder structure created by Vite or Create React App, what is the purpose of the 'public' folder versus the 'src' folder?

  24. Question 24 of 50Unit I, JSX ExpressionsIntermediate

    Can I use an if-else statement directly inside a JSX expression (inside the curly braces)? Why or why not?

  25. Question 25 of 50Unit II, Components and stylesEasy

    What is the 'children' prop in React, and how is it different from a standard prop like 'title'?

  26. Question 26 of 50Unit II, CSS in ReactIntermediate

    When using Inline Styling in React, why do we write backgroundColor instead of the standard CSS background-color?

  27. Question 27 of 50Unit II, PropsIntermediate

    React enforces 'Unidirectional Data Flow'. If a child component needs to communicate with a parent component, how is this achieved using Props?

  28. Question 28 of 50Unit II, ComponentsHard

    Code Defense: I have a Functional Component that calculates a heavy mathematical value on every render, causing lag. Which specific Hook should I use to fix this and how?

  29. Question 29 of 50Unit III, Understanding HooksEasy

    What is the first rule of Hooks regarding where they can be called inside a component?

  30. Question 30 of 50Unit III, useContextIntermediate

    Scenario: You have a 'Theme' (Light/Dark) that needs to be accessed by a button nested 5 levels deep. Why is useContext better than passing props here?

  31. Question 31 of 50Unit III, Component LifecycleIntermediate

    Which lifecycle phase is associated with the useEffect hook when the dependency array is missing entirely (not empty, but omitted)?

  32. Question 32 of 50Unit III, useReducerHard

    When would you prefer useReducer over useState for managing local component state?

  33. Question 33 of 50Unit III, Custom HooksIntermediate

    What is a 'Custom Hook' technically? Does it share state between the components that use it?

  34. Question 34 of 50Unit IV, Forms validationEasy

    In a controlled form, what prop must be set on the <input> element to ensure React controls the data?

  35. Question 35 of 50Unit IV, Handling formsIntermediate

    Scenario: You have a form with 10 input fields. Instead of creating 10 separate handleNameChange, handleEmailChange, etc., functions, how can you write one generic change handler?

  36. Question 36 of 50Unit IV, FormsHard

    What happens if you pass the value undefined or null to a controlled input's value prop initially, and then later update it to a string?

  37. Question 37 of 50Unit V, HTTP MethodsEasy

    In the context of a CRUD application, which HTTP method is typically used to update an existing resource, and which is used to create a new one?

  38. Question 38 of 50Unit V, RoutingIntermediate

    What is the difference between useParams and useSearchParams (or query parameters)?

  39. Question 39 of 50Unit V, Fetching dataIntermediate

    If you perform a fetch call inside a useEffect, why is it important to use a dependency array []?

  40. Question 40 of 50Unit V, RoutingEasy

    In React Router, what does the <Outlet /> component do?

  41. Question 41 of 50Unit V, HTTP MethodsHard

    When using fetch(), if the server returns a 404 error, does the code enter the .catch() block? Why or why not?

  42. Question 42 of 50Unit VI, ReduxEasy

    What is a 'Store' in Redux?

  43. Question 43 of 50Unit VI, ReduxIntermediate

    Explain the role of an 'Action' in Redux. What two properties does it typically have?

  44. Question 44 of 50Unit VI, Connecting Components (Redux)Intermediate

    In modern Redux (Hooks), which hook is used to read data from the store, and which hook is used to trigger state changes?

  45. Question 45 of 50Unit VI, ReduxHard

    Why can't we perform asynchronous operations (like API calls) directly inside a Redux Reducer?

  46. Question 46 of 50Unit VI, DebuggingEasy

    What is the specific browser extension recommended for inspecting the Component hierarchy and Props in a React app?

  47. Question 47 of 50Unit VI, DeploymentIntermediate

    Why do we set an environment variable like NODE_ENV to 'production' before deploying?

  48. Question 48 of 50Unit III, State vs PropsEasy

    In one sentence, what is the key difference between State and Props regarding ownership?

  49. Question 49 of 50Unit I, ES6 RefresherEasy

    What does the .filter() array method return?

  50. Question 50 of 50Unit III, EventsIntermediate

    If I want to access the underlying DOM element inside a functional component to set focus manually, which Hook should I use?

That's the set

Go back over the ones you couldn't answer without looking. The unit notes cover each topic in full.