Home / MAD2 / Week 11 / Real questions
60 questions pulled from past papers whose wording matches this week's topics, newest first, duplicates removed. Pick your answers, then press Check answers. Figures and answer keys are the originals.

| Column I | Column II | |---|---| | 1. First Contentful Paint (FCP) | A. Measures unexpected movement of page elements | | 2. Largest Contentful Paint (LCP) | B. Measures how long the page is blocked from responding to user interaction | | 3. Total Blocking Time (TBT) | C. Measures when something first appears on the screen | | 4. Cumulative Layout Shift (CLS) | D. Measures when the largest visible content is rendered |

```javascript
const user = {
id: 1,
profile: {
name: "Riya",
address: {
city: "Pune",
zip: "411001"
}
}
};
const {
profile: {
name,
address: { city, state = "Maharashtra" }
},
role = "guest",
profile
} = user;
console.log(name, city, state, role);
console.log(profile);
```

Riya Pune Maharashtra guest
```
{ name: "Riya", address: { city: "Pune", zip: "411001" } }
```

Riya Pune Maharashtra guest undefined

```
undefined undefined Maharashtra guest
```
```json
{ "name": "Riya", "address": { ...} }
```
, because you cannot destructure profile into nested variables and also assign it to a plain variable profile in the same statement.SyntaxError
.In authentication using Flask-JWT-Extended, what does the payload part of the JWT stores?``` "header.payload.signature" ```
If requests for user IDs 1, 2, 1 are made within 5 minutes, what's the total response time?```python
from flask import Flask
from flask_caching import Cache
import time
app = Flask(__name__)
app.config['CACHE_TYPE'] = 'SimpleCache'
app.config['CACHE_DEFAULT_TIMEOUT'] = 300
cache = Cache(app)
@cache.memoize(timeout=300)
def compute_data(user_id):
time.sleep(5)
return f"Data for user {user_id}"
@app.route('/api/info/<int:user_id>')
def get_info(user_id):
return compute_data(user_id)
```
If a user visit index.html at 10:10:10 AM, what will be logged in the console?

app.py:
```python
from flask import Flask, jsonify
from datetime import datetime
import time
app = Flask(__name__)
@app.route('/')
def home():
time.sleep(10)
return jsonify(datetime.now().second), 200, \
{'Access-Control-Allow-Origin': '*'}
@app.route('/profile')
def profile():
time.sleep(30)
return jsonify(datetime.now().second), 200, \
{'Access-Control-Allow-Origin': '*'}
if __name__ == "__main__":
app.run(debug=True)
```
index.html:
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
</head>
<body>
<script>
function test() {
const res1 = fetch('http://127.0.0.1:5000')
const res2 = fetch('http://127.0.0.1:5000/profile')
res1
.then((res) => {
return res.json()
})
.then((data) => {
console.log(data)
})
res2
.then((res) => {
return res.json()
})
.then((data) => {
console.log(data)
})
}
test()
</script>
</body>
</html>
```
Based on the above data, answer the given subquestions.
defined as a computed property instead of a method?``` bigNumber() ```
If the developer changed the template to use displayedProducts instead of filteredProducts, What would be the most likely issue?```javascript
const ProductList = {
template: `<div>{{ filteredProducts }}</div>`,
data() {
return {
allProducts: [
{ id: 1, name: 'Laptop', category: 'electronics' },
{ id: 2, name: 'Novel', category: 'books' },
{ id: 3, name: 'Phone', category: 'electronics' }
],
displayedProducts: null
}
},
computed: {
filteredProducts() {
return this.allProducts.filter(p => p.category ===
this.$route.params.category);
}
},
watch: {
'$route.params.category': function(newCategory) {
this.displayedProducts = this.filteredProducts;
}
}
}
```
Based on the above data, answer the given subquestions.
Consider the following HTML, with the correct Vue 2 CDN links included
```html
<body>
<div id="app">
<p>Coffee</p>
<button @click="orderCoffee">Order</button>
<p>Total Cost: {{totalCost}}</p>
<p>Order Count: {{orderCount}}</p>
</div>
<script>
new Vue({
el: '#app',
data() {
return {
totalCost: '0',
unitPrice: 25,
orderCount: 0
}
},
methods: {
orderCoffee() {
this.totalCost += this.unitPrice;
this.orderCount++;
}
}
})
</script>
</body>
```
What will be displayed for "Total Cost" and "Order Count" when the Order button is clicked three times?
Total Cost: 75, Order Count: 3

