WorksheetsNodeJS and Python Flask
Total questions: 61
Worksheet time: 31mins
NodeJS is build on which JavaScript engine?
V8 Engine
SpiderMonkey
Chakra
Nashorn
What is the architecture of Node.js?
Single-threaded, event-driven
Multi-threaded blocking
Distributed thread-based
Parrallel synchronous
What is the file package.json used for?
Manage project dêpndencises and metadata
Store user data
Create database
Complie JavaScript code
What does npm stand for?
Node Package Manager
Node Project Module
New Project Manager
Network Pakage Module
Which command initializes a file package.json?
package.json?
npm init
npm start
node init
npm create
Which command runs the file in app.jsNode.js?
app.js?
node app.js
npm app.js
run app.js
execute app.js
Which module is used to create an HTTP server in Node.js?
http
fs
os
path
Which command installs
the Express framework?
npm install express
npm add express.js
node install express
install express
What does a method res.send()do in Express ?
res.send()
Send response to client
Send request to another server
Save data to database
Stop server
Which command checks the installed Node.js version?
node -v
node --check
npm -version
node --show
What is the module used for in Node.js ?
Manage file system
Create HTTP server
Process JSON data
Manage network connection
What is middleware in Express?
A function that processes requests/responses before reaching the route handler
A type of database
A CSS tool
An operating system module
What is the common default port for a Node.js server?
3000
5000
80
22
What require('module')does do in Node.js ?
require('module')?
Import a module
Export data to the outside
Create a server
Save to a file
What is a callback function in Node.js?
The function is passed into another function and called back when finished
The function runs immediately
The function runs synchronously
The function is only used in the database
What is the main advantage of Node.js?
Asynchronous, non-blocking I/O
3D graphics support
OS management
CSS-friendly
What does the processobject in Node.js provide?
Node.js process information and control
Database management
CSS processing
REST API creation
Which command installs a package globally?
npm install -g package
npm add package
npm --global package
npm install package
What is the syntax to export a module in Node.js?
A. module.exports = myFunc;✅
B. export myFunc;
C. exports: myFunc;
D.require myFunc;
module.exports = myFunc;
Node.js is mainly used for which type of applications?
Web applications and APIs
3D graphics applications
Office computer applications
Web browsers
Which tool is commonly used to manage libraries in a Node.js front-end project?
npm
MySQL
Flask
Redis
Which tool is commonly used to bundle front-end code?
Webpack
Docker
MongoDB
Express
What is npm script usually "start": "webpack serve"used for?
"start": "webpack serve"?
Launch the front-end development server
Launch the database
Deploy the Flask app
Configure the operating system
Which tool compiles ES6+ code to ES5 for older browsers?
Babel
React
SQLALchemy
Vue
What is the purpose of package-lock.jsonin a Node.js front-end project ?
Save the correct version of dependencies
Save user data
Run the front-end server
Generate CSS file
Which framework is commonly used to build UI in the Node.js ecosystem?
React
Flask
Django
Laravel
What does usually npm run build do in a front-end project?
Create the optimal version for deployment
Build the database
Run the Flask server
Configure the firewall
Which tool can be used instead of npm to install packages?
Yarn
MySQL
Docker
Redis
What does SPA mean in front-end
development ?
Single Page Application
Server Page Architecture
Standard Program API
Scripted Page App
What is the main advantage of SPA?
Smooth experience, no full page reload
Faster page loading than SSR
No back-end required
No API
Which framework is an alternative to React in the Node.js ecosystem?
Angular
Flask
Django
Laravel
Which tool is used to manage and install global CLI tools in Node.js front-end?
npm (with -g flag)
SQL
Flask CLI
Docker CLI
What is JSX in React?
JavaScript XML
Java Syntax Extension
JSON Extension
Java Server eXtension
What is the benefit of Webpack?
Bundle multiple JS/CSS files into one
Create database
Process API
Run Node.js server
What does it npm auditdo?
Check for security vulnerabilities in dependencies
Create a build file
Run unit tests
Deploy to the server
Which tool supports hot-reload in Node.js front-end?
Webpack Dev Server
MySQL
Flask
MongoDB
What is the purpose of Virtual DOM in React?
Optimize interface updates
Manage database
Run Node.js server
Write CSS
In React, state what is ?
Variables that store data that changes over time
CSS style
Database
Constant variables
Which command installs React in a Node.js front-end project?
npm install react react-dom
npm add react
install react
npm get react
Which tool supports running TypeScript in Node.js front-end?
ts-node
Babel
SQLAlchemy
Flask
What type of framework is Flask in Python?
Micro web framework
Full-stack web framework
Data science framework
GUI framework
Flask is written in which language?
Python
Java
C++
JavaScript
Which command installs Flask?
pip install flask
npm install flask
conda flask install
python flask
@app.route() What is the purpose of in Flask ?
Define route/URL for function
Call other API
Connect to database
Define Python class
Which command runs a Flask app?
flask run
python run flask
node flask
npm start
By default, Flask runs on which port?
5000
3000
80
22
Which library is used for rendering HTML templates in Flask?
Jinja2
Bootstrap
React
Angular
Which code creates a simple Flask app?
from flask import Flask
app = Flask(__name__)
@app.route("/")
def home():
return "Hello Flask"
import flask
print("Flask App")
node app.js
Flask is often used with which database?
SQLite
Oracle
Firebase
MS Access
Which command checks Flask version?
pip show flask
pip show flask -v
What type of routing does Flask support?
Dynamic routing
Only static routing
No routing
CSS routing
What does Flask do render_template()?
Render HTML template
Render CSS
Render JSON API
Render database
By default, is Flask synchronous or asynchronous?
Synchronous
Asynchronous
Multi-threaded
Parallel
Which function does Flask use to return JSON data?
jsonify()
toJSON()
parseJSON()
renderJSON()
Is Flask a full-stack framework?
No
Yes
What is the framework of Flask
micro web framework
full-stack
What is Flask often referred to as in the Python community?
"Micro framework"
"Enterprise framework"
"Data framework"
"Game framework"
Which design pattern does Flask use?
MVC (Model-View-Controller)
MVVM
MVP
Layered
Can Flask be extended with plugins?
Yes
No
Which special variable in Flask identifies the module or package name?
__name__
__main__
__init__
__file__
What is the biggest advantage of Flask?
Lightweight, simple, easy to extend
Built-in powerful ORM
Default support for real-time
UI template available
