Module 3 Graded Quiz: In-depth Understanding of Advanced React Functionality :Developing Front-End Apps with React (Cloud Application Development Foundations Specialization) Answers 2025
1. Question 1 – Hook to manage a form’s state in React
❌ useForm
✅ useState
❌ useContext
❌ useEffect
Explanation:useState is the primary hook used to store and update form field values in React.
2. Question 2 – Hook for handling asynchronous logic
❌ useCallback
❌ useState
❌ useAsync
✅ useEffect
Explanation:useEffect is used to manage asynchronous side effects such as API calls in functional components.
3. Question 3 – Trigger an effect only once after initial render
❌ useState to track initial render
❌ useEffect with no dependencies
✅ useEffect with an empty dependency array
❌ useEffect with a non-empty dependency array
Explanation:useEffect(() => { ... }, []) runs only once on mount.
4. Question 4 – Handling form submission in React
❌ onClick
❌ onKeyDown
✅ onSubmit
❌ onChange
Explanation:onSubmit is specifically used to capture form submission events.
5. Question 5 – Handling user input in a controlled component
✅ onChange event to update the state
❌ Rely on default browser form behavior
❌ Directly modify the DOM
❌ Controlled data (not a React concept)
Explanation:
In controlled components, input value is stored in state and updated via onChange.
6. Question 6 – Advantage of using Redux Thunk
❌ Handles concurrency problems
❌ Scales well
✅ Enables async operations without boilerplate
❌ Works well with complex applications
Explanation:
Redux Thunk allows writing async logic (API calls) inside action creators with minimal setup.
7. Question 7 – Primary use of Redux Toolkit
✅ Reducing boilerplate code
❌ Authentication & authorization
❌ HTTP request management
❌ Creating complex UI components
Explanation:
Redux Toolkit simplifies Redux with utilities that reduce repetitive code.
8. Question 8 – Function that consolidates Redux setup logic
❌ createStore()
❌ createSlice()
✅ configureStore()
❌ createReducer()
Explanation:configureStore() sets up the store with reducers, middleware, and devtools in one call.
9. Question 9 – Purpose of a Redux slice
❌ Manage HTTP requests
❌ Create reusable UI components
✅ Divide state into parts and manage updates
❌ Handle async operations
Explanation:
Slices organize Redux state into logical sections with reducers and actions.
10. Question 10 – Middleware commonly used for async actions
✅ Redux Thunk
❌ Redux DevTools Extension
❌ Redux Logger
❌ Redux Saga
Explanation:
Redux Thunk is the default middleware for async tasks; Saga is another option but more complex.
🧾 Summary Table
| Q No. | Correct Answer | Key Concept |
|---|---|---|
| 1 | useState | Manage form state |
| 2 | useEffect | Handle async side effects |
| 3 | useEffect with [] | Run effect once on mount |
| 4 | onSubmit | Capture form submission |
| 5 | onChange | Controlled component input |
| 6 | Thunk enables async with less boilerplate | Async middleware |
| 7 | Reducing boilerplate | Redux Toolkit purpose |
| 8 | configureStore() | Store setup in one call |
| 9 | Divide & update slices of state | Redux slice concept |
| 10 | Redux Thunk | Async middleware |