0% found this document useful (0 votes)
35 views86 pages

FULL STACK Ans Key

The document contains a comprehensive set of questions and answers related to Full Stack development, covering HTML, CSS, JavaScript, and React JS. It includes fundamental concepts, differences between various elements and methods, and practical examples. This resource serves as a quiz or study guide for individuals preparing for placement in web development roles.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views86 pages

FULL STACK Ans Key

The document contains a comprehensive set of questions and answers related to Full Stack development, covering HTML, CSS, JavaScript, and React JS. It includes fundamental concepts, differences between various elements and methods, and practical examples. This resource serves as a quiz or study guide for individuals preparing for placement in web development roles.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 86

PLACEMENT

FULL STACK QUESTIONS(2 MARK/QUIZ)

HTML
1. What is HTML and why is it important?

HTML (HyperText Markup Language) is the standard language used to create and
structure web pages. It defines the elements and layout of a webpage, making it
essential for web development.

2. What are HTML elements and tags?

HTML elements define the structure of a webpage, while tags are the keywords
enclosed in angle brackets (<>) used to create elements. For example, <p> is a tag
for a paragraph element.

3. What is the difference between HTML and XHTML?

HTML is more flexible with syntax, whereas XHTML is a stricter version of HTML
that follows XML rules, requiring well-formed code and proper nesting of elements.

4. What is the purpose of the <!DOCTYPE> declaration in HTML?

The <!DOCTYPE> declaration specifies the HTML version used in the document. It
ensures proper rendering by browsers and helps maintain compatibility with web
standards.

5. What is the difference between block-level and inline elements in HTML?

Block-level elements (e.g., <div>, <p>) start on a new line and take full width, while
inline elements (e.g., <span>, <a>) stay within the same line and only take up
necessary space.

6. What are semantic elements in HTML?


PLACEMENT

Semantic elements provide meaningful structure to a webpage, improving


readability and accessibility. Examples include <header>, <article>, <section>, and
<footer>.

7. What is the difference between <div> and <span>?

<div> is a block-level container used for layout, while <span> is an inline container
used for styling or grouping small text portions within a line.

8. How do you create a hyperlink in HTML?

Use the <a> tag with the 'href' attribute: <a href='https://example.com'>Click
Here</a>. The text inside the tag becomes a clickable link.

9. What are HTML forms used for?

HTML forms collect user input using elements like <input>, <textarea>, <select>,
and <button>. They are used for login forms, search boxes, and data submission.

10. What is the difference between GET and POST methods in HTML forms?

GET appends data to the URL, making it visible, while POST sends data in the
request body, making it secure for sensitive information like passwords.

11. What are meta tags in HTML?

Meta tags provide metadata about a webpage, such as character encoding,


description, and keywords. Example: <meta charset='UTF-8'>.

12. What is the purpose of the <alt> attribute in an <img> tag?

The 'alt' attribute provides alternative text for an image, improving accessibility and
displaying text when the image fails to load.
PLACEMENT

13. How can you embed a video in an HTML page?

Use the <video> tag: <video controls><source src='video.mp4'


type='video/mp4'></video>. The 'controls' attribute adds playback controls.

14. What is the difference between absolute and relative URLs?

