Unit 5: Client-Server Communication and Routing - Subjective Questions

INT252 — Web App Development With Reactjs • Practice Questions with Detailed Answers

20 questions

1

Define HTTP and explain the structure of an HTTP request and an HTTP response.

2

Explain REST principles and describe how common HTTP methods are used in a RESTful API.

3

Describe how the Fetch API can be used to retrieve JSON data in a React application. How should HTTP and network errors be handled?

4

Explain common Axios usage patterns for GET, POST, and authenticated requests. Mention how Axios handles responses and errors.

5

Compare the Fetch API and Axios for client-server communication in React applications.

6

Describe how a React interface should handle loading, error, success, and empty states during data fetching.

7

Explain how useEffect can be used for data fetching. Include the purpose of its dependency array and cleanup function.

8

Distinguish between client state and server state in a React application, with suitable examples.

9

Discuss the limitations of using useEffect and useState as the primary mechanism for synchronizing server data.

10

Introduce React Query and explain the roles of QueryClient, QueryClientProvider, query keys, and query functions.

11

Explain caching, freshness, invalidation, and background synchronization in React Query.

12

Define client-side routing and explain how it differs from traditional server-side page navigation.

13

Describe the basic routing configuration required to set up React Router in a React application.

14

Explain declarative and programmatic navigation in React Router. When should each approach be used?

15

What are dynamic routes? Explain how route parameters are declared, read, and used to fetch resource-specific data.

16

Describe how query parameters are read and updated in a React application. How do they differ from route parameters?

17

Explain nested routes and layout routes in React Router. What is the purpose of an outlet?

18

Design and explain a protected-route strategy for an authenticated React application.

19

Explain route-based code splitting and describe how lazy loading and a fallback interface improve application performance.

20

Describe an end-to-end architecture for a routed React application that retrieves server data, caches it, handles mutations, and keeps the URL synchronized with the current view.