FULL STACK Ans Key
FULL STACK Ans Key
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.
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.
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.
The <!DOCTYPE> declaration specifies the HTML version used in the document. It
ensures proper rendering by browsers and helps maintain compatibility with web
standards.
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.
<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.
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.
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.
The 'alt' attribute provides alternative text for an image, improving accessibility and
displaying text when the image fails to load.
PLACEMENT
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.
The <iframe> tag embeds another webpage within the current page, useful for
including maps, videos, or external content.
<strong> indicates strong importance and affects screen readers, while <b> only
applies bold styling without semantic meaning.
<em> gives emphasis with semantic meaning, affecting screen readers, while <i>
only applies italic styling without conveying importance.
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.
Answer:
Answer: The z-index property controls the stack order of overlapping elements.
Higher values bring elements to the front. Example:
Answer: The @media rule applies styles based on screen size or device type.
Example:
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>)
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.
Answer:
Answer:
display: grid;
"sidebar content";
Answer:
Here are 5 more two-mark CSS questions with answers in the same structured
format:
Answer:
div {
min-width: 200px;
max-width: 600px;
width: 50%;
Answer:
Answer:
.modal {
backdrop-filter: blur(10px);
}
PLACEMENT
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:
Answer:
.container {
scroll-snap-type: y mandatory;
.item {
scroll-snap-align: start;
JAVA SCRIPT
PLACEMENT
operation. They have three states: pending, resolved (fulfilled), and rejected,
allowing better handling of asynchronous tasks.
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.
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.
REACT JS
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(() => {
}, []);
Uncontrolled Example:
const inputRef = useRef();
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.
process.nextTick() executes the callback before the next event loop cycle, while
setImmediate() executes it after the current I/O phase.
6.What is Express.js?
Use res.json():
Use req.query:
Use req.params:
Use jsonwebtoken:
Use jwt.verify():
Use bcrypt:
PLACEMENT
Use Mongoose:
MONGODB:
1. How does MongoDB ensure high availability?
sh.enableSharding("myDatabase")
Both operators add elements to an array field, but they work differently:
db.sales.aggregate([
])
session.startTransaction();
try {
session.getDatabase("testDB").collection("accounts").updateOne(
);
session.getDatabase("testDB").collection("accounts").updateOne(
);
session.commitTransaction();
} catch (e) {
session.abortTransaction();
session.endSession();
db.orders.find({status: "shipped"}).explain("executionStats")
It provides details about index usage, execution time, and query plan.
])
db.orders.aggregate([
{
PLACEMENT
$lookup: {
from: "customers",
localField: "customerId",
foreignField: "_id",
as: "customerDetails"
])
Example of $unwind:
db.users.aggregate([
{ $unwind: "$hobbies" }
])
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?
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.
SQL MySQL
SQL MySQL
SQL supports XML and user defined It doesn’t support XML and any user
functions. defined functions
mysql <batch-file>;
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.
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:
Syntax of LENGTH:
‘_’ corresponds to only one character but ‘%’ corresponds to zero or more
characters in the LIKE statement.
PLACEMENT
Storage engines are also called table types. Data is stored in a file using multiple
techniques.
Locking Level
Indexing
Storage mechanism
Capabilities and functions
SET
BLOB
TEXT
ENUM
CHAR
VARCHAR
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.
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.
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.
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.
REGEXP is a pattern match where the pattern is matched anywhere in the search
value.
PLACEMENT
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.
Syntax:
We can delete a table by using DROP TABLE statement. This statement deletes
complete data of table.
GIT HUB:
1. What is Git?
Git is a distributed version control system (DVCS) that is used to track changes in
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.
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.
MCQ ANSWERS:
https://docs.google.com/spreadsheets/d/1NoP_MI22fakGZAdJeGouBnyN4zg
DzEVQWaZ7ivlQLGc/edit?usp=sharing
B) Version control
C) Database management
D) Email service
Answer: B
B) git create
C) git new
D) git start
Answer: A
D) Deletes a branch
PLACEMENT
Answer: B
B) GitLab
C) BitBucket
D) DockerHub
Answer: D
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
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
Answer: C
PLACEMENT
Answer: B
C) Deletes a branch
D) Merges branches
Answer: B
B) .gitignore
C) .gittrack
D) .gitexclude
Answer: B
C) Storage management
D) User authentication
Answer: B
B) default
C) primary
D) head
Answer: A
B) git change
C) git checkout
D) git move
Answer: C
Answer: C
PLACEMENT
B) git combine
C) git join
D) git connect
Answer: A
B) Project management
C) Code review
D) User authentication
Answer: A
D) A branch type
Answer: B
PLACEMENT
D) To manage billing
Answer: A
B) Option B
C) Option C
D) Option 4
B) text-size
C) font-size
D) text-style
Answer: C
Answer: A
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
B) :first-of-type
C) :nth-child(1)
D) :first-child
Answer: D
PLACEMENT
B) display: inline-block;
C) display: flex;
D) flex-container: true;
Answer: C
B) absolute
C) fixed
D) static
Answer: D
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
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
Answer: B
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
B) Option B
C) Option C
D) Option D
B) Character
C) Float
D) Integer
Answer: A
B) variable myVar = 5;
C) v myVar = 5;
D) declare myVar = 5;
Answer: A
PLACEMENT
B) add()
C) insert()
D) append()
Answer: A
C) undefined
D) number
Answer: A
B) const
C) let
D) static
Answer: B
B) # This is a comment
C) // This is a comment
D) /* This is a comment */
Answer: C
B) parseInt()
C) toInteger()
D) Number()
Answer: B
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
B) Undefined value
C) Not a Number
D) Negative Number
Answer: C
B) window
C) screen
D) navigator
Answer: B
B) Create an event
Answer: D
PLACEMENT
B) ===
C) !=
D) !==
Answer: B
B) Function scope
C) Block scope
D) Object scope
Answer: C
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
Answer: B
B) setTimeout()
C) delay()
D) wait()
Answer: B
Answer: D
PLACEMENT
B) Date
C) Time
D) Day
Answer: B
B) An asynchronous operation
C) A synchronous operation
D) An error handler
Answer: B
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
Answer: B
B) =>
C) <-
D) =<
Answer: B
Q70: Question
A) Option A
B) Option B
C) Option C
D) Option D
Answer: Answer
C) Java XML
D) JavaScript Extension
C) It modifies props
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);
D) count++
Q79: What is the primary advantage of using Redux over React Context API?
A) Better performance for deeply nested states
B) react-router-dom
C) react-route
D) redux-router
Answer: react-router-dom
Answer: Making the app faster by loading components only when needed
C) Disables re-rendering
Q87: Question
A) A
B) B
C) C
D) D
B) B. A runtime environment
C) C. A database
D) D. A frontend library
Answer: B
B) B. http
C) C. url
D) D. path
Answer: B
B) B. A backend framework
PLACEMENT
C) C. A frontend library
D) D. A CSS framework
Answer: B
B) B. app.get()
C) C. app.put()
D) D. app.delete()
Answer: B
D) D. install express
Answer: A
B) B. json-parser
C) C. url-parser
D) D. xml-parser
Answer: A
PLACEMENT
Answer: A
B) B. Pug
C) C. Handlebars
Answer: D
B) B. Local
C) C. Public
D) D. Private
Answer: B
PLACEMENT
B) B. path
C) C. http
D) D. url
Answer: A
B) B. res.write()
C) C. res.data()
D) D. res.return()
Answer: A
B) B. POST
C) C. PUT
D) D. DELETE
Answer: C
B) B. import()
PLACEMENT
C) C. require()
D) D. fetch()
Answer: C
B) B. 8080
C) C. 5000
D) D. 80
Answer: A
B) B. req
C) C. app
D) D. server
Answer: B
B) B. 302
C) C. 404
D) D. 500
Answer: C
PLACEMENT
B) B. URL parameters
D) D. Headers
Answer: B
B) B. readFile()
C) C. writeFileSync()
D) D. existsSync()
Answer: B
B) B. path
C) C. express
D) D. url
Answer: C
PLACEMENT
B) B. express.json()
C) C. express.urlencoded()
D) D. express.router()
Answer: A
B) B. app.listen()
C) C. app.run()
D) D. app.serve()
Answer: B
B) B. Environment variables
C) C. Session data
Answer: B
B) B. express.Router()
PLACEMENT
C) C. app.router()
D) D. express.routing()
Answer: B
B) B. fs
C) C. path
D) D. http
Answer: C
C) C. To send a response
D) D. To log requests
Answer: B
C) C. It replaces Node.js
Answer: B
PLACEMENT
C) C. Using res.sendError()
D) D. Both A and B
Answer: D
B) B. res.forward()
C) C. res.sendRedirect()
D) D. res.route()
Answer: A
B) B. express.json()
C) C. bodyParser.text()
D) D. url.parser()
Answer: A
PLACEMENT
B) B. fs
C) C. security
D) D. bcrypt
Answer: A
B) B. PUSH
C) C. POST
D) D. DELETE
Answer: B
D) D. Poor scalability
Answer: A
C) C. Routes requests
D) D. Closes connections
Answer: A
B) B. pm2
C) C. forever
D) D. Both B and C
Answer: D
Q123: HTML
B) Option B
C) Option C
D) Option D
Answer: Answer
Answer: A
B) <link>
C) <href>
D) <hlink>
Answer: A
B) Defines styles
Answer: A
B) <h1>
C) <title>
D) <p>
Answer: B
PLACEMENT
B) alt
C) href
D) link
Answer: A
Answer: A
B) <lb>
C) <nl>
D) <newline>
Answer: B
PLACEMENT
B) <ol>
C) <dl>
D) <li>
Answer: B
B) Center
C) Justify
D) Right
Answer: B
B) id
C) style
D) css
Answer: C
B) <tr>
PLACEMENT
C) <table>
D) <th>
Answer: B
B) <checkbox>
C) <tickbox>
D) <check>
Answer: A
B) <video>
C) <embed>
D) <source>
Answer: B
B) <option>
C) <dropdown>
D) <select>
Answer: D
PLACEMENT
B) SEO optimization
C) Data storage
D) Scripting support
Answer: B
B) <html5>
C) <!DOCTYPE>
D) <html>
Answer: A
B) <footer>
C) <end>
D) <bottom>
Answer: B
PLACEMENT
B) <div>
C) <span>
D) <article>
Answer: B
B) email
C) url
D) number
Answer: B
B) <form>
C) <button>
D) <textarea>
Answer: B
Q150: Question
A) Option A
B) Option B
C) Option C
D) Option D
Answer: Answer
B) MongoDB
C) PostgreSQL
D) Oracle
Answer: B
B) CSV
C) JSON-like BSON
D) YAML
Answer: C
B) 5432
PLACEMENT
C) 27017
D) 8080
Answer: C
B) db.info()
C) db.stats()
D) db.currentStatus()
Answer: C
B) list databases
C) db.show()
D) db.list()
Answer: A
B) primaryKey
C) mongo_key
D) doc_id
Answer: A
PLACEMENT
B) Delete a document
C) Retrieve documents
D) Update a document
Answer: C
B) $regex
C) $like
D) $match
Answer: B
B) Integer
C) Boolean
D) Character
Answer: D
PLACEMENT
B) db.collection.insertOne()
C) db.collection.put()
D) db.collection.store()
Answer: B
B) db.collection.drop()
C) db.collection.removeOne()
D) db.collection.erase()
Answer: A
Answer: C
B) $project
PLACEMENT
C) $group
D) $limit
Answer: C
B) Multi-field index
C) Compound index
D) Text index
Answer: A
C) Backup data
D) Optimize queries
Answer: B
D) Disables updates
Answer: A
PLACEMENT
B) RocksDB
C) WiredTiger
D) MyISAM
Answer: C
B) A backup system
Answer: C
B) db.collection.addIndex()
C) db.collection.newIndex()
D) db.collection.ensureIndex()
Answer: A
PLACEMENT
B) db.collection.drop()
C) db.collection.remove()
D) db.collection.clear()
Answer: B
Q173: Question
A) Option A
B) Option B
C) Option C
D) Option D
Answer: Answer
B) DELETE
C) SELECT
D) UPDATE
Answer: C
PLACEMENT
B) It can be NULL.
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
B) WHERE
C) HAVING
D) GROUP BY
Answer: B
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
B) FOREIGN KEY
C) CHECK
D) UNIQUE
Answer: D
B) AVG()
C) SUM()
Answer: D
PLACEMENT
Answer: B
B) To enforce security
D) To create backups
Answer: A
B) GROUP BY
C) HAVING
D) FILTER
Answer: B
PLACEMENT
B) LIMIT
C) ROWCOUNT
D) RESTRICT
Answer: B
C) A stored procedure
D) A type of join
Answer: A
B) ROLLBACK
C) COMMIT
D) UNDO
Answer: B
B) AUTO_INCREMENT
C) UNIQUE
D) IDENTITY
Answer: B