0% found this document useful (0 votes)
26 views7 pages

CH 7

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 7

CHAPTER : 7 OBSERVATIONS

CHAPTER – VII

OBSERVATIONS

1) What is HTML?
HTML stands for HyperText Markup Language. It is the standard markup language
used to create the structure and content of web pages.
2) What are HTML elements?
HTML elements are the building blocks of a web page. Each element is represented
by a tag that defines the structure or content on the page.
3) How do you create a hyperlink in HTML?
To create a hyperlink, you use the `<a>` (anchor) element with the `href` attribute,
like this:
<a href="https://example.com">Click here to visit Example</a>.
4) How can you add an image in HTML?
You use the `<img>` element with the `src` attribute to specify the image file's
URL, like this:
<img src="image.jpg" alt="Description of the image">.
5) What is the purpose of the HTML `<head>` element?
The `<head>` element contains meta-information about the document, such as its
title, links to stylesheets, character encoding, and more.
6) How do you create a bullet point list in HTML?
You use the `<ul>` (unordered list) element for an unordered list and `<li>` (list
item) elements for each item, like this:
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
7) How can you add a line break in HTML?
You use the `<br>` element to create a line break within text, like this:
This is the first line.<br>This is the second line.

Web Development Page 10


CHAPTER : 7 OBSERVATIONS

8) What is the purpose of HTML comments?


HTML comments, created using `<!-- comment -->`, allow you to add notes or
annotations within the HTML code that are not displayed in the browser. They are
useful for documenting your code.
9) How can you create a form in HTML?
To create a form, you use the `<form>` element and include various form elements
like `<input>`, `<textarea>`, `<select>`, etc. to collect user input.
10) What is the purpose of HTML semantic elements?
Semantic elements like `<header>`, `<footer>`, `<nav>`, `<article>`, `<section>`,
and others provide meaningful structure to a webpage, making it more understandable
to both developers and search engines.
11) What is CSS and what is its purpose?
CSS, or Cascading Style Sheets, is a style sheet language used to control the
presentation and layout of HTML documents. Its purpose is to separate the structure
(HTML) from the design (CSS) of a web page, making it easier to manage and style
the content
12) What are the different ways to include CSS in an HTML document?
There are three primary ways to include CSS in an HTML document:
Inline CSS: Using the `style` attribute within HTML elements to define styles for
that specific element.
Internal CSS: Including CSS within the `<style>` element in the `<head>` section
of the HTML document.
External CSS: Linking an external CSS file using the `<link>` element in the
`<head>` section.
13) What is the box model in CSS?
The CSS box model describes the structure of an HTML element, which consists of
four main parts: content, padding, border, and margin. Each of these parts contributes
to the overall layout and appearance of the element.
Content: The actual content of the element, where text and images are displayed.
Padding: The space between the content and the element's border.
Border: The border surrounding the padding and content.
Margin: The space outside the border, creating a gap between this element and its
neighboring elements.

Web Development Page 11


CHAPTER : 7 OBSERVATIONS

14) What are pseudo-classes and pseudo-elements in CSS?


Pseudo-classes and pseudo-elements are special keywords in CSS used to style
elements based on their state or position.
Pseudo-classes: These define the special state of an element that can be targeted for
styling, such as `:hover` (when the mouse hovers over the element) or `:first-child`
(selects the first child of its parent).
15) What is responsive web design in CSS?
Responsive web design is an approach that ensures a web page's layout and content
adapt and display optimally across various devices and screen sizes, such as desktops,
tablets, and smartphones. CSS plays a crucial role in achieving responsiveness by
using techniques like media queries and flexible grids/layouts
16) What is Node.js?
Node.js is an open-source, cross-platform JavaScript runtime environment that
allows developers to run JavaScript code outside a web browser. It's built on the V8
JavaScript engine and enables server-side execution of JavaScript.
17) How does Node.js differ from traditional JavaScript?
Traditional JavaScript runs in web browsers, allowing for client-side scripting. In
contrast, Node.js enables server-side scripting, allowing JavaScript to be executed on
the server and access server-specific functionalities.
18) What is the Node Package Manager (npm)?
npm is the default package manager for Node.js, providing a vast ecosystem of
reusable, open-source packages that can be easily installed, updated, and managed for
building applications.
19) What is the event-driven nature of Node.js?
Node.js operates on an event-driven, non-blocking I/O model. It uses the
EventEmitter class to handle events and callbacks to manage asynchronous
operations, allowing for efficient handling of multiple operations concurrently.
20) How can you handle errors in Node.js applications?
Error handling in Node.js can be done using try-catch blocks for synchronous code
and callback functions or promises for asynchronous operations. Additionally, you
can use middleware in frameworks like Express to handle errors in a centralized
manner.

Web Development Page 12


CHAPTER : 7 OBSERVATIONS

21) How does Virtual DOM works?


