Skip to content

Commit

Permalink
add new questions for HTML and MongoDB #1502 (#1503)
Browse files Browse the repository at this point in the history
* add new questions for HTML #1502

* add and update mongodb questions
  • Loading branch information
Karel De Smet authored Apr 30, 2021
1 parent 5f47b3b commit 49a1fb6
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 3 deletions.
89 changes: 89 additions & 0 deletions html/html-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -1029,3 +1029,92 @@ From [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/hr): The HT
- [ ] It has child content but no closing tag.

[Reference (MDN Web Docs)](https://developer.mozilla.org/en-US/docs/Glossary/Empty_element)

#### Q67. What is the purpose of async in this code?

`<script async src="myscript.js"></script>`

- [ ] It downloads the script from the server when resources allow.
- [ ] It runs the script after HTML parsing is complete.
- [x] It runs the script when the script is ready.
- [ ] It pauses the parsing of HTML code while the script runs.

#### Q68. What does this code?
`<audio autoplay loop src="sound.mp3" type="audio/mpeg"></audio>`
- [ ] When the **play** button is pressed, the browser playes the sounds over and over again until the user stops it.
- [x] The browser plays the sound once automatically in the background. The user has no control over the sound.
- [ ] The browser plays the sound automatically and continuously in the background. The user may stop the sound at any tune.
- [ ] The browser plays the sound automatically and continuously in the background. The user has no control over the sound.

#### Q69. What is the difference between the `<head>` and `<header>` tags?

- [ ] There is only one `<head>` tag per page, while there may be many `<header>` tags.
- [ ] The `<head>` tag may contain CSS and Javascript links, while the `<header>` tag may contain headings and navigational links.
- [x] all of these answers
- [ ] The `<head>` tag contains meta information, while the `<header>` tag contains navigation, logos, and other page identifying content.

#### Q70. In this code, what is the purpose of defer?

`<script defer src="myscript.js"></script>`

- [ ] It downloads the script from the server when resources allow.
- [X] It runs the script after HTML parsing is complete.
- [ ] It runs the script when the script is ready.
- [ ] It pauses the parsing of HTML code while the script runs.

#### Q71. The code below contains some errors. Which choice corrects all of the errors?

```html
<table>
<tr>Cell 1</tr>
<td>Cell 2</td>
<caption>A table</caption>
</table>
```
- [ ]

```HTML
<caption>A table</caption>
<table>
<td>
<tr>Cell 1</tr>
<tr>Cell 2</tr>
</td>
</table>
```

- [ ]

```HTML
<caption>A table</caption>
<table>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</table>
```

- [X]

```HTML
<table>
<caption>A table</caption>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
</table>
```

- [ ]

```HTML
<table>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
<caption>A table</caption>
</table>
```
26 changes: 23 additions & 3 deletions mongodb/mongodb-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
- [ ] It holds a backup copy of the database.
- [ ] It reboots the failed server.

#### Q16. You would like to know how many types of items you have in each category. Which query does this?
#### Q16. You want to know how many types of items you have in each category. Which query does this?

- [ ] `db.product.group({_id: "$category", count: {$sum:1}})`
- [ ] `db.product.aggregate($sum: {_id: "$category", count: {$group:1}})`
Expand All @@ -119,7 +119,7 @@
- [ ] max
- [ ] skip

#### Q18. We have a collection named restaurants with the geographical information stored in the location property, how do you create a geospatial index on it?
#### Q18. You have a collection named restaurants with the geographical information stored in the location property, how do you create a geospatial index on it?

- [x] `db.restaurants.CreateIndex({location: "2dsphere"})`
- [ ] `db.restaurants.geospatial({location: "2dsphere"})`
Expand Down Expand Up @@ -259,7 +259,7 @@
- [ ] `db.vehicle.stats(true)`
- [ ] `db.vehicle.stats("kb")`

#### Q38. You'd like to modify an existing index. What is the best way to do this?
#### Q38. You want to modify an existing index. What is the best way to do this?

- [ ] Use the `reIndex()` command to modify the index.
- [x] Delete the original index and create a new index.
Expand Down Expand Up @@ -433,3 +433,23 @@
- [ ] `The oplog is capped collection and can't run out of memory`
- [ ] `The MongoDB instance will fail`
- [ ] `The oplog will stop recording logging information`

#### Q63. MongoDB ships with a variety of files. Which file runs the MongoDB shell?

- [X] mongo

- [ ] mongo-s

- [ ] shell

- [ ] mongo-shell

#### Q64. How can you view the execution performance statistics for a query?

- [ ] `db.performance.members.aggregate([ {$match: {gender: "Female"}}, {$group: {_id:{city:"$city"}, number: {$sum: 1}}}, {$sort : {number: -1}}])`

- [ ] `db.members.aggregate([ {$match: {gender: "Female"}}, {$group: {_id: {city: "$city"}, number:{$sum:1}}}, {$sort: {number:-1}}]).explain("executionStats")`

- [ ] `db.members.aggregate([ {$match: {gender: "Female"}}, {$group:{_id: {city: "$city"}, number: {$sum: 1}}}, {$sort: {number: -1}}]).explain()`

- [ ] `db.members.aggregate([ {$match: {gender: """Female"""}}, {$group: {_id: {city: """$city"""}, number: {$sum:1}}}, {$sort: {number: -1}}]).number()`

0 comments on commit 49a1fb6

Please sign in to comment.