Total Cost: 02525, Order Count: 3

Total Cost: 252525, Order Count: 3

Total Cost: 0252525, Order Count: 3

Consider the following HTML and JavaScript, assume Vue 2 CDN link to be already included.
index.html:
```html
<div id="app">
<p v-for="n in numbers">{{ n }}</p>
</div>
<script src="app.js" ></script>
```
app.js:
```javascript
var app = new Vue({
el: "#app",
data: { numbers: [1, 2, 3] },
});
app.data.numbers.push(4);
```
How many `<p>` elements will be rendered?
Given this Vue Router setup:
```javascript
const routes = [
{ path: '/user/:id/profile', component: UserProfile },
{ path: '/user/:id', component: User },
{ path: '*', component: NotFound },
{ path: '/user/:id/settings', component: UserSettings },
];
```
What component renders for URL /user/123/settings?
Consider the following Vue Router configuration in a Vue 2 application:
In a Vue component, you have these navigation methods:
Consider the following Vue Router configuration in a Vue 2 application:
In a Vue component, you have these navigation methods: What URLs will be generated when the user clicks each navigation element?```javascript
const routes = [
{
path: '/',
name: 'Home',
component: HomeView
},
{
path: '/user/:id',
name: 'UserProfile',
component: UserProfile
},
{
path: '/product/:category/:id',
name: 'ProductDetail',
component: ProductDetail
}
];
```
```html
<template>
<div>
<button @click="goToUser">View User</button>
<button @click="goToProduct">View Product</button>
<router-link :to="{ name: 'Home' }">Home</router-link>
</div>
</template>
<script>
export default {
methods: {
goToUser() {
this.$router.push({ name: 'UserProfile', params: { id: 123 } });
},
goToProduct() {
this.$router.push({ name: 'ProductDetail',
params: { category: 'electronics', id: 456}
});
},
navigateOne() {
this.$router.push({ name: 'UserProfile', params: { id: 555 },
query: { tab: 'settings'}
});
},
navigateTwo() {
this.$router.replace({ name: 'Home' });
},
goBack() {
this.$router.go(-1);
}
}
}
</script>
```
The `localStorage` object stores data with no expiration date, even after the browser is closed.

The `sessionStorage` object keeps data only for the duration of the page session.

Both `localStorage` and `sessionStorage` can store data in key-value pair format.

Data stored in `sessionStorage` is available across different browser tabs.

Consider the following Vue 2 component defined using the CDN version:
Filename: index.html
```html
<div id="app">
<p>{{ message }}</p>
</div>
```
Filename: app.js
```javascript
new Vue({
el: '#app',
data() {
return {
message: 'Initial'
};
},
created() {
console.log('Created Hook');
this.message = 'Created Hook Called';
this.fetchData();
},
mounted() {
console.log('Mounted Hook');
},
methods: {
async fetchData() {
const res = await new Promise(resolve => {
setTimeout(() => resolve('Data Loaded'), 1000);
});
this.message = res;
console.log('Data updated after fetch');
}
}
});
```
What will be the sequence of console logs and final content shown on the web page after 1 second?
Console: Mounted Hook Created Hook Data updated after fetch Page: Initial

Console: ``` Created Hook Mounted Hook Data updated after fetch ``` Page: Data Loaded

Console: ``` Created Hook Data updated after fetch Mounted Hook ``` Page: Data Loaded

Console: Mounted Hook Data updated after fetch Created Hook Page: Created Hook Called

Consider the following Vue 2 code with Vuex 3 used via CDN, assume the Vuex
store is correctly injected into the Vue instance.
Filename: store.js
```javascript
export default store = new Vuex.Store({
state: {
score: 10,
},
mutations: {
increaseScore(state) {
state.score += 5;
},
},
actions: {
increaseScoreAsync({ commit }) {
setTimeout(() => {
commit("increaseScore");
}, 1000);
},
},
});
```
Filename: score-display.js
```javascript
export default Vue.component('score-display', {
template: `
<div>
<p>Current Score: {{ score }}</p>
<button @click="boostNow">Boost Now</button>
<button @click="boostLater">Boost After 1s</button>
</div>
`,
computed: {
score() {
// CODE 1
}
},
methods: {
boostNow() {
// CODE 2
},
boostLater() {
// CODE 3
}
}
});
```
Which of the following correctly fills in CODE 1, CODE 2, and CODE 3 for the score to be
displayed and for the **boostNow()** and **boostLater()** methods to work correctly?
CODE 1: ``` return this.$store.state.score; ```

