1/49
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
(Choose 2 answer)
Which of the following is used to manage user sessions in Express?
A. Passport.js
B. Cookie-parser
C. body-parser
D. Session-store
A. Passport.js
D. Session-store
Which of the following is a standard security protocol used for secure communication over the internet?
A. FTP
B. SMTP
C. SSL/TLS
D. HTTP
C. SSL/TLS
SSL (Secure Sockets Layer) và TLS (Transport Layer Security) là các giao thức bảo mật tiêu chuẩn được sử dụng để mã hóa và bảo vệ dữ liệu khi truyền qua Internet.
In the Authorization header, Username and password are combined into a string
A. "username&password"
B. "username:password"
C. "username_password"
D. "username@password"
B. "username:password"
(Choose 2 answer)
You need to include a common header and footer in multiple EJS templates.
A.
B.
C.
D. sets the page title.
A.
B.
What is the difference between PUT and PATCH methods in REST APIs?
A. PUT updates partial resources, PATCH updates full resources
B. PUT updates full resources, PATCH updates partial resources
C. PUT deletes resources, PATCH creates resources
D. PUT and PATCH are identical
B. PUT updates full resources, PATCH updates partial resources
(Choose 3 answer)
Which of the following are valid options for the populate() method in Mongoose?
A. select
B. path
C. model
D. field
A. select
B. path
C. model
(Choose 2 answer)
Which of the following statements correctly describe an SDK?
A. An SDK provides higher-level abstractions to ease development for a target platform.
B. An SDK is primarily used to manage server load balancing.
C. An SDK grants access to platform-specific capabilities and features that may be complex to implement from scratch.
D. An SDK is a database management system.
A. An SDK provides higher-level abstractions to ease development for a target platform.
C. An SDK grants access to platform-specific capabilities and features that may be complex to implement from scratch.
is a fast, unopinionated and minimalist web framework for Node.js
A. Express
B. Spring
C. Hibernate
D.Net
A. Express
Which of the following will correctly create a readable stream in Node.js?
A. const fs = require('fs');
const stream = fs.createStream('input.txt');
B. const fs = require('fs');
const stream = fs.createReadStream('input.txt');
C. const fs = require('fs');
const stream = fs.createReadable('input.txt');
D. const fs = require('fs');
const stream = fs.newStream('input.txt');
B. const fs = require('fs');
const stream = fs.createReadStream('input.txt');
Which HTTP status code indicates that a resource has been created?
A. 200
B. 404
C. 201
D. 500
C. 201
Note:
201 Created
200 OK ✅
404 Not Found ❌
500 Internal Server Error ❌
Which HTTP header is used to pass the OAuth token in requests?
A. Authorization
B. Authentication
C. Bearer
D. Access-Token
A. Authorization
(Choose 2 answer)
Which of the following are true about the match option in the populate() method?
A. It limits the number of documents to be populated.
B. It works like the find method filter.
C. It filters the documents to be populated.
D. It sorts the documents to be populated
B. It works like the find method filter.
C. It filters the documents to be populated.
What is MongoDB?
A. A document database.
B. A relational database.
C. A key-value store.
D. A columnar database.
A. A document database.
What is database encryption?
A. The process of converting data into a secure format that can only be read with a decryption key.
B. The process of backing up data.
C. The process of normalizing data.
D. The process of querying data.
A. The process of converting data into a secure format that can only be read with a decryption key.
What are not use cases for Mongoose in Node.js?
A. Mongoose provides a rich set of query and aggregation methods that allow you to retrieve data from the database in a flexible and efficient way
B. Mongoose provides built-in validation for your data, allowing you to ensure that the data meets certain criteria before it is stored in the database
C. Mongoose allows you to define schemas for your MongoDB collections, which specify the fields and data types that can be stored in the collection.
D. If your data schema contains complex data structures, such as arrays of arrays or deeply nested objects, you may find that Mongoose's data modeling features are flexible enough to handle your data
ChatGPT bảo câu nào cũng là use cases
==> Nếu phải chọn thì câu D
(Choose 2 answer)
Consider the following code snippet using Express.js. Identify which routes handle GET and POST requests.
const express = require('express');
const app = express();
app.get('/users', (req, res) => {
res.send('GET request to the /users endpoint');
});
app.post('/users', (req, res) => {
res.send('POST request to the /users endpoint');
});
app.listen(3000, () => {
console.log('Server running on port 3000');
});
A. The /users endpoint handles GET requests.
B. The /users endpoint handles POST requests.
C. The /users endpoint handles PUT requests.
D. The /users endpoint handles DELETE requests.
A. The /users endpoint handles GET requests.
B. The /users endpoint handles POST requests.
(Choose 2 answer)
Consider the following code snippet using async/await:
async function fetchData() {
try {
let response = await fetch('https://api.example.com/data');
let data = await response.json();
console.log(data);
} catch (error) {
console.error('Error:', error);
}
}
fetchData();
What are the advantages of using async/await in this code?
A. It makes the code easier to read and understand.
B. It ensures the code runs synchronously.
C. It simplifies error handling with try/catch blocks.
D. It eliminates the need for callbacks entirely.
A. It makes the code easier to read and understand.
C. It simplifies error handling with try/catch blocks.
What is the purpose of role-based authorization?
A. To authenticate users based on their role in the organization.
B. To restrict access to certain features or resources in a web application based on a user's role in the organization.
C. To encrypt sensitive data transmitted between a client and server.
D. To prevent Cross-Site Request Forgery (CSRF) attacks.
B. To restrict access to certain features or resources in a web application based on a user's role in the organization.
(Choose 2 answer)
Which statements correctly describe the use of regex in MongoDB?
A. Regex can be used in the $regex operator to match string patterns.
B. Regex is used to perform mathematical operations.
C. Regex allows for case-insensitive searches by using the 'i' option.
D. Regex can be used to insert documents into a collection.
A. Regex can be used in the $regex operator to match string patterns.
C. Regex allows for case-insensitive searches by using the 'i' option.
How does Tailwind CSS differ from traditional CSS frameworks like Bootstrap?
A. It uses predefined components instead of custom classes
B. It encourages custom designs using utility classes
C. It does not require any configuration
D. It is only usable with React.js
B. It encourages custom designs using utility classes
What is Express Generator?
A. A tool for managing databases.
B. A command-line tool that helps you quickly generate the basic structure and files for an Express.js application.
C. A library for creating front-end Ul components.
D. A debugger for Node.js applications.
B. A command-line tool that helps you quickly generate the basic structure and files for an Express.js application.
(Choose 3 answer)
To connecting to a MongoDB database and performing CRUD operations using the Node MongoDB Driver.
Identify the parts responsible for connecting, inserting, and querying documents.
A. client.connect() is responsible for connecting to the MongoDB server.
B. col.insertOne({ name: "Nguyen Van A", age: 20 }) is responsible for inserting a document.
C. col.find({}).toArray() is responsible for querying documents.
D. client.close() is responsible for deleting a document.
A. client.connect() is responsible for connecting to the MongoDB server.
B. col.insertOne({ name: "Nguyen Van A", age: 20 }) is responsible for inserting a document.
C. col.find({}).toArray() is responsible for querying documents.
(Choose 2 answer)
Which statements correctly describe the use of population in Mongoose queries?
A. Population is used to join data from multiple collections.
B. Population is used to update multiple documents.
C. Population can be done using the populate() method in a query.
D. Population requires the use of schemas only.
A. Population is used to join data from multiple collections.
C. Population can be done using the populate() method in a query.
Which method is used to define a schema in Mongoose?
A. mongoose.Schema()
B. mongoose.Model()
C. mongoose.createSchema()
D. mongoose.defineSchema()
A. mongoose.Schema()
Analyze the following code:
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send('Hello, this is a GET request');
});
app.listen(3000, () => {
console.log('Server is running on port 3000');
});
What is the right URL to display the text "Hello, this is a GET request"?
A. http://localhost:3000/
B. http://localhost:3000/GET
C. http://localhost:3000/POST
D. http://localhost:3000/PUT
A. http://localhost:3000/
(Choose 3 answer)
What are the benefits of using HTTPS in a Node.js application?
A. HTTPS encrypts all data transmitted between the client and server, providing a secure channel for transmitting sensitive data, such as passwords, credit card information, and personal data
B. HTTPS uses SSL/TLS certificates to authenticate the server and verify that the client is communicating with the correct server.
C. HTTPS can help build trust with your users by providing a secure and trustworthy environment for transmitting sensitive data.
D. HTTPS can add some overhead to your application's performance, as the encryption and decryption of data requires additional computational resources
A. HTTPS encrypts all data transmitted between the client and server, providing a secure channel for transmitting sensitive data, such as passwords, credit card information, and personal data
B. HTTPS uses SSL/TLS certificates to authenticate the server and verify that the client is communicating with the correct server.
C. HTTPS can help build trust with your users by providing a secure and trustworthy environment for transmitting sensitive data.
What does the res.send() method do in Express.js?
A. Reads data from a file
B. Sends the HTTP response
C. Handles HTTP requests
D. Ends the HTTP session
B. Sends the HTTP response
What is a module in NestJS?
A. A function that handles HTTP requests
B. A file that defines a specific feature of the app
C. A global object for managing app state
D. A controller for defining routes
B. A file that defines a specific feature of the app
What is the purpose of a salt in password hashing?
A. To add flavor to the hashed password.
B. To store the password in plain text in the database.
C. To add random data to the password before hashing, making it more difficult for attackers to use precomputed lookup tables to crack the hashed password.
D. To add a secret key to the password before hashing, making it more difficult for attackers to crack the hashed password.
C. To add random data to the password before hashing, making it more difficult for attackers to use precomputed lookup tables to crack the hashed password.
Which method is used for population in Mongoose?
A. populate()
B. reference()
C. associate()
D. link()
A. populate()
(Choose 3 answer)
Which of the following are valid methods to read a file in Node.js?
A. fs.readFile
B. fs.readSync
C. fs.readFileSync
D. fs.read
A. fs.readFile
C. fs.readFileSync
D. fs.read
What is the difference between Passport.js and JWT?
A. Passport.js is used for session-based authentication, while JWT is for token-based authentication
B. Passport.js is only used in front-end apps, while JWT is back-end only
C. Passport.js is faster than JWT
D. They serve the same purpose
A. Passport.js is used for session-based authentication, while JWT is for token-based authentication
(Choose 2 answer)
Which of the following are valid ways to handle errors in Node.js?
A. Ignoring errors as Node.js handles them automatically
B. Using try-catch block
C. Using process.on('exit') event
D. Attaching an error event listener to EventEmitter instances
B. Using try-catch block
D. Attaching an error event listener to EventEmitter instances
How do you add middleware to an Express application?
A. app.run(middleware)
B. app.use(middleware)
C. app.middleware(middleware)
D. app.listen(middleware)
B. app.use(middleware)
Which of the following HTTP methods is idempotent?
A. POST
B. PUT
C. DELETE
D. Both B and C
D. Both B and C
Which of the following is wrong statement?
A. Cross-origin resource sharing (CORS) is a browser mechanism which enables controlled access to resources located outside of a given domain
B. The CORS mechanism supports secure cross-origin requests and data transfers between browsers and servers
C. For security reasons, browsers don't restrict cross-origin HTTP requests initiated from scripts
D. CORS allows web applications to make requests to a domain different from the one that served the web application.
C. For security reasons, browsers don't restrict cross-origin HTTP requests initiated from scripts
Which middleware handles JSON data in Express.js?
A. body-parser
B. json-middleware
C. express-json
D. express-parser
D. express-parser
What is the default port for MongoDB?
A. 3306
B. 5432
C. 27017
D. 1521
C. 27017
(Choose 2 answer)
Which statements about Promises in Node.js are true?
A. A Promise represents the eventual completion (or failure) of an asynchronous operation and its resulting value.
B. Promises are used to handle synchronous operations.
C. A Promise is in one of three states: pending, fulfilled, or rejected.
D. Promises can only handle one asynchronous operation at a time.
A. A Promise represents the eventual completion (or failure) of an asynchronous operation and its resulting value.
C. A Promise is in one of three states: pending, fulfilled, or rejected.
Which of the following are correct ways to define a reference in a Mongoose schema?
A. { type: mongoose. Schema. Types. Mixed, ref: 'User' }
B. { type: mongoose.Schema.Types.ObjectId, ref: 'User' }
C. { type: mongoose. Schema. Types. ObjectId, 'User' }
D. { type: mongoose. Schema. Types. Objectid, reference: 'User' }
B. { type: mongoose.Schema.Types.ObjectId, ref: 'User' }
What is Mongoose in Node.js?
A. A database
B. A MongoDB object modeling tool
C. An HTTP client
D. A web server framework
B. A MongoDB object modeling tool
What is the default port for HTTPS?
A. 80
B. 443
C. 8080
D. 8443
B. 443
What is the purpose of the "Authentication" middleware
A. To validate that the anti-forgery token is present and valid in a form submission.
B. To encrypt sensitive data in web forms.
C. To handle user authentication and establish an identity for the user.
D. To prevent Cross-Site Request Forgery (CSRF) attacks.
C. To handle user authentication and establish an identity for the user.
Which decorator is used in Nest.js to mark a class as a controller?
A. @Service
B. @Injectable
C. @Controller
D. @Component
C. @Controller
What is Express.js?
A. A database management system.
B. A front-end framework for designing UI.
C. A back-end web application framework for Node.js.
D. A text editor for coding.
C. A back-end web application framework for Node.js.
What is the purpose of using regex in MongoDB queries?
A. To sort the documents.
B. To filter documents based on pattern matching.
C. To update multiple documents.
D. To delete a specific document.
B. To filter documents based on pattern matching.
(Choose 2 answer)
Which of the following methods are used to find and update a document in Mongoose?
A. updateOne
B. update
C. findOneAndUpdate
D. findByIdAndUpdate
C. findOneAndUpdate
D. findByIdAndUpdate
What is a set of documents?
A. A collection
B. A database
C. A table
D. A document
A. A collection
(Choose 3 answer)
How to handle asynchronous operations in a more readable and maintainable way?
A. Using Promises
B. Using nesting Callbacks
C. Using other control flow libraries
D. Using Async/Await
A. Using Promises
C. Using other control flow libraries
D. Using Async/Await
What type of relationship does Mongoose population create?
A. One-to-one or one-to-many
B. Many-to-many only
C. No relationship
D. SQL-style joins
A. One-to-one or one-to-many