1. Which command is used to create a new Node.js project?
A. node init
B. npm install
C. npm init
D. node create
Answer: c) npm init
Rationale: The npm init command is used to create a new Node.js project by
generating a package.json file.
2. What is the purpose of the componentDidMount lifecycle method in React?
A. To handle error boundaries
B. To initialize data after the component mounts
C. To update the state of the component
D. To render the component
Answer: b) To initialize data after the component mounts
Rationale: componentDidMount is called after a component has mounted to the DOM,
and it’s commonly used for data fetching or initialization tasks.
,3. Which of the following is a feature of SQL databases?
A. Schema-less structure
B. Relational data model with tables and rows
C. Horizontal scaling
D. JSON-like storage format
Answer: b) Relational data model with tables and rows
Rationale: SQL databases are relational and organize data into tables with rows and
columns, enforcing a structured schema.
4. Which language is commonly used for backend development in full-stack
development?
A. HTML
B. Python
C. CSS
D. SQL
Answer: b) Python
Rationale: Python is a popular backend language that is often used in full-stack
development, alongside other languages such as Node.js, Java, and PHP.
, 5. Which of the following is a valid React hook used for managing state?
A. useEffect
B. useState
C. useContext
D. All of the above
Answer: d) All of the above
Rationale: useState, useEffect, and useContext are all valid React hooks used for
managing state, side effects, and context, respectively.
6. What is the purpose of Node.js in full-stack development?
A. To create static webpages
B. To handle backend logic and APIs
C. To manage frontend UI components
D. To perform database queries
Answer: b) To handle backend logic and APIs
Rationale: Node.js is a JavaScript runtime environment that allows developers to use
JavaScript for backend development, including handling APIs and server-side logic.
A. node init
B. npm install
C. npm init
D. node create
Answer: c) npm init
Rationale: The npm init command is used to create a new Node.js project by
generating a package.json file.
2. What is the purpose of the componentDidMount lifecycle method in React?
A. To handle error boundaries
B. To initialize data after the component mounts
C. To update the state of the component
D. To render the component
Answer: b) To initialize data after the component mounts
Rationale: componentDidMount is called after a component has mounted to the DOM,
and it’s commonly used for data fetching or initialization tasks.
,3. Which of the following is a feature of SQL databases?
A. Schema-less structure
B. Relational data model with tables and rows
C. Horizontal scaling
D. JSON-like storage format
Answer: b) Relational data model with tables and rows
Rationale: SQL databases are relational and organize data into tables with rows and
columns, enforcing a structured schema.
4. Which language is commonly used for backend development in full-stack
development?
A. HTML
B. Python
C. CSS
D. SQL
Answer: b) Python
Rationale: Python is a popular backend language that is often used in full-stack
development, alongside other languages such as Node.js, Java, and PHP.
, 5. Which of the following is a valid React hook used for managing state?
A. useEffect
B. useState
C. useContext
D. All of the above
Answer: d) All of the above
Rationale: useState, useEffect, and useContext are all valid React hooks used for
managing state, side effects, and context, respectively.
6. What is the purpose of Node.js in full-stack development?
A. To create static webpages
B. To handle backend logic and APIs
C. To manage frontend UI components
D. To perform database queries
Answer: b) To handle backend logic and APIs
Rationale: Node.js is a JavaScript runtime environment that allows developers to use
JavaScript for backend development, including handling APIs and server-side logic.