Virtual DOM works by comparing the current virtual DOM tree with a new virtual
DOM tree, and then applying the minimal set of changes to the actual DOM. This
allows React to efficiently update the user interface without causing unnecessary re-
renders or layout changes.
22) What Does DOM Stand For?
DOM stands for Document Object Model.
23) What is MongoDB?
MongoDB is a cross-platform, document-oriented NoSQL database program. It
uses a document-oriented data model and stores data in flexible, JSON-like BSON
(Binary JSON) format. It's designed to scale horizontally and provide high
performance and availability.
24) What is BSON in MongoDB?
BSON, or Binary JSON, is a binary representation of JSON-like documents used in
MongoDB. It extends the JSON model to provide additional data types and to be
efficient for encoding and decoding within different programming languages.
25) What are the key features of MongoDB?
Some key features of MongoDB include:
Document-Oriented: MongoDB stores data in flexible, JSON-like BSON format.
High Performance: It provides high performance for both read and write
operations.
High Availability: MongoDB offers features like replica sets for automatic
failover and data redundancy.
Scalability: It's designed to scale horizontally across many servers.
Schema-less: MongoDB is schema-less, allowing for flexibility in the structure of
the documents.
26) What is a MongoDB collection?
A MongoDB collection is a group of MongoDB documents. It is the equivalent of
an RDBMS (Relational Database Management System) table. Collections do not
enforce a schema; documents within a collection can have different fields and
structures.

Web Development Page 13


CHAPTER : 7 OBSERVATIONS

27) What is a MongoDB document?


A MongoDB document is a record in a MongoDB collection and is the basic unit of
data in MongoDB. Documents are represented using JSON-like BSON format. Each
document can have a different structure, which provides flexibility compared to
traditional relational databases.
28) What is a MongoDB database?
A MongoDB database is a physical container for collections. Each database has its
own set of collections. MongoDB can store multiple databases on a single instance,
making it versatile for managing different sets of data.
29) How does MongoDB ensure high availability?
MongoDB ensures high availability through features like replica sets. A replica set
is a group of MongoDB instances that maintain the same data set, providing
redundancy and automatic failover. If one node goes down, another node in the
replica set can take over to ensure continuous operation.
30) What is MongoDB Atlas?
MongoDB Atlas is a fully managed cloud-based database service provided by
MongoDB, Inc. It offers the ability to easily deploy, operate, and scale MongoDB
databases in the cloud without the need for manual configuration of servers.
31) What is ReactJS?
ReactJS is a JavaScript library used for building user interfaces or UI components,
particularly for single-page applications where data can be updated and rendered
efficiently.
32) How does ReactJS differ from traditional JavaScript frameworks?
ReactJS focuses on component-based architecture and efficient rendering, while
traditional frameworks often use a more MVC (Model-View-Controller) approach.
33) What is JSX in React?
JSX is a syntax extension for JavaScript that looks similar to XML or HTML and
is used with React to describe what the UI should look like.
34) Explain the virtual DOM in React?
The virtual DOM is a lightweight copy of the actual DOM in memory, used to
increase efficiency and performance by minimizing direct manipulation of the real
DOM.

Web Development Page 14


CHAPTER : 7 OBSERVATIONS

35) How do you create a component in React?


Components in React can be created using either function components or class
components. Function components are simpler and utilize functional syntax, while
class components extend the React.Component class.
36) What are state and props in React?
State is an internal data storage managed within a component, while props (short
for properties) are passed into a component from its parent to configure its behavior
and appearance.
37) How is state different from props in React?
State is managed internally within a component and can be changed, while props
are passed from a parent component and cannot be changed within the child
component.
38) What is the purpose of setState() in React?
setState() is a method used to update the state of a React component and trigger a
re-render of the component and its children.
39) Explain the component lifecycle methods in React?
React component lifecycle methods include mounting, updating, and unmounting
phases. Examples include componentDidMount(), componentDidUpdate(), and
componentWillUnmount().
40) How can you handle events in React?
Events in React are handled using event handlers like onClick, onChange, etc.,
which are defined as attributes in JSX.
41) What is conditional rendering in React?
Conditional rendering involves showing different UI elements or components
based on certain conditions, typically achieved using if-else or ternary operators.
42) What are React hooks?
React hooks are functions that allow functional components to have state and
other features previously available only in class components, such as useState and
useEffect.
43) What is the significance of keys in React lists?
Keys are used to uniquely identify elements in a list, aiding in efficient DOM
updates and reconciliation during rendering.

Web Development Page 15


CHAPTER : 7 OBSERVATIONS

44) What is the purpose of the useEffect() hook in React?


useEffect() is used to perform side effects in functional components, like data
fetching, subscriptions, or manually changing the DOM.
45) How can you pass data from child to parent components in React?
Data can be passed from child to parent components through callback functions
passed as props from the parent to the child.
46) What is a higher-order component (HOC) in React?
A higher-order component is a function that takes a component and returns a new
enhanced component, often used for code reuse and logic sharing.
47) How does React handle forms and form elements?
React manages form elements by using controlled components, where form data is
controlled by React and updated via state.
48) What is the purpose of React Router?
React Router is used for handling routing and navigation in a React application,
allowing users to navigate to different pages without a full page refresh.
49) What is Redux, and how does it relate to React?
Redux is a state management library used to manage the state of a JavaScript
application in a predictable way. React-Redux is a binding that connects Redux to
React, making it easier to manage state within a React application.
50) What are React functional components and class components?
Functional components are stateless components that are simpler and utilize
functional syntax. Class components are stateful components that extend the
React.Component class and can hold and manage local state.

Web Development Page 16

You might also like