Absolute URLs specify the full web address (e.g., https://example.com/page.html),


while relative URLs specify paths relative to the current page (e.g., /page.html).

15. What is the difference between the <table> and <div> elements?

<table> is used for displaying tabular data, while <div> is a generic container used
for styling and layout purposes.

16. What is the purpose of the <iframe> tag?

The <iframe> tag embeds another webpage within the current page, useful for
including maps, videos, or external content.

17. What is the difference between <strong> and <b> tags?

<strong> indicates strong importance and affects screen readers, while <b> only
applies bold styling without semantic meaning.

18. What is the difference between <em> and <i> tags?

<em> gives emphasis with semantic meaning, affecting screen readers, while <i>
only applies italic styling without conveying importance.

19. What is the purpose of the HTML5 localStorage feature?


PLACEMENT

localStorage allows web applications to store data persistently in the browser,


accessible even after a page reload.

20. What is the difference between HTML and CSS?

HTML structures content using elements and tags, while CSS (Cascading Style
Sheets) styles and enhances the presentation of those elements.

CSS
1. What is the difference between CSS Grid and Flexbox?

Answer:

 CSS Grid: A two-dimensional layout system that controls both rows and
columns.
 Flexbox: A one-dimensional layout system, useful for aligning items in a row
or column.
 Use Grid for complex layouts, and Flexbox for distributing space efficiently
in a single direction.

2. What is the difference between relative, absolute, fixed, and sticky


positioning?

Answer:

 Relative: Moves relative to its normal position.


 Absolute: Moves relative to the nearest positioned ancestor or the viewport
if none exists.
 Fixed: Stays in place relative to the viewport.
 Sticky: Behaves like relative until a scroll threshold is met, then sticks in
place.
PLACEMENT

3. What is the purpose of the z-index property in CSS?

Answer: The z-index property controls the stack order of overlapping elements.
Higher values bring elements to the front. Example:

div { position: absolute; z-index: 10; }

4. How does @media work in CSS?

Answer: The @media rule applies styles based on screen size or device type.
Example:

@media (max-width: 600px) {

body { background-color: lightblue; }

5. What is the difference between inline, block, and inline-block elements?

Answer:

 Inline: Does not start on a new line and takes up only as much width as
necessary. (<span>, <a>)
 Block: Starts on a new line and takes up the full width. (<div>, <p>)
 Inline-block: Behaves like an inline element but allows setting width and
height. (<button>, <img>)

6. What is the difference between opacity and visibility in CSS?


PLACEMENT

Answer:

 opacity: 0; makes the element fully transparent but still takes up space.
 visibility: hidden; hides the element but still occupies space.
 display: none; removes the element completely from the document flow.

7. What is Flexbox in CSS?

Answer:

Flexbox (Flexible Box Layout) is a CSS layout model designed to distribute


space dynamically among items in a container, making it easier to create responsive
designs. It allows elements to align, distribute, and resize efficiently within a
container, even when the size of the container is unknown. The main properties
used in Flexbox include justify-content, align-items, and flex-wrap for precise
control over item positioning.

8. What is the difference between grid-template-areas and grid-template-


columns?

Answer:

 grid-template-areas: Defines named layout areas for elements in a grid.


 grid-template-columns: Defines the number and size of columns in a grid.
Example:
.container {

display: grid;

grid-template-areas: "header header"

"sidebar content";

grid-template-columns: 1fr 2fr;


PLACEMENT

9. What is mix-blend-mode in CSS?

Answer: The mix-blend-mode property controls how an element's content blends


with the background. Example:

.text { mix-blend-mode: multiply; }

It creates cool overlay effects by blending layers.

10. How does clip-path differ from mask in CSS?

Answer:

 clip-path: Defines a visible shape by clipping the element.


 mask: Uses gradients or images to control visibility with transparency.
Example:
img { clip-path: circle(50%); }

Here are 5 more two-mark CSS questions with answers in the same structured
format:

11. What is the difference between min-width, max-width, and width?

Answer:

min-width: Ensures an element does not shrink below a certain width.


max-width: Ensures an element does not exceed a certain width.
width: Defines a fixed width for the element.
Example:
PLACEMENT

div {

min-width: 200px;

max-width: 600px;

width: 50%;

12. How does will-change improve performance in CSS?

Answer:

The will-change property hints to the browser about upcoming changes,



allowing it to optimize rendering in advance.
 It should be used carefully to avoid unnecessary memory usage.
Example:

div { will-change: transform, opacity; }

13. What is the purpose of backdrop-filter in CSS?

Answer:

The backdrop-filter property applies graphical effects like blur or contrast to



the background behind a semi-transparent element.
 Useful for glassmorphism UI effects.
Example:

.modal {

backdrop-filter: blur(10px);

}
PLACEMENT

14. What is the difference between nth-child() and nth-of-type()?

Answer:

nth-child(n): Selects the nth child of any type inside the parent.

nth-of-type(n): Selects the nth child of a specific element type.

Example:

p:nth-child(2) { color: red; } /* Targets the second element, regardless of type */

p:nth-of-type(2) { color: blue; } /* Targets the second `<p>` only */

15. What is scroll-snap and how does it work in CSS?

Answer:

The scroll-snap property enables precise scrolling behavior to specific



points, improving user experience on carousels or lists.
Example:

.container {

scroll-snap-type: y mandatory;

.item {

scroll-snap-align: start;

JAVA SCRIPT
PLACEMENT

1. What is JavaScript and how is it used?


JavaScript is a high-level, interpreted programming language used to create
dynamic and interactive web pages. It is commonly used for client-side
scripting in web development.

2. What is the difference between let, const, and var in JavaScript?


var is function-scoped, while let and const are block-scoped. const is used for
values that should not be reassigned, while let allows variable reassignment.

3. What are arrow functions in JavaScript?


Arrow functions provide a shorter syntax for writing functions using the =>
symbol. They do not have their own this binding, making them useful for
callbacks and short functions.

4. Explain the concept of closures in JavaScript.


A closure is a function that remembers the variables from its lexical scope
even when the function is executed outside that scope. It allows functions to
access outer variables.

5. What is the Document Object Model (DOM) in JavaScript?


The DOM is a tree-like structure representing the contents of a webpage.
JavaScript can manipulate the DOM to dynamically update HTML elements
and respond to user interactions.

6. What is the difference between synchronous and asynchronous


JavaScript?
Synchronous code is executed line-by-line in a sequence, blocking further
execution until the current task is completed. Asynchronous code allows
non-blocking execution using callbacks, promises, or async/await.

7. What is the purpose of the this keyword in JavaScript?


The this keyword refers to the current execution context. Its value depends
on how a function is called—global object, object method, or constructor
function.

8. What are promises in JavaScript?


Promises represent the eventual completion or failure of an asynchronous
PLACEMENT

operation. They have three states: pending, resolved (fulfilled), and rejected,
allowing better handling of asynchronous tasks.

9. Explain event delegation in JavaScript.


Event delegation is a technique where a parent element handles events for
its child elements using event bubbling. It improves performance by reducing
the number of event listeners.

10. What is the difference between null and undefined in JavaScript?


null is an intentional absence of a value, while undefined means a variable
has been declared but not assigned a value. Both are falsy but represent
different concepts.

11. What is the purpose of JSON.stringify() and JSON.parse()?


JSON.stringify() converts a JavaScript object into a JSON string. JSON.parse()
does the reverse, converting a JSON string into a JavaScript object.

12. What is the difference between map(), filter(), and reduce()?


map() transforms each array element, filter() returns elements that meet a
condition, and reduce() accumulates values into a single output by applying a
function iteratively.

13. How does the setTimeout() function work in JavaScript?


setTimeout() is an asynchronous method that executes a callback function
after a specified delay in milliseconds without blocking the main execution
thread.

14. What are template literals in JavaScript?


Template literals are enclosed by backticks (`) and allow embedded
expressions using ${}. They support multi-line strings and variable
interpolation.

15. What is the difference between localStorage, sessionStorage, and


cookies?
localStorage stores data with no expiration, sessionStorage keeps data until
the session ends, and cookies store small amounts of data with optional
expiration on the client-side.
PLACEMENT

16. What is the difference between apply() and call() methods in


JavaScript?
apply() and call() both invoke a function with a specific this value. The
difference is that call() accepts arguments individually, while apply() takes
them as an array.

17. What is the purpose of the Array.prototype.splice() method?


The splice() method adds, removes, or replaces elements in an array. It
modifies the original array and returns the removed elements.

18. What are default parameters in JavaScript?


Default parameters allow functions to initialize arguments with default
values if no value is provided during the function call.

19. What is the difference between deep copy and shallow copy?
A shallow copy duplicates only the outer object, while a deep copy
recursively duplicates all nested objects and arrays.

20. What is the use of the Object.freeze() method?


Object.freeze() prevents modification of an object’s properties and values. It
makes the object immutable, disallowing additions, deletions, and updates.

21. How does the async and await syntax work in JavaScript?
async declares a function that returns a promise, while await pauses the
execution of an async function until the promise is resolved or rejected.

22. What is the purpose of the Object.keys() method?


Object.keys() returns an array of an object's own enumerable property
names, in the same order as a for...in loop.

23. What is an Immediately Invoked Function Expression (IIFE)?


An IIFE is a function that is executed immediately after its definition. It is
often used to create a local scope and avoid polluting the global namespace.

24. What is the difference between sessionStorage and localStorage?


sessionStorage stores data temporarily for the duration of a page session,
PLACEMENT

while localStorage retains data permanently until manually cleared.

25. What is the purpose of the bind() method in JavaScript?


bind() creates a new function with a specified this value and optional
arguments, without immediately invoking the original function.

REACT JS

1. What is the difference between React’s state and props?


o State is managed within the component and can be changed, while
props are passed from parent to child and are immutable within the
receiving component.
2. How does React use the Virtual DOM to improve performance?
o The Virtual DOM is a lightweight copy of the real DOM. React updates
the Virtual DOM first, compares it with the previous version (diffing
algorithm), and updates only the necessary parts in the actual DOM
(reconciliation process), making updates more efficient.
3. What is React Fiber, and how does it enhance rendering?
o React Fiber is the re-implementation of React’s core algorithm for
rendering. It allows React to pause, prioritize, and resume
rendering tasks, making UI updates smoother and faster.
4. Explain the concept of React Hooks and give an example.
o React Hooks allow function components to manage state and lifecycle
features without needing a class component. Example:
o import { useState } from 'react';
o function Counter() {
o const [count, setCount] = useState(0);
o return <button onClick={() => setCount(count + 1)}>Count:
{count}</button>;
PLACEMENT

o }
5. How does the useEffect hook differ from componentDidMount and
componentDidUpdate?
o useEffect combines the behavior of componentDidMount,
componentDidUpdate, and componentWillUnmount in class
components. It runs after the component renders and can clean up
resources when dependencies change.
useEffect(() => {

console.log("Component Mounted or Updated");

return () => console.log("Cleanup on Unmount");

}, []);

6. What is React StrictMode, and why is it used?


o StrictMode is a wrapper component that detects unsafe lifecycle
methods, finds unexpected side effects, and highlights potential
issues in the React app during development.
7. Explain the role of keys in React lists.
o Keys help React identify which items have changed, been added, or
removed in a list. They improve rendering performance and
should be unique, usually using an id or index value.
o {items.map(item => <li key={item.id}>{item.name}</li>)}
8. What is server-side rendering (SSR) in React, and how does it benefit
performance?
o SSR renders React components on the server before sending the
HTML to the client. This improves SEO, faster initial page loads, and
performance for users on slow networks.
9. How does React handle forms, and what is controlled vs. uncontrolled
components?
o React handles forms using controlled components, where form
values are managed via useState(). Uncontrolled components rely
on direct DOM manipulation (ref).
 Controlled Example:
PLACEMENT

const [value, setValue] = useState('');

<input value={value} onChange={e => setValue(e.target.value)}


/>;

 Uncontrolled Example:
const inputRef = useRef();

<input ref={inputRef} />;

10. What is the difference between React Context API and Redux?
o Context API is used for simple state sharing across components,
whereas Redux is a centralized state management system with
actions, reducers, and a store, useful for large-scale applications.

NODE JS AND EXPRESS


1.What is Node.js?

Node.js is a runtime environment that allows JavaScript to run outside the


browser, built on the V8 engine. It is asynchronous, event-driven, and non-
blocking, making it efficient for I/O-heavy applications.

2.What is the role of the Event Loop in Node.js?

The Event Loop allows Node.js to perform non-blocking I/O operations by


processing callbacks in different phases without waiting for tasks to complete.

3.What are the advantages of using Node.js?


PLACEMENT

Non-blocking I/O, single programming language (JavaScript), scalability, high


performance, and a rich package ecosystem (npm).

4.What is the difference between process.nextTick() and setImmediate()?

process.nextTick() executes the callback before the next event loop cycle, while
setImmediate() executes it after the current I/O phase.

5.What are Streams in Node.js?

Streams allow efficient handling of large data by processing it in chunks rather


than loading it all at once. Types: Readable, Writable, Duplex, Transform.

6.What is Express.js?

Express.js is a minimal and flexible Node.js framework used to build web


applications and APIs.

7.How do you install and set up Express.js?

Install using npm install express. Basic setup:

const express = require('express');


const app = express();
app.listen(3000, () => console.log("Server running on port 3000"));

8.What is middleware in Express.js?

Middleware functions modify request/response objects before they reach the


final route handler.

9.What are the different types of middleware in Express.js?


PLACEMENT

Application-level, Router-level, Built-in, Third-party, and Error-handling


middleware.

10.How do you handle errors in Express.js?

Use an error-handling middleware:

app.use((err, req, res, next) => {


res.status(500).send("Something went wrong!");
});

11.How do you define a route in Express.js?

app.get('/home', (req, res) => res.send('Welcome!'));

12.What is the difference between app.use() and app.get()?

app.use() is for middleware; app.get() is for handling GET requests.

13.How do you send JSON responses in Express.js?

Use res.json():

res.json({ message: "Hello World" });

14.How do you extract query parameters in Express.js?

Use req.query:

app.get('/user', (req, res) => res.send(req.query.name));

15.How do you extract URL parameters in Express.js?


PLACEMENT

Use req.params:

app.get('/user/:id', (req, res) => res.send(req.params.id));

16.How do you implement JWT authentication in Express.js?

Use jsonwebtoken:

const jwt = require('jsonwebtoken');


const token = jwt.sign({ user: "John" }, "secretKey");

17.How do you verify JWT tokens in Express.js?

Use jwt.verify():

jwt.verify(token, "secretKey", (err, decoded) => {});

18.How do you implement CORS in Express.js?

Use the cors package:

const cors = require('cors');


app.use(cors());

19.How do you prevent SQL injection in Node.js?

Use parameterized queries with an ORM like Sequelize or mysql2.

20.How do you hash passwords in Node.js?

Use bcrypt:
PLACEMENT

const bcrypt = require('bcrypt');


const hashedPassword = await bcrypt.hash("password123", 10);

21.How do you connect MongoDB with Express.js?

Use Mongoose:

const mongoose = require('mongoose');


mongoose.connect('mongodb://localhost:27017/mydb');

MONGODB:
1. How does MongoDB ensure high availability?

MongoDB ensures high availability using replication. A replica set consists of


multiple nodes where:

 One primary node handles writes.


 Multiple secondary nodes replicate data for failover support.
 If the primary fails, an automatic election occurs, promoting a secondary to
primary.

2. What is sharding in MongoDB, and why is it used?

Sharding is a method to distribute data across multiple servers to handle large


datasets efficiently.

 It is used to ensure horizontal scalability.


 Data is partitioned into shards based on a shard key.
 A mongos router directs client queries to the appropriate shard.
PLACEMENT

Example of enabling sharding:

sh.enableSharding("myDatabase")

3. Explain the difference between $push and $addToSet in MongoDB.

Both operators add elements to an array field, but they work differently:

 $push: Adds an element to an array, allowing duplicates.


 $addToSet: Adds only if the value does not already exist in the array.
Example:

db.users.updateOne({name: "John"}, {$push: {hobbies: "Football"}}) // Allows


duplicates

db.users.updateOne({name: "John"}, {$addToSet: {hobbies: "Football"}}) //


Prevents duplicates

4. What is an Aggregation Framework in MongoDB?

The aggregation framework processes data in stages (like a pipeline) to perform


operations such as filtering, grouping, and sorting.
Example:

db.sales.aggregate([

{ $match: { status: "completed" } }, // Filter documents

{ $group: { _id: "$product", totalSales: { $sum: "$amount" } } } // Group & calculate


sales

])

5. How does MongoDB handle transactions?


PLACEMENT

MongoDB supports multi-document transactions starting from version 4.0,


ensuring ACID compliance.
Example:

const session = db.getMongo().startSession();

session.startTransaction();

try {

session.getDatabase("testDB").collection("accounts").updateOne(

{ _id: 1 }, { $inc: { balance: -100 } }, { session }

);

session.getDatabase("testDB").collection("accounts").updateOne(

{ _id: 2 }, { $inc: { balance: 100 } }, { session }

);

session.commitTransaction();

} catch (e) {

session.abortTransaction();

session.endSession();

If any operation fails, the entire transaction is rolled back.

6. What are the different types of indexes in MongoDB?

1. Single Field Index: Index on a single field ({field: 1} for ascending).


2. Compound Index: Index on multiple fields ({field1: 1, field2: -1}).
3. Multikey Index: Index on array fields.
PLACEMENT

4. Text Index: Supports text search (db.collection.createIndex({field: "text"})).


5. Hashed Index: Hash-based indexing for sharded collections.

7. How can you analyze query performance in MongoDB?

MongoDB provides the explain() method to analyze query execution.


Example:

db.orders.find({status: "shipped"}).explain("executionStats")

It provides details about index usage, execution time, and query plan.

8. What is the difference between find() and aggregate() in MongoDB?

 find(): Used for simple queries with filters.


db.users.find({age: {$gt: 25}})

 aggregate(): Used for complex data processing in stages.


db.users.aggregate([

{ $match: { age: { $gt: 25 } } },

{ $group: { _id: "$city", total: { $sum: 1 } } }

])

9. What are $lookup and $unwind in MongoDB?

 $lookup: Performs a JOIN operation (like in SQL) between two collections.


 $unwind: Deconstructs an array field into multiple documents.
Example of $lookup:

db.orders.aggregate([

{
PLACEMENT

$lookup: {

from: "customers",

localField: "customerId",

foreignField: "_id",

as: "customerDetails"

])

Example of $unwind:

db.users.aggregate([

{ $unwind: "$hobbies" }

])

This creates a separate document for each hobby in the array.

10. How do you back up and restore a MongoDB database?

Answer:

 To backup:
mongodump --db myDatabase --out /backupDir

 To restore:
mongorestore --db myDatabase /backupDir/myDatabase
PLACEMENT

MYSQL
1. What is MySQL and How does it differ from other relational databases?

MySQL is an open-source relational database management system (RDBMS) that


is widely used for managing structured data. It utilizes SQL (Structured Query
Language) for querying and managing data. MySQL is known for its reliability,
scalability, and performance, making it a popular choice for various applications

2. How to create a database in MySQL?

To create a database in MySQL, we can use the CREATE DATABASE statement


followed by the name we want to give to our database. For example:

CREATE DATABASE mydatabase;

3. Difference between CHAR and VARCHAR data types.

 CHAR: Fixed-length character data type where the storage size is predefined.
Trailing spaces are padded to reach the defined length.
 VARCHAR: Variable-length character data type where the storage size depends
on the actual data length. No padding of spaces is done.

4. Explain the differences between SQL and MySQL?

SQL MySQL

It is a structured query language that


It is a relational database
manages the relational database
management system that uses SQL.
management system.
PLACEMENT

SQL MySQL

MySQL is an open-source platform. It


It is not an open-source language.
allows access to anyone.

SQL supports XML and user defined It doesn’t support XML and any user
functions. defined functions

SQL can be implemented in various MySQL is a specific implementation of


RDBMS such as PostgreSQL, SQLite, an RDBMS that uses SQL for querying
Microsoft SQL Server, and others. and managing databases.

MySQL is open-source and available


SQL itself is not a product and doesn’t
under the GNU General Public License
have a license. It’s a standard language.
(GPL).

5. What is the MySQL server’s default port?

3306 is MySQL server‘s default port.

6. How can we learn batch mode in MySQL?

Below is the syntax used to run batch mode.

mysql <batch-file>;

mysq <batch-file> mysql.out

7. How many different tables are present in MySQL?

There are 5 types of tables present in MySQL.


PLACEMENT

 Heap table
 merge table
 MyISAM table
 INNO DB table
 ISAM table

8. What are the differences between CHAR and VARCHAR data types in MySQL?

 Storage and retrieval have been different for CHAR and VARCHAR.
 Column length is fixed in CHAR but VARCHAR length is variable.
 CHAR is faster than VARCHAR.
 CHAR datatype can hold a maximum of 255 characters while VARCHAR can store
up to 4000 characters.

9. What is Difference between CHAR_LENGTH and LENGTH?

LENGTH is byte count whereas CHAR_LENGTH is character count. The numbers are
the same for Latin characters but different for Unicode and other encodings.

Syntax of CHAR_LENGTH:

SELECT CHAR_LENGTH(column_name) FROM table_name;

Syntax of LENGTH:

SELECT LENGTH(column_name) FROM table_name;

10. What do you understand by % and _ in the like statement?

‘_’ corresponds to only one character but ‘%’ corresponds to zero or more
characters in the LIKE statement.
PLACEMENT

11. Which storage engines are used in MySQL?

Storage engines are also called table types. Data is stored in a file using multiple
techniques.

Below are some techniques.

 Locking Level
 Indexing
 Storage mechanism
 Capabilities and functions

12. What are string types available for columns?

There are six string types available for the column.

 SET
 BLOB
 TEXT
 ENUM
 CHAR
 VARCHAR

13. Explain the main difference between FLOAT and DOUBLE?

 FLOAT stored floating point number with 8 place accuracy. The size of FLOAT is
4 bytes.
 DOUBLE also stored floating point numbers with 18 place accuracy. The size of
DOUBLE is 8 bytes.

14. Explain the differences between BLOB and TEXT.

BLOB:
PLACEMENT

A BLOB is a large object in binary form that can hold a variable amount of data.
Sorting and comparing in BLOB values are case-sensitive.

There are four types of BLOB.

 TINYBLOB
 BLOB
 MEDIUMBLOB
 LONGBLOB
TEXT:

Sorting and comparison are performed in case-insensitive for TEXT values. we can
also say a TEXT is case-insensitive BLOB.

There are four types of TEXT.

 TINYTEXT
 TEXT
 MEDIUMTEXT
 LONGTEXT

15. Explain the difference between having and where clause in MySQL.

 WHERE statement is used to filter rows but HAVING statement is used to filter
groups.
 GROUP BY is not used with WHERE. HAVING clause is used with GROUP BY.

16. Explain REGEXP?

REGEXP is a pattern match where the pattern is matched anywhere in the search
value.
PLACEMENT

17. How can we add a column in MySQL?

A column is a series of table cells that store a value for table’s each row. we can add
column by using ALTER TABLE statement.

ALTER TABLE tab_name

ADD COLUMN col_name col_definition [FIRST|AFTER exist_col];

18. How to delete columns in MySQL?

We can remove columns in MySQL by using ALTER TABLE statement.

Syntax:

ALTER TABLE table_name DROP COLUMN column1, column2…

19. How to delete a table in MySQL?

We can delete a table by using DROP TABLE statement. This statement deletes
complete data of table.

DROP TABLE table-name;

20. How are mysql_fetch_array() and mysql_fetch_object() different from each


another?

mysql_fetch_array() Gets a result row as a related array or a regular array from


database. mysql_fetch_object gets a result row as an object from the database.

GIT HUB:
1. What is Git?
Git is a distributed version control system (DVCS) that is used to track changes in
PLACEMENT

source code during software development. It permits multiple developers to work


on a project together without interrupting each other's changes. Git is especially
popular for its speed, and ability to manage both small and large projects capably.

2. What is a repository in Git?


A Git repository (or repo) is like a file structure that stores all the files for a project.
It continues track changes made to these files over time, helping teams work
together evenly. Git can control both local repositories (on your own machine) and
remote repositories (usually hosted on platforms like GitHub, GitLab, or Bitbucket),
allowing teamwork and backup.

3. What is the difference between Git and GitHub?

4. What is origin in Git?


In Git, "origin" states to the default name offered to the remote repository from
which local repository was cloned. Git origin is used as a reference to control fetches,
pulls, and pushes.

5. What is the purpose of the .gitignore file?


The '.gitignore' file tells Git which files and folders to ignore when tracking changes.
PLACEMENT

It is used to avoid attaching unneeded files (like logs, temporary files, or compiled
code) to your repository. This saves repository clean and targeted on important files
only.

6. What is a version control system (VCS)?


A version control system (VCS) records the work of developers coordinating on
projects. It keeps the history of code changes, permitting developers to add new
code, fix bugs, and run tests securely. If required, they can restore a past working
version, verifying project security.

7. What is the git push command?


The 'git push' command is used to share local repository changes to a remote
repository. It changes the remote repository with the recent commits from the fixed
local branch.

8. What is the git pull command?


The 'git pull' command updates the current local branch with changes from a remote
repository and combining it with a local repository.

9. What does git clone do?


The git clone forms a copy of a remote repository upon your local machine. Git clone
downloads all files, branches, and history, enabling you to start working on the
project or contribute to it. With git clone -b , you can download and work on an
individual branch of a repository.

10. What are the advantages of using GIT?


Using Git provides multiple advantages:

It assists teamwork by supporting multiple developers to work on the same project


PLACEMENT

together.
Each developer has a local copy of the repository, improving performance and
enabling offline work.
Free and widely supported.
Git supports work on various types of projects.
Each repository has only one Git directory.
11. What is the difference between git init and git clone?
The git init develops a new, empty Git repository in the present directory, while 'git
clone' copies an existing remote repository, containing all files and history, to a local
directory.

12. What is git add?


The git add command marks changes in your project for the next commit. It tells Git
which files to involve in the later update, making them ready to be saved in the
repository. This is the early step in recording changes in the Git repository.

13. What is git status?


The 'git status' command shows the recent status of your Git repository. It tells you
which files have changed, which ones are ready to be committed, and which ones
are new and unobserved. This benefits you monitor your work's growth and see
what changes want to be set up or committed.

14. What is a commit in Git?


A commit in Git denotes a snapshot of changes made to files in a repository. It grabs
all the changes you have made to files—like additions, or deletions of files at a
particular moment. Each commit has a unique message explaining what was done.
This helps you track your project's history, undo changes if requisite, and work with
others on the same project.
PLACEMENT

15. What is the purpose of the git clean command?


The git clean command is used to erase ignored files from the working directory of
Git repository. Its motive is to clean up the workspace by deleting files that are not
being saved by Git, checking a clean state with only observed files present.

16. What is a 'conflict' in git?


Git usually manages merges automatically, but conflicts occur when two branches
edit the same line or when one branch deletes a file that another edits.

17. What is the meaning of 'Index' in GIT?


In Git, the 'Index' (also called as the "Staging Area") is a place where alterations are
temporarily store before committing them to the repository. It permits you to select
and prepare specific alterations from your working directory before properly
saving them as part of the project's history.

18. How do you change the last commit in git?


To change the preceding commit in Git, use 'git commit --amend' after making
changes, stage them with 'git add' , and save with the editor.

19. What is `git checkout`?


The 'git checkout' helps you switch between branches or return files to a previous
state in Git. Now, it is suggested to use 'git switch' for changing branches and 'git
restore' to return files. These commands are more intent on their particular tasks
for better clearness and capability.

20. How do you switch branches in Git?


To switch branches in Git, use 'git checkout ' to move to a present branch. On the
other hand, use git switch in newer Git versions for the same objective. This permits
PLACEMENT

you to work on different versions or features of your project stored in separate


branches.

MCQ ANSWERS:

https://docs.google.com/spreadsheets/d/1NoP_MI22fakGZAdJeGouBnyN4zg
DzEVQWaZ7ivlQLGc/edit?usp=sharing

Q1: What is GitHub primarily used for?


A) Web hosting

B) Version control

C) Database management

D) Email service

Answer: B

Q2: Which command is used to create a new Git repository?


A) git init

B) git create

C) git new

D) git start

Answer: A

Q3: What does the command 'git pull' do?


A) Creates a new branch

B) Fetches and merges changes from remote repository

C) Uploads local changes to remote repository

D) Deletes a branch
PLACEMENT

Answer: B

Q4: Which of the following is NOT a Git hosting service?


A) GitHub

B) GitLab

C) BitBucket

D) DockerHub

Answer: D

Q5: What is a 'fork' in GitHub?


A) A copy of someone else's repository in your GitHub account

B) A type of branch

C) A merge conflict

D) A deleted repository

Answer: A

Q6: What command is used to download a repository from GitHub to your local
machine?
A) git pull

B) git fetch

C) git clone

D) git download

Answer: C
PLACEMENT

Q7: What is a 'commit' in Git?


A) A saved snapshot of your changes

B) A branch

C) A merge conflict

D) A permission setting

Answer: A

Q8: Which command shows the status of files in your working directory?
A) git log

B) git status

C) git show

D) git view

Answer: B

Q9: What does 'git push' do?


A) Shows commit history

B) Creates a new branch

C) Uploads local commits to remote repository

D) Downloads remote changes

Answer: C
PLACEMENT

Q10: What is a 'pull request' in GitHub?


A) A request to pull changes from remote repository

B) A method to propose changes and request someone to review them

C) A way to delete a repository

D) A method to create a new branch

Answer: B

Q11: What does the command 'git branch' do?


A) Creates a new branch

B) Lists all branches

C) Deletes a branch

D) Merges branches

Answer: B

Q12: Which file is used to tell Git which files to ignore?


A) .gitconfig

B) .gitignore

C) .gittrack

D) .gitexclude

Answer: B

Q13: What is GitHub Actions primarily used for?


A) Hosting static websites

B) CI/CD and automation


PLACEMENT

C) Storage management

D) User authentication

Answer: B

Q14: What is the default branch name in Git?


A) master or main

B) default

C) primary

D) head

Answer: A

Q15: Which command is used to switch between branches?


A) git switch

B) git change

C) git checkout

D) git move

Answer: C

Q16: What is a 'merge conflict' in Git?


A) When two people edit the same file

B) When a file is too large to upload

C) When Git can't automatically merge changes

D) When a branch is deleted

Answer: C
PLACEMENT

Q17: Which command is used to merge branches?


A) git merge

B) git combine

C) git join

D) git connect

Answer: A

Q18: What is GitHub Pages used for?


A) Hosting static websites

B) Project management

C) Code review

D) User authentication

Answer: A

Q19: What is a GitHub gist?


A) A private repository

B) A simple way to share code snippets

C) A project management tool

D) A branch type

Answer: B
PLACEMENT

Q20: What is the purpose of GitHub Issues?


A) To track bugs and feature requests

B) To store large files

C) To host static websites

D) To manage billing

Answer: A

Q23: Question(CSS-Cascading Style Sheets)


A) Option A

B) Option B

C) Option C

D) Option 4

Answer: Correct Answer

Q24: Which CSS property controls the text size?


A) font-style

B) text-size

C) font-size

D) text-style

Answer: C

Q25: What does the z-index property do?


A) Controls the stacking order of elements

B) Changes text alignment


PLACEMENT

C) Adjusts spacing between elements

D) Defines a flex container

Answer: A

Q26: How do you make text bold in CSS?


A) font-style: bold;

B) text-weight: bold;

C) font-weight: bold;

D) bold: true;

Answer: C

Q27: Which CSS unit is relative to the root element's font size?
A) px

B) em

C) rem

D) %

Answer: C

Q28: Which pseudo-class targets the first child element?


A) :only-child

B) :first-of-type

C) :nth-child(1)

D) :first-child

Answer: D
PLACEMENT

Q29: Which property is used for making a flex container?


A) display: grid;

B) display: inline-block;

C) display: flex;

D) flex-container: true;

Answer: C

Q30: What is the default position of an element in CSS?


A) relative

B) absolute

C) fixed

D) static

Answer: D

Q31: How do you apply a background image in CSS?


A) image-background: url('image.jpg');

B) background-image: url('image.jpg');

C) background: image('image.jpg');

D) img: url('image.jpg');

Answer: B
PLACEMENT

Q32: Which CSS property is used to add space inside an element’s border?
A) margin

B) padding

C) spacing

D) border-spacing

Answer: B

Q33: What does opacity: 0; do to an element?


A) Makes it disappear but still take up space

B) Removes it from the DOM

C) Makes it fully visible

D) Changes its background color

Answer: A

Q34: Which media query breakpoint is typically used for mobile screens?
A) max-width: 768px

B) max-width: 1024px

C) min-width: 1200px

D) max-height: 500px

Answer: A

Q35: What is the purpose of the transition property?


A) Change the display type

B) Create animations between states


PLACEMENT

C) Modify z-index dynamically

D) Remove elements from a webpage

Answer: B

Q36: How do you apply styles only to print media?


A) @media screen

B) @media print

C) @print-style

D) print { … }

Answer: B

Q37: Which CSS property makes text wrap around a floated element?
A) float

B) wrap-text

C) text-overflow

D) clear

Answer: A

Q38: Which value of overflow property hides content outside the box?
A) visible

B) scroll

C) hidden

D) auto

Answer: C
PLACEMENT

Q40: JavaScript Multiple Choice Questions

Q42: Question(JS MCQ)


A) Option A

B) Option B

C) Option C

D) Option D

Answer: Correct Answer

Q43: Which of the following is a JavaScript data type?


A) String

B) Character

C) Float

D) Integer

Answer: A

Q44: How do you declare a variable in JavaScript?


A) let myVar = 5;

B) variable myVar = 5;

C) v myVar = 5;

D) declare myVar = 5;

Answer: A
PLACEMENT

Q45: Which method is used to add an element to an array in JavaScript?


A) push()

B) add()

C) insert()

D) append()

Answer: A

Q46: What is the output of typeof null?


A) object

C) undefined

D) number

Answer: A

Q47: Which keyword is used to define a constant variable in JavaScript?


A) var

B) const

C) let

D) static

Answer: B

Q48: How do you write a comment in JavaScript?


A) <!-- This is a comment -->
PLACEMENT

B) # This is a comment

C) // This is a comment

D) /* This is a comment */

Answer: C

Q49: Which function is used to convert a string to an integer?


A) parseFloat()

B) parseInt()

C) toInteger()

D) Number()

Answer: B

Q50: What will "5" + 3 evaluate to?


A) 8

B) 53

C) 5

D) Error

Answer: B

Q51: Which method is used to remove the last element from an array?
A) shift()

B) slice()

C) pop()

D) remove()
PLACEMENT

Answer: C

Q52: What does NaN represent in JavaScript?


A) Null value

B) Undefined value

C) Not a Number

D) Negative Number

Answer: C

Q53: Which object represents the browser window in JavaScript?


A) document

B) window

C) screen

D) navigator

Answer: B

Q54: What is the purpose of the addEventListener() method?


A) Remove an event

B) Create an event

C) Handle an event asynchronously

D) Attach an event handler

Answer: D
PLACEMENT

Q55: Which operator is used for strict equality comparison?


A) ==

B) ===

C) !=

D) !==

Answer: B

Q56: What is the scope of a let variable?


A) Global scope

B) Function scope

C) Block scope

D) Object scope

Answer: C

Q57: What is the result of Boolean("false")?


A) False

B) True

C) undefined

D) Error

Answer: B

Q58: Which loop is best suited when the number of iterations is known?
A) for loop

B) while loop
PLACEMENT

C) do-while loop

D) foreach loop

Answer: A

Q59: What is the purpose of the JSON.stringify() method?


A) Parse a JSON string

B) Convert an object to a JSON string

C) Validate a JSON string

D) Format a JSON string

Answer: B

Q60: Which method is used to delay execution in JavaScript?


A) setInterval()

B) setTimeout()

C) delay()

D) wait()

Answer: B

Q61: What does the isNaN() function do?


A) Checks if a value is null

B) Checks if a value is undefined

C) Checks if a value is a number

D) Checks if a value is NaN

Answer: D
PLACEMENT

Q62: Which object is used to manipulate dates in JavaScript?


A) Calendar

B) Date

C) Time

D) Day

Answer: B

Q63: What does the Promise object represent?


A) An immediate value

B) An asynchronous operation

C) A synchronous operation

D) An error handler

Answer: B

Q64: How can you prevent the default action of an event?


A) event.stop()

B) event.preventDefault()

C) event.stopPropagation()

D) event.cancel()

Answer: B
PLACEMENT

Q65: Which function is used to round a number down to the nearest integer?
A) Math.round()

B) Math.ceil()

C) Math.floor()

D) Math.trunc()

Answer: C

Q66: What does localStorage in JavaScript do?


A) Stores data temporarily

B) Stores data permanently

C) Stores data for the session

D) Stores data on the server

Answer: B

Q67: Which symbol is used to define an arrow function?


A) ->

B) =>

C) <-

D) =<

Answer: B

Q68: React Multiple Choice Questions


PLACEMENT

Q70: Question
A) Option A

B) Option B

C) Option C

D) Option D

Answer: Answer

Q71: What does JSX stand for?


A) JavaScript XML

B) Java Syntax Extension

C) Java XML

D) JavaScript Extension

Answer: JavaScript XML

Q72: What is the correct way to create a functional component in React?


A) function MyComponent() { return <h1>Hello</h1>; }

B) class MyComponent extends React.Component { render() { return <h1>Hello</h1>; } }

C) React.createComponent('MyComponent', function() { return <h1>Hello</h1>; })

D) None of the above

Answer: function MyComponent() { return <h1>Hello</h1>; }

Q73: What is the default behavior of useState() in React?


A) It creates a global state variable

B) It creates a component-scoped state variable


PLACEMENT

C) It modifies props

D) It stores values permanently

Answer: It creates a component-scoped state variable

Q74: What is the primary purpose of the useEffect hook?


A) To manage state updates

B) To handle side effects in function components

C) To create Redux stores

D) To manipulate the DOM directly

Answer: To handle side effects in function components

Q75: Which of the following React lifecycle methods runs only once after the
component is mounted?
A) componentWillUnmount

B) componentDidMount

C) componentDidUpdate

D) shouldComponentUpdate

Answer: componentDidMount

Q76: What is the correct way to update state based on the previous state in
React?
A) setCount(count + 1);

B) setCount(prevCount => prevCount + 1);

C) setState(count => count + 1);


PLACEMENT

D) count++

Answer: setCount(prevCount => prevCount + 1);

Q77: What problem does React’s Context API solve?


A) Avoiding deep prop drilling

B) Managing component lifecycle

C) Handling HTTP requests

D) Reducing bundle size

Answer: Avoiding deep prop drilling

Q78: What does useReducer hook help with?


A) Managing complex state logic

B) Creating components dynamically

C) Making API calls

D) Managing side effects

Answer: Managing complex state logic

Q79: What is the primary advantage of using Redux over React Context API?
A) Better performance for deeply nested states

B) No need for reducers

C) Requires fewer lines of code

D) Works only with class components

Answer: Better performance for deeply nested states


PLACEMENT

Q80: Which library is commonly used for routing in React?


A) react-navigation

B) react-router-dom

C) react-route

D) redux-router

Answer: react-router-dom

Q81: What is React.memo used for?


A) Memoizing API calls

B) Preventing unnecessary re-renders

C) Handling memory leaks

D) Storing state in local storage

Answer: Preventing unnecessary re-renders

Q82: What is a Higher-Order Component (HOC) in React?


A) A function that returns a new component with additional functionality

B) A component that is always at the top of the component tree

C) A React class component with advanced features

D) A built-in component for routing

Answer: A function that returns a new component with additional functionality


PLACEMENT

Q83: What does Code Splitting in React help with?


A) Making the app faster by loading components only when needed

B) Reducing the number of JavaScript files

C) Storing data in local storage

D) Preventing rendering errors

Answer: Making the app faster by loading components only when needed

Q84: What does the lazy() function in React do?


A) Creates lazy-loaded components

B) Delays state updates

C) Disables re-rendering

D) Suspends component mounting

Answer: Creates lazy-loaded components

Q85: What is the main benefit of Server-Side Rendering (SSR) in React?


A) Faster initial page loads and better SEO

B) Smaller JavaScript bundle sizes

C) Completely removes the need for a frontend framework

D) Allows running React without a server

Answer: Faster initial page loads and better SEO

Q86: Node & Express


PLACEMENT

Q87: Question
A) A

B) B

C) C

D) D

Answer: Correct Answer

Q88: What is Node.js?


A) A. A JavaScript framework

B) B. A runtime environment

C) C. A database

D) D. A frontend library

Answer: B

Q89: Which module is used for creating a web server in Node.js?


A) A. fs

B) B. http

C) C. url

D) D. path

Answer: B

Q90: What is Express.js?


A) A. A database

B) B. A backend framework
PLACEMENT

C) C. A frontend library

D) D. A CSS framework

Answer: B

Q91: Which method is used to handle GET requests in Express?


A) A. app.post()

B) B. app.get()

C) C. app.put()

D) D. app.delete()

Answer: B

Q92: Which command is used to install Express.js?


A) A. npm install express

B) B. npm add express

C) C. node install express

D) D. install express

Answer: A

Q93: Which middleware is used for parsing JSON in Express?


A) A. body-parser

B) B. json-parser

C) C. url-parser

D) D. xml-parser

Answer: A
PLACEMENT

Q94: What does ‘npm’ stand for?


A) A. Node Package Manager

B) B. Network Programming Module

C) C. Node Programming Module

D) D. New Programming Model

Answer: A

Q95: Which template engine is commonly used with Express?


A) A. EJS

B) B. Pug

C) C. Handlebars

D) D. All of the above

Answer: D

Q96: What is the default scope of Node.js modules?


A) A. Global

B) B. Local

C) C. Public

D) D. Private

Answer: B
PLACEMENT

Q97: Which module is used for handling file operations in Node.js?


A) A. fs

B) B. path

C) C. http

D) D. url

Answer: A

Q98: Which method is used to send a response in Express?


A) A. res.send()

B) B. res.write()

C) C. res.data()

D) D. res.return()

Answer: A

Q99: Which HTTP method is used to update a resource?


A) A. GET

B) B. POST

C) C. PUT

D) D. DELETE

Answer: C

Q100: Which function is used to include modules in Node.js?


A) A. include()

B) B. import()
PLACEMENT

C) C. require()

D) D. fetch()

Answer: C

Q101: What is the default port of an Express application?


A) A. 3000

B) B. 8080

C) C. 5000

D) D. 80

Answer: A

Q102: Which object in Express holds request-related data?


A) A. res

B) B. req

C) C. app

D) D. server

Answer: B

Q103: Which status code represents 'Not Found'?


A) A. 200

B) B. 302

C) C. 404

D) D. 500

Answer: C
PLACEMENT

Q104: What does 'req.params' return?


A) A. Query parameters

B) B. URL parameters

C) C. JSON body data

D) D. Headers

Answer: B

Q105: Which of the following is an asynchronous method in Node.js?


A) A. readFileSync()

B) B. readFile()

C) C. writeFileSync()

D) D. existsSync()

Answer: B

Q106: Which of the following is NOT a core module in Node.js?


A) A. fs

B) B. path

C) C. express

D) D. url

Answer: C
PLACEMENT

Q107: Which middleware is used to serve static files in Express?


A) A. express.static()

B) B. express.json()

C) C. express.urlencoded()

D) D. express.router()

Answer: A

Q108: Which function is used to listen for incoming connections in Express?


A) A. app.connect()

B) B. app.listen()

C) C. app.run()

D) D. app.serve()

Answer: B

Q109: What does 'process.env' store?


A) A. Configuration files

B) B. Environment variables

C) C. Session data

D) D. User authentication data

Answer: B

Q110: What is used to handle routing in Express?


A) A. app.route()

B) B. express.Router()
PLACEMENT

C) C. app.router()

D) D. express.routing()

Answer: B

Q111: Which module helps in handling file paths in Node.js?


A) A. url

B) B. fs

C) C. path

D) D. http

Answer: C

Q112: What is the purpose of ‘next()’ in Express middleware?


A) A. To terminate the server

B) B. To pass control to the next middleware

C) C. To send a response

D) D. To log requests

Answer: B

Q113: Which statement is true about Express?


A) A. It is a framework for frontend development

B) B. It simplifies Node.js API development

C) C. It replaces Node.js

D) D. It is used for databases

Answer: B
PLACEMENT

Q114: How can you handle errors in Express?


A) A. Using try-catch

B) B. Using error-handling middleware

C) C. Using res.sendError()

D) D. Both A and B

Answer: D

Q115: Which method is used for redirecting in Express?


A) A. res.redirect()

B) B. res.forward()

C) C. res.sendRedirect()

D) D. res.route()

Answer: A

Q116: Which of the following is used to parse URL-encoded data in Express?


A) A. express.urlencoded()

B) B. express.json()

C) C. bodyParser.text()

D) D. url.parser()

Answer: A
PLACEMENT

Q117: Which Node.js module is used for cryptographic operations?


A) A. crypto

B) B. fs

C) C. security

D) D. bcrypt

Answer: A

Q118: Which of the following is NOT an HTTP method?


A) A. GET

B) B. PUSH

C) C. POST

D) D. DELETE

Answer: B

Q119: Which of these is an advantage of using Node.js?


A) A. Single-threaded model

B) B. Blocking I/O operations

C) C. Slow execution speed

D) D. Poor scalability

Answer: A

Q120: What does ‘app.use()’ do in Express?


A) A. Registers middleware

B) B. Starts the server


PLACEMENT

C) C. Routes requests

D) D. Closes connections

Answer: A

Q121: Which tool is used to restart a Node.js server automatically?


A) A. npm restart

B) B. pm2

C) C. forever

D) D. Both B and C

Answer: D

Q123: HTML

Q124: Question(HTML basics)


A) Option A

B) Option B

C) Option C

D) Option D

Answer: Answer

Q125: What does HTML stand for?


A) Hyper Text Markup Language

B) Hyperlinks and Text Markup Language


PLACEMENT

C) Home Tool Markup Language

D) Hyper Transfer Markup Language

Answer: A

Q126: Which tag is used to create a hyperlink in HTML?


A) <a>

B) <link>

C) <href>

D) <hlink>

Answer: A

Q127: What is the purpose of the <head> tag in HTML?


A) Contains metadata

B) Defines styles

C) Creates a navigation bar

D) Defines content structure

Answer: A

Q128: Which HTML tag is used to display the largest heading?


A) <h6>

B) <h1>

C) <title>

D) <p>

Answer: B
PLACEMENT

Q129: Which attribute is used to specify an image source in HTML?


A) src

B) alt

C) href

D) link

Answer: A

Q130: What does the <br> tag do in HTML?


A) Creates a horizontal line

B) Adds a space between words

C) Starts a new paragraph

D) Ends the document

Answer: A

Q131: Which HTML element is used for inserting a line break?


A) <break>

B) <lb>

C) <nl>

D) <newline>

Answer: B
PLACEMENT

Q132: Which tag is used to create an ordered list in HTML?


A) <ul>

B) <ol>

C) <dl>

D) <li>

Answer: B

Q133: What is the default alignment of text in an HTML paragraph?


A) Left

B) Center

C) Justify

D) Right

Answer: B

Q134: Which HTML attribute is used to define inline styles?


A) class

B) id

C) style

D) css

Answer: C

Q135: Which HTML tag is used to define a table row?


A) <td>

B) <tr>
PLACEMENT

C) <table>

D) <th>

Answer: B

Q136: How can you create a checkbox in HTML?


A) <input type='checkbox'>

B) <checkbox>

C) <tickbox>

D) <check>

Answer: A

Q137: Which HTML tag is used to embed a video in a webpage?


A) <media>

B) <video>

C) <embed>

D) <source>

Answer: B

Q138: Which HTML tag is used to create a drop-down list?


A) <list>

B) <option>

C) <dropdown>

D) <select>

Answer: D
PLACEMENT

Q139: What is the purpose of the <meta> tag in HTML?


A) Defines page structure

B) SEO optimization

C) Data storage

D) Scripting support

Answer: B

Q140: Which doctype declaration is correct for HTML5?


A) <!DOCTYPE html>

B) <html5>

C) <!DOCTYPE>

D) <html>

Answer: A

Q141: Which HTML tag is used to define a footer for a document?


A) <bottom>

B) <footer>

C) <end>

D) <bottom>

Answer: B
PLACEMENT

Q142: Which HTML tag is used to create a division or section in a webpage?


A) <section>

B) <div>

C) <span>

D) <article>

Answer: B

Q143: Which input type is used for entering an email address?


A) text

B) email

C) url

D) number

Answer: B

Q144: Which HTML tag is used to create a form?


A) <input>

B) <form>

C) <button>

D) <textarea>

Answer: B

Q148: MongoDB MCQ


PLACEMENT

Q150: Question
A) Option A

B) Option B

C) Option C

D) Option D

Answer: Answer

Q151: Which of the following is a NoSQL database?


A) MySQL

B) MongoDB

C) PostgreSQL

D) Oracle

Answer: B

Q152: Which data format does MongoDB use to store documents?


A) XML

B) CSV

C) JSON-like BSON

D) YAML

Answer: C

Q153: What is the default port for MongoDB?


A) 3306

B) 5432
PLACEMENT

C) 27017

D) 8080

Answer: C

Q154: Which command is used to check the status of a MongoDB database?


A) db.status()

B) db.info()

C) db.stats()

D) db.currentStatus()

Answer: C

Q155: Which MongoDB shell command lists all databases?


A) show databases

B) list databases

C) db.show()

D) db.list()

Answer: A

Q156: Which of the following is a primary key in MongoDB by default?


A) _id

B) primaryKey

C) mongo_key

D) doc_id

Answer: A
PLACEMENT

Q157: What is the purpose of the find() method in MongoDB?


A) Insert a document

B) Delete a document

C) Retrieve documents

D) Update a document

Answer: C

Q158: Which MongoDB operator is used for pattern matching?


A) $in

B) $regex

C) $like

D) $match

Answer: B

Q159: Which of the following is not a valid MongoDB data type?


A) String

B) Integer

C) Boolean

D) Character

Answer: D
PLACEMENT

Q160: Which method is used to insert a single document in MongoDB?


A) db.collection.add()

B) db.collection.insertOne()

C) db.collection.put()

D) db.collection.store()

Answer: B

Q161: Which command is used to remove a document in MongoDB?


A) db.collection.deleteOne()

B) db.collection.drop()

C) db.collection.removeOne()

D) db.collection.erase()

Answer: A

Q162: What does the upsert option do in an update query?


A) Only updates existing documents

B) Only inserts new documents

C) Updates if exists inserts otherwise

D) Deletes if not found

Answer: C

Q163: Which MongoDB aggregation stage is used for grouping data?


A) $match

B) $project
PLACEMENT

C) $group

D) $limit

Answer: C

Q164: Which indexing type is default in MongoDB?


A) Single-field index

B) Multi-field index

C) Compound index

D) Text index

Answer: A

Q165: What is the primary function of MongoDB's sharding?


A) Encrypt data

B) Distribute data across multiple servers

C) Backup data

D) Optimize queries

Answer: B

Q166: What does the capped collection feature in MongoDB do?


A) Automatically deletes old documents

B) Prevents insertion of duplicate documents

C) Automatically indexes all fields

D) Disables updates

Answer: A
PLACEMENT

Q167: Which storage engine is default in MongoDB 4.0 and later?


A) InnoDB

B) RocksDB

C) WiredTiger

D) MyISAM

Answer: C

Q168: What is a replica set in MongoDB?


A) A set of databases

B) A backup system

C) A group of databases working together for redundancy

D) A query optimization technique

Answer: C

Q169: Which command is used to create an index in MongoDB?


A) db.collection.createIndex()

B) db.collection.addIndex()

C) db.collection.newIndex()

D) db.collection.ensureIndex()

Answer: A
PLACEMENT

Q170: Which command is used to drop a collection in MongoDB?


A) db.collection.delete()

B) db.collection.drop()

C) db.collection.remove()

D) db.collection.clear()

Answer: B

Q172: MYSQL MCQs

Q173: Question
A) Option A

B) Option B

C) Option C

D) Option D

Answer: Answer

Q174: What command is used to retrieve data from a database?


A) INSERT

B) DELETE

C) SELECT

D) UPDATE

Answer: C
PLACEMENT

Q175: Which statement is true about a Primary Key?


A) It allows duplicate values.

B) It can be NULL.

C) It uniquely identifies each record.

D) It cannot be indexed.

Answer: C

Q176: Which data type is best for storing large text in MySQL?
A) VARCHAR

B) TEXT

C) CHAR

D) BLOB

Answer: B

Q177: Which clause is used to filter records in a SELECT statement?


A) ORDER BY

B) WHERE

C) HAVING

D) GROUP BY

Answer: B

Q178: Which SQL clause is used to sort query results?


A) GROUP BY

B) SORT
PLACEMENT

C) ORDER BY

D) FILTER

Answer: C

Q179: Which type of join returns only matching records between two tables?
A) INNER JOIN

B) LEFT JOIN

C) RIGHT JOIN

D) FULL JOIN

Answer: A

Q180: What constraint ensures all values in a column are unique?


A) PRIMARY KEY

B) FOREIGN KEY

C) CHECK

D) UNIQUE

Answer: D

Q181: Which of the following is an aggregate function?


A) COUNT()

B) AVG()

C) SUM()

D) All of the above

Answer: D
PLACEMENT

Q182: What does a foreign key do?


A) Uniquely identifies each record

B) Enforces a relationship between tables

C) Automatically increments a value

D) Sorts query results

Answer: B

Q183: Why are indexes used in MySQL?


A) To speed up queries

B) To enforce security

C) To delete duplicate records

D) To create backups

Answer: A

Q184: Which clause is used to group records?


A) ORDER BY

B) GROUP BY

C) HAVING

D) FILTER

Answer: B
PLACEMENT

Q185: How do you limit the number of rows returned in MySQL?


A) TOP

B) LIMIT

C) ROWCOUNT

D) RESTRICT

Answer: B

Q186: A subquery is:


A) A query inside another query

B) A special type of index

C) A stored procedure

D) A type of join

Answer: A

Q187: Which statement is used to roll back a transaction?


A) SAVEPOINT

B) ROLLBACK

C) COMMIT

D) UNDO

Answer: B

Q188: Which keyword is used to automatically generate a unique ID for new


records?
A) PRIMARY KEY
PLACEMENT

B) AUTO_INCREMENT

C) UNIQUE

D) IDENTITY

Answer: B

You might also like