0% found this document useful (0 votes)
34 views1 page

Quiz Questions Quiz Questions: Module 2 - Routing in Tinyhouse Module 2 - Routing in Tinyhouse

The document contains 5 multiple choice questions about routing in web applications. Question 1 asks about the definition of routing and the answer is true. Question 2 asks about the advantages of server-side routing and the answer is C - all of the above. Question 3 asks about the advantages of client-side routing and the answer is A - navigating between pages is often faster and requires no page reload. Question 4 asks which component would be rendered for the /listing route given in a React Router code example and the answer is B - <Listing/>. Question 5 asks the purpose of the <Switch /> component in React Router and the answer is D - it renders the first child <Route /> that matches the location.

Uploaded by

John Doe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views1 page

Quiz Questions Quiz Questions: Module 2 - Routing in Tinyhouse Module 2 - Routing in Tinyhouse

The document contains 5 multiple choice questions about routing in web applications. Question 1 asks about the definition of routing and the answer is true. Question 2 asks about the advantages of server-side routing and the answer is C - all of the above. Question 3 asks about the advantages of client-side routing and the answer is A - navigating between pages is often faster and requires no page reload. Question 4 asks which component would be rendered for the /listing route given in a React Router code example and the answer is B - <Listing/>. Question 5 asks the purpose of the <Switch /> component in React Router and the answer is D - it renders the first child <Route /> that matches the location.

Uploaded by

John Doe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Quiz Questions

Module 2 | Routing in TinyHouse


1. Within the context of a web application, Routing is the process
of navigating users from one location to another with the help of
URLs.

A : True
B : False

2. Server-side routing has the following advantages.

A : No white “blinking” state when navigating from route to route.


B : Initial page load is often faster.
C : All of the above.
D : None of the above.

3. Client-side routing has the following advantages.

A : Navigating between web pages is often faster and requires no page reload.
B : Search Engine Optimization (SEO) is optimized.
C : All of the above.
D : None of the above.

4. Given the following React Router configuration, which


component will be rendered if the user navigates to the /listing
route?

const App = () => {


return (
<Router>
<Switch>
<Route exact path="/" component={Home} />
<Route exact path="/host" component={Host} />
<Route exact path="/listing/:id" component={Listing} />
<Route exact path="/listings/:location?" component={Listings} />
<Route exact path="/user/:id" component={User} />
<Route component={NotFound} />
</Switch>
</Router>
);
};

A : <Home />
B : <Listing />
C : <NotFound />
D : None of the above.

5. What is the purpose of the <Switch /> component in React


Router?

A : It helps render a defined component for a certain specific path.


B : It makes a redirect to a specified path when rendered in a component.
C : It is the router component that uses the HTML5 history API to keep UI in sync with the URL.
D : It renders the first child <Route /> that matches the location.

You might also like