CODE 2:
```
this.$store.commit('increaseScore');
```
``` CODE 2: this.increaseScore() ; ```

CODE 3:
```
this.$store.dispatch('increaseScoreAsync');
```
CODE 3: ``` this.$store.increaseScoreAsync(); ```

Consider the following HTML, with the correct Vue 2 CDN links included:
Html code.
```html
<div id="app">
<h3>Shopping Cart</h3>
<p>Items: {{itemCount}}</p>
<p>Total Cost: ${{totalCost}}</p>
<button @click="addItem">Add Item ($15)</button>
<button @click="removeItem">Remove Item</button>
<p>Status: {{status}}</p>
</div>
```
script:
```javascript
const app = new Vue({
el: '#app',
data() {
return {
itemCount: 0,
itemPrice: 15,
totalCost: 0
}
},
computed: {
status() {
if (this.itemCount === 0) {
return 'Empty Cart';
} else if (this.itemCount < 3) {
return 'Few Items';
} else {
return 'Full Cart';
}
}
},
methods: {
addItem() {
this.itemCount++;
this.totalCost += this.itemPrice;
},
removeItem() {
if (this.itemCount > 0) {
this.itemCount--;
this.totalCost -= this.itemPrice;
}
}
}
})
```
If the user clicks the "Add Item" button 3 times, then clicks the "Remove Item" button 1 time, what will be displayed for Items, Total Cost, and Status?
Consider the following Vue.js (Vue 2) code to answer the following question:
```html
<div id="app">
<my-counter :start="5"></my-counter>
</div>
<script>
Vue.component('my-counter', {
props: ['start'],
data: function () {
return {
count: this.start
};
},
template: `
<div>
<p>{{ count }}</p>
<button @click="increment">Increment</button>
</div>
`,
methods: {
increment() {
this.count++;
}
}
});
new Vue({
el: '#app',
data: { start: 10 }
});
</script>
```
What will be displayed when the page loads, and what happens when you click the button?
The counter starts at 10, and increments by 1 on each button click.

The counter starts at 5, and increments by 1 on each button click.

Nothing is rendered because the Vue component template is invalid when using Vue via CDN.

Vue throws a warning about compiling templates in the browser and fails to bind the component.

Consider the following Flask application (server.py):
server.py
```python
from flask import Flask
from flask_caching import Cache
import time
config = {
"DEBUG": True,
"CACHE_TYPE": "RedisCache",
"CACHE_REDIS_URL": "redis://localhost:6379/1",
"CACHE_DEFAULT_TIMEOUT": 300
}
app = Flask(__name__)
app.config.from_mapping(config)
cache = Cache(app)
@app.route('/data/<item>')
@cache.cached(timeout=100)
def get_data(item):
time.sleep(25)
return f"Data for {item}"
if __name__ == '__main__':
app.run()
```
The application runs on http://localhost:5000.
A client makes two consecutive requests to http://localhost:5000/data/apple within 50 seconds
What will be the approximate absolute difference between their latencies?
Consider the below flask implementation with JWT based authentication.
```python
from flask import Flask, request, jsonify
import jwt
import datetime
app = Flask(__name__)
SECRET_KEY = "supersecret"
def generate_token(user):
return jwt.encode(
{"user": user, "exp": datetime.datetime.utcnow() +
datetime.timedelta(seconds=10)},
SECRET_KEY,
algorithm="HS256"
)
@app.route("/login", methods=["POST"])
def login():
user = request.json.get("user")
token = generate_token(user)
return jsonify({"token": token})
@app.route("/protected", methods=["GET"])
def protected():
token = request.headers.get("Authorization").split(" ")[1]
try:
payload = jwt.decode(token, SECRET_KEY, algorithms=["HS256"])
return jsonify({"message": f"Hello {payload['user']}!"})
except jwt.ExpiredSignatureError:
return jsonify({"error": "Token expired"}), 401
except jwt.InvalidTokenError:
return jsonify({"error": "Invalid token"}), 403
```
If a Vue.js client sends this request 15 seconds after login, what response will it receive
(assume the token sent is the one, which was received from login)?
```javascript
fetch("http://localhost:5000/protected", {
method: "GET",
headers: { "Authorization": "Bearer <JWT_TOKEN>" }
})
.then(res => res.json())
.then(console.log);
```
```json
{ "message": "Hello user!" }
```
```json
{ "error": "Token expired" }
```
```json
{
"error": "Invalid token"
}
```
```json
{
"message": "Access granted"
}
```
Consider the following Vue app with the Vue Router shown below and answer the given subquestions.
Consider the following Vue app with the Vue Router shown below and answer the given subquestions.
Consider the following Vue app with the Vue Router shown below and answer the given subquestions.
Consider the following Vue app with the Vue Router shown below and answer the given subquestions.
What will be rendered on the browser for the given value of localStorage?
```
{
token: 112,
userRole: "manager"
}
```
Consider the following Vue app with the Vue Router shown below and answer the given subquestions.
Consider the following Vue app with the Vue Router shown below and answer the given subquestions.
What will be rendered on the browser for the given value of localStorage?
```json
{
"token": 112,
"userRole": "admin"
}
```
Consider the following html with relevant vue cdn links added.
```html
<div id="app">
<button @click="addLike">Like</button>
<div>{{likes}}</div>
</div>
<script>
new Vue({
el: '#app',
data: () => ({
likes: 0,
lastClick: 0
}),
methods: {
addLike() {
if (Date.now() - this.lastClick < 500) {
this.likes += 2;
} else {
this.likes += 1;
}
this.lastClick = Date.now();
}
}
})
</script>
```
Consider the following html with relevant vue cdn links added.
```html
<div id="app">
<async-component ref="child"></async-component>
<button @click="updateParent">Update Parent</button>
</div>
<script>
Vue.component('async-component', {
template: '<div>{{message}}</div>',
data() {
return {
message: 'Initial'
}
},
mounted() {
setTimeout(() => {
this.message = 'Updated in child'
}, 0)
}
})
new Vue({
el: '#app',
mounted() {
this.$refs.child.message = 'Updated in parent'
},
methods: {
updateParent() {
this.$refs.child.message = 'Button clicked'
}
}
})
</script>
```
Consider the below Vue router setup.
Note: Assume that the API "/api/users/userId" is operational and returns the user's data including name.
```javascript
const UserProfile = {
template: `<div><h2>User Profile</h2><p>{{ user.name }}</p></div>`,
data() {
return {
user: {}
};
},
created() {
this.fetchUserData();
},
methods: {
async fetchUserData() {
const userId = this.$route.query.userId;
const response = await fetch(`/api/users/${userId}`);
this.user = await response.json();
}
}
};
const routes = [
{ path: '/user', component: UserProfile }
];
const router = new VueRouter({
routes
});
```
What will happen if the user navigates to "/user?userId=123"?
Consider the following HTML with relevant Vue CDN link attached.
```html
<div id="app">
<div :class="{ active: isActive, 'text-danger': hasError }">
{{ message }}
</div>
</div>
<script>
new Vue({
el: '#app',
data: {
message: 'Hello!',
isActive: true,
hasError: false
}
})
</script>
```
Given the Vue.js application above, which classes will be applied to the div containing the message?
Consider the following Vue2 app and the index file given below.
index.html
```html
<body>
<div id="app">
<h4>{{ state }}</h4>
</div>
<script
src="https://cdn.jsdelivr.net/npm/vue@2.7.16/dist/vue.js"
></script>
<script src="./script.js"></script>
</body>
</html>
```
script.js
```javascript
const app = new Vue({
el: '#app',
data: {
terminal: ['3', '2', '1'],
curr_status: ["arrived", "departed", "delayed"]
},
computed: {
state: () => {
return `The flight 103 has ${this.curr_status[1]} from terminal ${this.terminal[2]}.`
}
}
})
```
What will be the output on the browser?
Consider the following HTML with relevant Vue CDN link attached.
```html
<div id="app1">
{{ messageA }}
</div>
<div id="app2">
{{ messageB }}
</div>
<script>
const vm1 = new Vue({
el: '#app1',
data: {
messageA: 'Hello from App 1'
}
})
const vm2 = new Vue({
el: '#app2',
data: {
messageB: 'Hello from App 2'
}
})
vm1.messageA = 'Updated App 1';
</script>
```
After the code execution above, what will be displayed on the page?
Consider the following HTML with relevant Vue CDN attached.
```html
<div id="app">
<input v-model.number="price" type="number">
<input v-model.number="quantity" type="number">
<p>Total: {{ total }}</p>
<p>Last Updated By: {{ lastUpdatedBy }}</p>
</div>
<script>
new Vue({
el: '#app',
data: {
price: 10,
quantity: 1,
total: 10,
lastUpdatedBy: 'initial'
},
watch: {
price: {
handler(newVal) {
this.total = newVal * this.quantity;
this.lastUpdatedBy = 'price';
}
},
quantity: {
handler(newVal) {
this.total = this.price * newVal;
this.lastUpdatedBy = 'quantity';
}
}
}
})
</script>
```
If the user changes the price to 20 and then immediately changes the quantity to 2, what will be the final values of total and lastUpdatedBy?
``` @cache.memoize() caches function results based on arguments, while @cache.cached() caches entire views. ```

``` @cache.cached() caches function results based on arguments, while @cache.memoize() caches entire views. ```

Both cache entire views, but `@cache.memoize()` uses Redis by default.

Both methods are identical but use different syntax.

Consider the following HTML with Vue CDN included?
```html
<div id="app"></div>
<script>
Vue.component('my-button', {
template: `
<button @click="handleClick">
<slot></slot>
</button>
`,
methods: {
handleClick() {
console.log('Button')
this.$emit('click')
}
}
})
new Vue({
el: '#app',
template: `
<my-button @click="parentClick">
Click me
</my-button>
`,
methods: {
parentClick() {
console.log('Parent')
}
}
})
</script>
```
What will be logged on the console after the button is pressed?
Consider the following HTML with appropriate Vue 2 CDN link attached.
```html
<div id="app"></div>
<script>
new Vue({
el: '#app',
template: `
<div>
<p>Likes: {{ displayLikes }}</p>
<button @click="handleLike">Like</button>
</div>`,
data() {
return {
post: {
likes: 5,
metadata: { lastUpdated: null }
}
}
},
computed: {
displayLikes: {
get() {
return this.post.likes;
},
set(value) {
this.post.likes = value;
}
}
},
methods: {
handleLike() {
Promise.resolve().then(() => {
this.displayLikes++;
});
this.displayLikes += 1;
setTimeout(() => {
this.displayLikes = this.displayLikes + 1;
}, 0);
}
}
})
</script>
```
What will be rendered in the `<p>` tag after the Like button is pressed once?
Consider the following HTML, which includes Vue 2 and Vuex CDN links.
```html
<div id="app">
<p v-if="userData">User: {{ userData.name }}</p>
<p v-else>No user data available</p>
</div>
<script>
const store = new Vuex.Store({
state: {
userData: null
},
mutations: {
setUserData(state, data) {
state.userData = data;
}
},
actions: {
fetchUserData({ commit }) {
return fetch('https://httpstat.us/500')
.then(response => {
if (!response.ok) throw new Error('Network error');
return response.json();
})
.then(data => {
commit('setUserData', data);
},
error => {
commit('setUserData', { name: 'Luke' })
})
.catch(() => {
commit('setUserData', null);
});
}
}
});
new Vue({
el: '#app',
store,
created() {
this.$store.dispatch('fetchUserData');
},
computed: {
userData() {
return this.$store.state.userData;
}
}
});
</script>
```
What will be rendered on the browser, if the fetch request gets back 500 status code?
Consider the below Vue router configuration.
```javascript
const routes = [
{
path: '/user/:id',
component: UserProfile
}
];
const router = new VueRouter({
routes
});
```
Which of the following is a valid way to access the "id" parameter inside the UserProfile component?
Given the following routes configured in Vue Router, assuming that routes have
been correctly configured in vue router.
```javascript
const routes = [
{ path: '/', component: Home },
{ path: '/profile/:userId', component: Profile },
{ path: '/settings', component: Settings },
{ path: '/settings/security', component: Security },
{ path: '/*', component: NotFound },
];
```
Which route will match the path /settings/security?
Consider the following HTML, with included vue 2 cdn link.
```html
<div id="app">{{doubledItems}}</div>
<script>
new Vue({
el: '#app',
data() {
return {
items: [1, 2, 3],
processed: []
};
},
computed: {
doubledItems() {
return this.items.map(x => x * 2);
}
},
created() {
this.processItems();
},
methods: {
processItems() {
this.items.push(4);
this.processed = this.doubledItems;
setTimeout(() => {
this.processed = this.processed.map(x =>
this.doubledItems.includes(x) ? x : x * 2
);
}, 0);
}
}
});
</script>
```
What will be displayed ?
Consider the following html with appropriate vue 2 cdn link attached.
```html
<div id="app"></div>
<script>
new Vue({
el: '#app',
template: `
<div>
<form @submit.prevent>
<input v-model="email" @input="validateEmail">
<button type="submit">Submit</button>
<p>Errors: {{ displayErrors.join(', ') }}</p>
</form>
</div>
`,
data() {
return {
email: '',
errors: [],
validating: false,
existingEmails: ['test@test.com', 'example@example.com']
};
},
computed: {
displayErrors() {
return this.validating ? ['Validating...'] :
this.errors;
}
},
methods: {
validateEmail() {
this.validating = true;
this.errors = [];
if (!this.email.includes('@')) {
this.errors.push('@ not present');
}
if (!this.email.includes('.')) {
this.errors.push('invalid format');
}
if (this.existingEmails.includes(this.email)) {
this.errors.push('Email exists');
}
this.validating = false;
}
},
watch: {
email(value) {
if (!value) this.errors = ['Required']
}
}
});
</script>
```
When typing "test@test.com" and then deleting it all, what is shown in the "Errors" paragraph at the end?
Consider the following python code snippet. Assuming proper configuration for caching is done, answer the question below.
```python
from flask import Flask, request
from flask_caching import Cache
import time
app = Flask(__name__)
app.config['CACHE_TYPE'] = 'RedisCache'
app.config['CACHE_DEFAULT_TIMEOUT'] = 5
cache = Cache(app)
@app.route('/time')
@cache.cached()
def get_time():
return str(time.time())
```
Suppose the following sequence of requests is made:
Request 1: GET /time at 00:00:00
Request 2: GET /time at 00:00:02
Request 3: GET /time at 00:00:06
What will the responses be for each request?
Request 1: 00:00:00 Request 2: 00:00:02 Request 3: 00:00:06

Request 1: 00:00:00 Request 2: 00:00:02 Request 3: 00:00:02

Request 1: 00:00:00 Request 2: 00:00:00 Request 3: 00:00:00

Request 1: 00:00:00 Request 2: 00:00:00 Request 3: 00:00:06

Consider the following HTML with Vue 2 CDN attached.
```html
<div id="app"></div>
<script>
new Vue({
el: '#app',
data() {
return {
message: 'Hello'
};
},
beforeCreate() {
console.log('Before Create: ' + this.message);
this.message = 'Before Create';
},
mounted() {
this.message = 'Mounted';
console.log('Mounted: ' + this.message);
},
template: `
<div>
<p>{{ message }}</p>
</div>`
});
</script>
```
What will be printed in the browser console ?
Consider the following HTML, which includes Vue 2 and Vue Router 3 CDN links.
```html
<body>
<div id="app"></div>
<script>
const Home = { template: `<h1>Home</h1>` }
const NewestComments = { template: `<h3>Newest Comments</h3>` }
const TopComments = { template: `<h3>Top Comments</h3>` }
const SearchResults = { template: `<h3>Search Results</h3>` }
const TopBar = { template: `<h3>Topbar</h3>` }
const NavBar = { template: `<h3>Navbar</h3>` }
const VideoDetail = { template: `<div>Video Details <router-view /></div>` }
const routes = [
{ path: '/', component: Home },
{
path: '/video/:id',
component: VideoDetail,
props: true,
children: [
{ path: 'comments/top', component: TopComments },
{ path: 'comments/newest', component: NewestComments }
]
},
{ path: '/search/:query', component: SearchResults, props: true }
];
new Vue({
el: '#app',
template: `
<div>
<TopBar />
<NavBar />
<router-view />
</div>`,
router: new VueRouter({ routes }),
components: { TopBar, NavBar }
})
</script>
</body>
```
Given this router setup, which of the following will happen when a user navigates to `localhost:5000/#/video/5/comments/newest`, assuming the webpage is hosted on `localhost:5000`?
The TopNavbar and Navbar components will remain visible, and the NewestComments component will be displayed inside the VideoDetail component.

The Home component will be visible.

The TopComments component will be displayed.

No component will be shown.