Full Stack Development — Complete Study Guide
Unit-1 (complete) + Unit-2 (complete): Responsive Design, Media Queries, HTML5, Bootstrap, Tailwind CSS, Vue.js Directives, and React JS. Every topic explained in depth with diagrams, followed by a full question bank with model answers and comparison-style questions at the end.
Full Stack Development Basics
1. What is Full Stack Development?
Full stack development is the process of designing, creating, testing, and deploying a complete web application from start to finish. It involves working with multiple layers and technologies: front-end web development (what the user sees and interacts with), back-end web development (the logic running on the server), and database development (where data is stored and retrieved).
The term describes a software engineer or developer who is comfortable working with both the front end and back end of a website or application — someone who understands, end-to-end, how every part of the system works together, not just their own slice of it.
HTML · CSS · JavaScript
Django · Java · Python · Node.js · PHP
MySQL · MongoDB · Oracle
(Front End / UI)
(Business Logic)
A retail website is a good running example: users can browse or purchase items, add/delete items from a cart, or change their profile. Every one of these actions needs a front-end UI plus business logic written in the back end — this is exactly what a full-stack developer is trained to build, end-to-end.
Key points to remember
- Full stack = front-end + back-end + database, glued together as one working system.
- Full-stack developers must "deeply understand how the various parts of a website or application work together" — not just write isolated code.
- They also need to collaborate effectively on a team, since web development is usually a collaborative process.
2. What is a Full-Stack Developer, and What Do They Do?
A full-stack developer has knowledge of an entire technology stack — the complete set of technologies needed to build an end-to-end application quickly and efficiently. For example, to build an app using the MEAN stack, they must know how to work with:
M — MongoDB
A NoSQL database.E — Express.js
A web application framework for Node.js.A — Angular
A front-end framework by Google.N — Node.js: server-side JavaScript runtime
Responsibilities of a full-stack developer
- Help choose the right technologies for both front-end and back-end development/testing.
- Write clean code across the entire stack, following best practices of each tool used.
- Stay up to date with the latest technologies to make the best technology-usage decisions.
- Judge, in the early phases of a project, whether the chosen technologies are the right fit.
Languages full-stack developers use
They're free to use any set of compatible languages. JavaScript is especially popular because it's one of the few languages usable on both front end and back end.
| Layer | Common Languages |
|---|---|
| Front end | HTML, CSS, JavaScript |
| Back end | Python, Java, R, Ruby, Node.js, PHP |
It's also common to use complete technology stacks like MEAN, MERN, Ruby on Rails, LAMP for faster, more efficient development with an easier learning curve.
3. Front-end vs Back-end vs Full-stack Developers Comparison
Applications needing higher scalability and more complex workflows require broader skill sets and team collaboration — front end may be handled by a UI team, back end by another. Full-stack developers step in where an individual is required to handle both sides of a feature.
| Aspect | Front-end Developer | Back-end Developer | Full-stack Developer |
|---|---|---|---|
| Primary focus | UI of the app — visual effects, frames, navigation, forms | Business logic, security, performance, scalability, request/response handling | Both — codes end-to-end workflows |
| Main concern | User experience (UX) | Core application workflows / server logic | Complete system, front + back |
| Typical tech | HTML, CSS, JavaScript | JavaScript, Python, Java, .NET | MEAN, MERN (JS-based full stacks) |
| Example task | Build the "add to cart" button and cart page layout | Write the logic that updates the cart in the database | Builds both the button and the logic behind it |
4. Is a Software Engineer the Same as a Full-Stack Developer? Comparison
| Software Engineer | Full-Stack Developer | |
|---|---|---|
| Scope | General term — engineering discipline covering all kinds of software | A specific part of software engineering, focused on web apps |
| Knowledge required | May specialize in one module/technology | Needs front-end and back-end knowledge to build end-to-end web apps |
| Working style | Often an individual contributor on a specific module at a time | Works across the complete technology stack (front end + back end) |
5. Advantages and Disadvantages of Full Stack Development
Advantages
- Complete ownership and understanding of the project
- Saves project time and cost; enhances productivity
- Faster bug fixing (knowledge of the complete system)
- Easy knowledge transfer to other team members
- Better division of work among team members
- Can build a professional website from scratch for an employer
- Competent member of cross-functional Agile teams (both front + back end)
- Can start own web design/development business
- Can build and monetize own websites (AdSense, affiliate marketing, products)
Disadvantages
- The chosen technology solution can be wrong for the project
- Outcome is heavily dependent on developer skill
- Creates key-person risk (over-reliance on one person)
- Being a full-stack developer is increasingly complex as tech grows
6. 3-Tier Architecture ⭐
In a 3-tier application, code for each area of responsibility is cleanly split into three separate layers/tiers.
(HTML)
(DML)
Layer
Layer
Layer
Important note: the presentation layer has no direct communication with the data access layer — it can only talk to the business layer. Also, you should not assume the whole app is built from just one component per layer:
- A separate component should exist in the Presentation layer for each user transaction.
- A separate component should exist in the Business layer for each business entity (database table).
- A separate component should exist in the Data Access layer for each supported DBMS.
Because of this structure, you can swap one layer's component without touching the others: change the UI to output HTML, PDF, or CSV; change the data access component to switch between MySQL, Oracle, or SQL Server; or update business rules — all independently. This also gives reusability: one Business-layer component can be shared by several Presentation-layer components.
The Rules of 3-Tier Architecture ⭐ (frequently asked)
- Code for each layer must be in separate files, maintainable separately (possibly by separate teams).
- Each layer may contain only the logic that belongs to it — business logic only in Business layer, presentation logic only in Presentation layer, data access logic only in Data Access layer.
- Presentation layer can only receive requests from / return responses to an outside agent (usually a person, sometimes another piece of software).
- Presentation layer can only send requests to / receive responses from the Business layer — it cannot directly access the database or Data Access layer.
- Business layer can only receive requests from / return responses to the Presentation layer.
- Business layer can only send requests to / receive responses from the Data Access layer — it cannot access the database directly.
- Data Access layer can only receive requests from / return responses to the Business layer — it cannot issue requests to anything except the DBMS it supports.
- Each layer must be totally unaware of the inner workings of the other layers (database-agnostic, presentation-agnostic).
Skills required per layer
| Layer | Skills Needed |
|---|---|
| Presentation layer | HTML, CSS, possibly JavaScript, plus UI design |
| Business layer | A programming language, so business rules can be processed by a computer |
| Data Access layer | SQL — Data Definition Language (DDL) and Data Manipulation Language (DML), plus database design |
7. Popular Web Development Stacks
Different stacks exist to handle different tasks in web app development and operations.
1. LAMP Stack
Linux (OS) + Apache (Web Server) + MySQL (Database) + PHP (Language). One of the first open-source stacks; efficiently handles dynamic pages. Components are swappable (Windows→WAMP, macOS→MAMP; PHP can be swapped for Perl/Python). Used by: Wikipedia, Yahoo, Etsy, Shopify, WordPress, Magento.
2. MEAN Stack
MongoDB + Express.js + Angular + Node.js. An end-to-end JavaScript stack — a single language across the whole stack, enabling code reuse. All components are free/open-source, ideal for cloud hosting (flexible, scalable, extensible), and the database scales on demand. Used by: Google, Microsoft, IBM, Amazon, Uber, PayPal, LinkedIn.
3. MERN Stack
Same as MEAN but Angular → React. React is popular for building high-end, single-page apps with interactive UI, uses JSX and a Virtual DOM. React is a library, not a framework, so developers may need third-party services for extra functionality. Used by: Meta, Tesla, GoDaddy, Walmart, Shutterfly, Under Armour, Accenture, Philips, Airbnb, Netflix, Mozilla.
4. Ruby on Rails (RoR)
Server-side web framework written in Ruby, MIT-licensed. Follows the MVC (model-view-controller) pattern, offers seamless DB table creation, migrations, scaffolding of views for rapid development. Encourages JSON/XML for data transfer, HTML/CSS/JS for UI. Used by: SlideShare, Airbnb, CrunchBase, Bloomberg, Dribble, Shopify, GitHub.
5. .NET Stack
Open-source developer platform (tools, languages, libraries) for scalable, high-performing desktop/web/mobile apps that run natively across OSes (Linux, macOS, Windows, iOS, Android). Supported languages: C#, F#, Visual Basic. Known for ease of development, code reusability, strong built-in security.
6. Python-Django Stack
Django is a high-level Python web framework encouraging rapid development with a clean, pragmatic design. Often combined with Apache + MySQL for server-side dev. Supports low-code development and can handle rising traffic/API load.
7. Flutter Stack (mobile)
Open-source Google framework for building multi-platform apps from a single codebase, powered by the Dart language. Can pair with Firebase on the back end for scalability.
8. React Native Stack
JavaScript framework (based on React) for building native iOS and Android apps, written with a mix of JS and XML markup. Renders using real mobile UI components (so apps look truly native) and allows up to 100% code reuse across platforms.
9. Java Enterprise Edition (Java EE)
Enterprise platform with features like distributed computing and web services, run on application/microservers. De-facto standard for secure, robust, portable multi-platform apps/services — ideal for e-commerce, accounting, banking systems.
10. Serverless Stack
Lets developers focus purely on application code instead of infrastructure. Leverages Functions-as-a-Service (FaaS) like AWS Lambda, Google Cloud Functions, Azure Functions. Highly cost-effective (pay only for what you use) and auto-scales during traffic spikes.
| Stack | Core Components | Notable Companies |
|---|---|---|
| LAMP | Linux, Apache, MySQL, PHP | Wikipedia, WordPress, Shopify |
| MEAN | MongoDB, Express, Angular, Node | Google, IBM, PayPal, LinkedIn |
| MERN | MongoDB, Express, React, Node | Meta, Netflix, Airbnb, Tesla |
| Ruby on Rails | Ruby (MVC) | GitHub, Airbnb, Bloomberg |
| .NET | C#/F#/VB, cross-platform | Enterprise apps |
| Django | Python + Django | Rapid dev, low-code |
| Flutter | Dart + Firebase | Cross-platform mobile |
| React Native | JS + XML | Native mobile apps |
| Java EE | Enterprise Java | Banking, e-commerce |
| Serverless | AWS Lambda / Azure / GCP Functions | FaaS, pay-per-use |
8. JSON and its Usage in Web Applications
JSON (JavaScript Object Notation) is an open standard, lightweight, text-based format designed explicitly for human-readable data interchange. It is language-independent — supported by almost every programming language, framework, and library.
- Data is represented as key-value pairs.
- Curly braces
{ }hold objects; a colon separates each key from its value; commas separate pairs. - Square brackets
[ ]hold arrays; values are comma-separated.
Key facts
- JSON stands for JavaScript Object Notation
- Open standard data-interchange format
- Lightweight and self-describing
- Originated from JavaScript
- Easy to read and write
- Language independent
- Supports data structures — arrays and objects
Features of JSON
Simplicity Openness Self-Describing Internationalization Extensibility Interoperability
Why use JSON? (JSON vs XML) Comparison
| Aspect | JSON | XML |
|---|---|---|
| Verbosity | Less verbose, compact, readable | More verbose, tag-heavy |
| Parsing speed | Faster — needs less data/memory | Slower — DOM manipulation needs more memory for large files |
| Readability | Easily readable and straightforward; maps to domain objects easily | Comparatively harder to map |
| Data structure | Map data structure (key-value) | Tree structure |
| Main use | Serializing & transmitting data between server and web app | Document markup, config, legacy enterprise systems |
JSON Data Types
| Type | Description | Example |
|---|---|---|
| String | Always in double quotes; letters, numbers, special chars | "student", "1234" |
| Number | Numeric characters | 121, 899 |
| Boolean | true or false | true |
| Null | Empty value | null |
JSON Object
{"name" : "Jack", "employeeid" : 001, "present" : false}
JSON Array of Objects
{"employees":[
{"name":"Ram", "email":"ram@gmail.com", "age":23},
{"name":"Shyam", "email":"shyam23@gmail.com", "age":28}
]}
JSON Multidimensional Array
[
[ "a", "b", "c" ],
[ "m", "n", "o" ],
[ "x", "y", "z" ]
]
JSON Comments
JSON does not officially support comments (it is not part of the standard). A common workaround is adding an extra attribute, e.g. "comments": "He is a nice man", which is simply treated as a normal key by parsers.
9. REST APIs ⭐⭐
A. Understanding REpresentational State Transfer (REST)
REST is an architectural style providing standards between computer systems on the web, making it easier for systems to communicate. RESTful systems are stateless and separate the concerns of client and server.
B. Main Constraints of a RESTful API
- Separation of Client and Server — client and server implementations are independent; neither needs to know how the other works internally, as long as they agree on the message format. This improves flexibility across platforms, improves scalability (system's ability to handle growing users/transactions/data), and lets each side evolve independently. Different clients hitting the same REST endpoint get the same actions and responses.
- Statelessness — the server does not need to know the client's state, and vice versa. Every message can be understood on its own, without needing to see previous messages. Enforced through the use of resources (nouns of the web — objects/documents/things) rather than commands.
- Cacheability — server responses explicitly indicate whether they're cacheable, letting clients cache responses and reduce repeated requests, improving performance.
-
Uniform Interface — broken into 4 sub-constraints:
- Identification of Resources — resources identified by unique URIs.
- Resource Manipulation through Representations — clients interact with representations (XML/JSON), not the resource itself.
- Self-Descriptive Messages — each message includes all information needed to process it (e.g. media type).
- HATEOAS (Hypermedia As The Engine Of Application State) — server provides hypermedia links guiding the client to related resources.
C. Communication Between Client and Server
Making Requests — a request generally consists of:
- An HTTP verb — defines the type of operation
- A header — passes info about the request (e.g. Accept field)
- A path to a resource
- An optional message body with data
HTTP Verbs
| Verb | Purpose | Success Response |
|---|---|---|
GET | Retrieve a specific resource (by id) or collection | 200 (OK) |
POST | Create a new resource | 201 (CREATED) |
PUT | Update a specific resource (by id) | 200 (OK) |
DELETE | Remove a specific resource by id | 204 (NO CONTENT) |
Headers & Accept parameters (MIME types)
The client's request header includes an Accept field specifying content types it can receive, so the server doesn't send unusable data. MIME types = type/subtype.
| Type | Example subtypes |
|---|---|
| text | text/html, text/css, text/plain |
| image | image/png, image/jpeg, image/gif |
| audio | audio/wav, audio/mpeg |
| video | video/mp4, video/ogg |
| application | application/json, application/pdf, application/xml, application/octet-stream |
GET /articles/23
Accept: text/html, application/xhtml
Paths
Requests must contain a path to the resource. Conventionally the first part of the path is the plural form of the resource, keeping nested paths simple, e.g.:
fashionboutique.com/customers/223/orders/12
— order 12 belonging to customer 223. A POST to /customers (collection) needs no id (server generates it); GET/DELETE on a single resource needs :id appended.
Sending Responses — Content Types
When the server sends data back, it must include a Content-Type header describing the payload — this should be one of the types the client listed in its Accept field.
GET /articles/23 HTTP/1.1
Accept: text/html, application/xhtml
--- server responds ---
HTTP/1.1 200 (OK)
Content-Type: text/html
Response / Status Codes ⭐
| Code | Meaning |
|---|---|
| 200 (OK) | Standard response for a successful HTTP request |
| 201 (CREATED) | Standard response when an item was successfully created |
| 204 (NO CONTENT) | Successful request, nothing returned in the response body |
| 400 (BAD REQUEST) | Bad request syntax, excessive size, or other client error |
| 403 (FORBIDDEN) | Client does not have permission to access this resource |
| 404 (NOT FOUND) | Resource could not be found (deleted or doesn't exist) |
| 500 (INTERNAL SERVER ERROR) | Generic failure response with no more specific info available |
Frontend Frameworks (up to Bootstrap)
1. Responsive Web Design
Responsive Web Design (RWD) makes web pages render correctly on various device screen sizes without cutting short or distorting content — it looks appropriate, suitable, and well-placed on desktop, tablet, and smartphone alike. It uses HTML and CSS to resize, hide, shrink, enlarge, or move content so it looks good on any screen.
A. Setting the Viewport
<meta name="viewport" content="width=device-width, initial-scale=1.0">
name="viewport"— this meta tag relates to viewport settings.width=device-width— viewport width matches the device's screen width (responsive to device width).initial-scale=1.0— sets the initial zoom level (no zoom on load).
Without this tag, the browser renders the page at a "desktop" width and then shrinks it to fit — causing tiny, hard-to-read text. With it, the browser renders width == device width directly, avoiding the annoying zoom-in/zoom-out mobile users used to experience.
B. How to Make Images Responsive
| Method | CSS | Behaviour |
|---|---|---|
| 1. width property | img{width:100%;} | Image scales up AND down freely with the container — can become larger than its original size (can pixelate). |
| 2. max-width property ⭐ (best/most used) | img{max-width:100%; height:auto;} | Image scales down if needed, but never scales up larger than its original size. |
| 3. <picture> element | <source srcset="..." media="(max-width:600px)"> | Swaps to a completely different image file based on browser width — different images for mobile vs desktop. |
<picture>
<source srcset="img_smallflower.jpg" media="(max-width: 600px)">
<source srcset="img_flowers.jpg" media="(max-width: 1500px)">
<source srcset="flowers.jpg">
<img src="img_flowers.jpg" alt="Flowers" style="width:auto;">
</picture>
C. Responsive Text Size — the "vw" unit
vw = viewport-width. 1vw = 1% of the viewport's width. If the viewport is 100cm wide, 1vw = 1.0cm. Using vw makes font size scale directly with the browser window.
<h1 style="font-size:10vw;">Here size is 10vw.</h1>
<p style="font-size:6vw;">Here size is 6vw.</p>
2. Media Queries
Media queries are a CSS feature that let you apply styles conditionally based on the characteristics of the device/browsing environment — screen size, resolution, orientation, etc. — enabling truly responsive designs.
@media media_type and (media_feature) {
/* CSS rules to apply when conditions are met */
}
- @media — keyword starting a media query.
- media_type —
screen(computer screens),print(printed pages),speech(screen readers), etc. - media_feature —
max-width,min-width,orientation,resolution, etc.
@media screen and (min-width: 600px) {
body { background-color: #fff; }
h1 { font-size: 2em; }
}
@media screen and (min-width: 1200px) {
h1 { font-size: 2.5em; }
}
Breakpoints
A breakpoint is the specific value of a media feature (e.g. screen width) at which the styles inside that media query start applying. In the example above, min-width:600px and min-width:1200px are two breakpoints — the layout/style changes at those exact widths. Breakpoints are usually chosen around typical device categories: mobile, tablet, desktop — but the exact values depend on your project's design needs.
3. HTML5 Features
HTML5 significantly enhances web development with new semantic elements, improved multimedia/graphics support, real-time communication, and features like local storage and geolocation.
1. Audio & Video Tags
<video width="300" height="200" controls autoplay>
<source src="./dog.mp4" type="video/mp4" />
</video>
<audio controls>
<source src="dog.mp3" type="audio/mp3">
</audio>
width/height set dimensions; controls adds play/pause buttons; src provides the media URL; type specifies the media type.
2. Header
Contains introductory content — headings, logos/icons, search form, navigation, author info.
<header>
<a href="...">Technology</a> | <a href="...">Data Science</a>
</header>
3. Footer
Defines the footer of a document/section — author, copyright, contact info, sitemap, back-to-top links. A document can have more than one footer element.
<footer>
<p>Posted by: Deepali Sharma</p>
</footer>
4. Figure & Figcaption
Insert an image with a caption; <figcaption> describes the image.
<figure>
<img src="red_tulips.jpg" alt="Red Tulips">
<figcaption>Red Tulips in a Garden</figcaption>
</figure>
5. Canvas Tag
Lets you draw graphics/images on the fly using JavaScript — paths, boxes, circles, images, etc. Has two attributes: width and height.
<canvas id="Canvas1" width="400" height="100" style="border:2px solid;"></canvas>
6. Mark
Highlights a particular piece of text of special interest.
<p>Grow your skillset with <mark>Shiksha Online.</mark></p>
7. Progress Tag
Shows the progress of a task. Its value updates dynamically via JavaScript.
<progress value="55" max="100"></progress>
8. Geolocation API
A standard web API letting web apps request the user's location. Uses navigator.geolocation.getCurrentPosition(successCallback, errorCallback). Relies on a combination of GPS, Wi-Fi positioning, and cell-tower triangulation.
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition, showError);
}
function showPosition(position) {
var lat = position.coords.latitude;
var lon = position.coords.longitude;
}
9. Local Storage
A simple key-value storage mechanism in the browser, accessed via JavaScript APIs. Useful for offline apps — reduces transactions with the backend server (faster app), but has limited storage space.
localStorage.setItem("userData", userInput); // save
var storedData = localStorage.getItem("userData"); // retrieve
10. Drag and Drop API
Lets you grab a DOM element and drop it into a different location. To make an element draggable, set draggable="true".
<div id="dragElement" draggable="true" ondragstart="dragStart(event)">Drag me!</div>
<div id="dropZone" ondragover="allowDrop(event)" ondrop="drop(event)">Drop here!</div>
<script>
function dragStart(event){ event.dataTransfer.setData("text/plain", event.target.id); }
function allowDrop(event){ event.preventDefault(); }
function drop(event){
event.preventDefault();
var id = event.dataTransfer.getData("text/plain");
document.getElementById("dropZone").appendChild(document.getElementById(id));
}
</script>
| Function | Role |
|---|---|
dragStart | Fires on ondragstart; stores the dragged element's id via dataTransfer.setData |
allowDrop | Fires on ondragover; calls preventDefault() to permit dropping |
drop | Fires on ondrop; retrieves the id via dataTransfer.getData, then appends the element to the drop zone |
4. Bootstrap — Complete ⭐⭐⭐
What is Bootstrap?
Bootstrap is an open-source front-end framework developed by Twitter. It's a collection of HTML, CSS, and JavaScript tools/components that help developers build responsive and mobile-first web applications. It simplifies designing/styling pages via pre-built, customizable components and styles.
Key Features of Bootstrap
- Responsive Design — mobile-first approach; adapts from small phones to large desktops.
- Grid System — a responsive 12-column layout for flexible, dynamic designs.
- CSS Components — pre-styled navbars, buttons, forms, typography, and more.
- JavaScript Plugins — modals, carousels, tooltips, popovers, etc.
- Customization — highly customizable via source files; integrates with Sass/Less.
- Community & Documentation — large active community, comprehensive official docs, third-party themes.
- Cross-Browser Compatibility — consistent, reliable performance across browsers.
What's New in Bootstrap 5 ⭐ (very frequently asked)
| # | Change | Detail |
|---|---|---|
| I | Major rewrite | Entire framework rewritten — improved performance, modularity, code quality |
| II | Brand new look & feel | Modern, updated visual design, default styling, layout components |
| III | Brand new logo | Rebranding effort reflecting the framework's evolution |
| IV | New typography | Better readability and visual appeal across devices |
| V | No jQuery required anymore | Now uses plain/vanilla JavaScript — more lightweight, modern |
| VI | Dropped IE11 support | Enables modern web standards, better performance |
| VII | New theme colors | Refreshed color palette across components |
| VIII | Enhanced grid | Improved flexibility & control over layout, new utility classes |
| IX | Offcanvas | Hidden side menus/panels revealed on demand — better navigation UX |
| X | Own icon system | Built-in icons — no need for external icon libraries |
Bootstrap 5 Installation — Two Methods Comparison
| A. CDN Link (online) | B. Compiled CSS file (offline) | |
|---|---|---|
| How | Add a <link> tag pointing to a Content Delivery Network URL in <head> | Download the ZIP from getbootstrap.com, extract, host files locally, link with a relative path |
| Internet needed? | Yes — required to load Bootstrap files | No — works fully offline |
| Loading speed | Often faster — served from a geographically closer server | Depends on local server, but no external network latency |
| Server burden | Reduced — files served by CDN, not your server | Reduced dependency on external servers/CDNs |
| Version control | Always latest version automatically (unless pinned) | Full control — you decide when to update |
| Security/Privacy | Depends on third-party CDN's reliability | Better — no external entity can tamper/intercept the file in transit |
| Outage risk | Vulnerable if the CDN goes down | Immune to CDN outages |
| Best for | Quick prototyping, production sites with reliable internet | Offline apps, restricted/isolated dev environments, testing without internet |
| Trade-off | — | Manual effort to update versions; larger project file size |
<!-- A. CDN -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- B. Offline (after downloading) -->
<link rel="stylesheet" href="bootstrap-5.0.2-dist/css/bootstrap.css">
Bootstrap 5 Containers ⭐⭐ (core layout building block)
Containers align and contain your content within a device/viewport. They're the most fundamental layout element used with the grid system — mostly for enclosing content with padding, and centering fixed-width content horizontally.
| Container Type | Class | Behaviour |
|---|---|---|
| Container | .container | Has a maximum (fixed) width at each responsive breakpoint; centers content horizontally |
| Container-fluid | .container-fluid | 100% width at all breakpoints — spans the full page width always |
| Responsive Container | .container-{breakpoint} | 100% width until the specified breakpoint, then becomes fixed-width like a normal container |
Breakpoint width table ⭐ (memorize)
| Classes | Extra Small <576px | Small(sm) ≥576px | Medium(md) ≥768px | Large(lg) ≥992px | X-Large(xl) ≥1200px | XX-Large(xxl) ≥1400px |
|---|---|---|---|---|---|---|
| .container | 100% | 540px | 720px | 960px | 1140px | 1320px |
| .container-sm | 100% | 540px | 720px | 960px | 1140px | 1320px |
| .container-md | 100% | 100% | 720px | 960px | 1140px | 1320px |
| .container-lg | 100% | 100% | 100% | 960px | 1140px | 1320px |
| .container-xl | 100% | 100% | 100% | 100% | 1140px | 1320px |
| .container-xxl | 100% | 100% | 100% | 100% | 100% | 1320px |
.container for that breakpoint onward. .container-xxl stays fluid the longest.<!-- container: fixed width, centered -->
<div class="container bg-info">...</div>
<!-- container-fluid: always full width -->
<div class="container-fluid bg-info">...</div>
<!-- responsive container: fluid until md breakpoint -->
<div class="container-md bg-danger">...</div>
5. Tailwind CSS
Tailwind CSS is a utility-first CSS framework that provides a set of pre-designed utility classes to build user interfaces. Unlike Bootstrap, Tailwind does not come with pre-built components (like ready navbars/buttons) — instead it offers many small, low-level utility classes that you compose yourself to create fully custom designs.
Key Features of Tailwind CSS
- Utility-First Approach — small, single-purpose classes for styling elements, giving more flexibility/customization.
- Responsive Design — built-in responsive utility classes for adapting to different screen sizes.
- Customization — highly configurable via a config file, or use sensible defaults.
- Flexibility — doesn't dictate a specific design/structure, so you can build unique layouts.
- Modular & Composable — utility classes combine to create complex styles, keeping stylesheets easy to manage.
Tailwind vs Bootstrap Comparison
| Aspect | Tailwind CSS | Bootstrap |
|---|---|---|
| Approach | Utility-first — compose your own design from small classes | Component-first — ready-made components (navbar, card, button) |
| Pre-built components? | No — you build your own using utilities | Yes — pre-styled, ready to use |
| Design uniqueness | Every site can look completely different | Sites can look similar unless heavily customized |
| Learning curve | Need to learn many utility class names | Faster to start — just apply component classes |
Using Tailwind via CDN (Play CDN)
The Play CDN lets you try Tailwind directly in the browser without any build step — meant for development only, not recommended for production.
<head>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body>
<div class="bg-blue-500 text-white p-4">
<h1 class="text-2xl font-bold">Hello, Tailwind CSS!</h1>
<p class="mt-2">Welcome to your webpage.</p>
</div>
</body>
Reading Tailwind Utility Classes ⭐ (commonly tested)
| Class | Meaning |
|---|---|
bg-blue-500 | Background color = blue, intensity 500 (Tailwind's color-intensity scale) |
text-white | Text color = white |
p-4 | Padding on all sides, size 4 (moderate, based on Tailwind's spacing scale) |
text-2xl | Font size = extra-large (scale: sm, md, lg, xl, 2xl…) |
mt-2 | Margin-top, size 2 |
Example — Hover Effects with Transitions
<div class="h-full border-2 border-gray-200 border-opacity-60 rounded-lg overflow-hidden">
<div class="p-6 hover:bg-green-600 hover:text-white transition duration-300 ease-in">
<h1 class="text-2xl font-semibold mb-3">Hover</h1>
</div>
</div>
| Class | Meaning |
|---|---|
h-full | Height = 100% of parent container |
border-2 | 2px border thickness |
border-gray-200 border-opacity-60 | Gray border color at 60% opacity |
rounded-lg | Large rounded corners |
overflow-hidden | Clips any content that overflows the box |
hover:bg-green-600 | Background turns green only while hovering (the hover: prefix scopes the style to the hover state) |
hover:text-white | Text turns white on hover |
transition duration-300 ease-in | Animates the hover change smoothly over 300ms, easing in |
6. Vue.js — Directives and Binding
What is Vue.js?
Vue.js (pronounced "view") is an open-source, progressive JavaScript framework used to build interactive web UIs and Single Page Applications (SPAs). "Progressive" means it offers variable degrees of complexity and flexibility — you can adopt as much or as little of it as you need.
- Vue.js lets you extend HTML with HTML attributes called directives.
- Directives add functionality to HTML applications.
- Vue provides both built-in directives and support for user-defined (custom) directives.
What is a Single Page Application (SPA)?
An SPA is a web application/website providing a very fluid, reactive, fast experience similar to a desktop app. It contains a menu, buttons, and blocks all on a single page — when a user clicks something, the page is dynamically rewritten rather than loading a brand-new page from the server, which is the reason behind its fast, reactive feel.
Pre-requisites for Vue.js
Node.js ≥ 15.0 Code editor (VS Code / Notepad++ / Atom) Browser (Chrome/Firefox) Volar extension (VS Code) Vue.js devtools
Creating a Vue App — Without a Build Tool (CDN)
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<div id="app">{{ message }}</div>
<script>
const { createApp, ref } = Vue
createApp({
setup() {
const message = ref('Hello vue!')
return { message }
}
}).mount('#app')
</script>
This uses the Composition API (Vue 3): createApp creates the Vue instance; setup() runs before the component is created and is where reactive state is defined; ref('Hello vue!') creates a reactive variable; returning { message } exposes it to the template; {{ message }} is template interpolation that Vue replaces with the current value; .mount('#app') attaches the Vue instance to the DOM element with id app.
Custom Directives ⭐ (practical-heavy topic)
A custom directive is defined using Vue.directive('name', { ...hooks }), then used in HTML as v-name.
Hook Functions of a Directive
| Hook | When it fires |
|---|---|
bind | Called only once, when the directive is first bound to the element — used for one-time setup |
inserted | Called when the bound element is inserted into the DOM — good place for DOM manipulation |
update | Called when the bound element's value/expression changes |
componentUpdated | Called after the containing component has been updated |
unbind | Called only once, when the directive is unbound/removed from the element |
Practical I — Custom Directive: Uppercase Text on Click
<!-- HTML -->
<div id="app">
<p v-uppercase>Hello, this text will be uppercased when clicked!</p>
</div>
<!-- app.js -->
Vue.directive('uppercase', {
bind(el) {
el.style.cursor = 'pointer';
el.addEventListener('click', () => {
const text = el.innerText;
el.innerText = text.toUpperCase();
});
}
});
new Vue({ el: '#app' });
bind(el) runs once when the directive attaches; it sets the cursor to a pointer (visual clickability cue) and attaches a click listener that reads el.innerText, converts it with toUpperCase(), and writes it back — so a click uppercases the paragraph's text.
Practical II — Dynamic List with a Custom Directive
<!-- HTML -->
<div id="app">
<ul v-list="items"></ul>
</div>
<!-- app.js -->
Vue.directive('list', {
bind(el, binding) {
const ul = document.createElement('ul');
binding.value.forEach(item => {
const li = document.createElement('li');
li.textContent = item;
ul.appendChild(li);
});
el.appendChild(ul);
}
});
new Vue({
el: '#app',
data: { items: ['Subject-1', 'Subject-2', 'Subject-3'] }
});
binding.value gives access to the data passed into the directive (here, the items array). The directive loops over each item, builds an <li> for it, and appends all of them into a new <ul>, which is then appended to the bound element.
Practical III — Custom Directive: Human-Readable Date Formatting
<p v-format-date="date"></p>
<script>
Vue.directive('format-date', {
inserted: function(el, binding) {
const date = binding.value;
el.textContent = formatDate(date);
}
});
new Vue({
el: '#app',
data: { date: '2022-03-05T12:00:00' }
});
function formatDate(dateString) {
const options = { year: 'numeric', month: 'long', day: 'numeric' };
return new Date(dateString).toLocaleDateString('en-US', options);
}
</script>
<!-- Output: March 5, 2022 -->
This uses the inserted hook (fires once the element is in the DOM) and JavaScript's toLocaleDateString() with formatting options to convert an ISO date string into a readable format like "March 5, 2022".
7. React JS
React Introduction
ReactJS is a declarative (you tell React what you want, and React builds the actual UI), efficient, and flexible JavaScript library for building reusable UI components. It's open-source, component-based, and responsible only for the view layer of an application. Developed and maintained by Facebook (Meta); used in WhatsApp & Instagram.
A React app is made of multiple components, each responsible for outputting a small, reusable piece of HTML. Components can be nested inside other components to build complex UIs from simple building blocks. React uses a Virtual DOM-based mechanism to fill data into the HTML DOM — it works fast because it only changes the individual DOM elements that actually changed, instead of reloading the complete DOM every time.
Real DOM vs Virtual DOM ⭐ (frequently asked comparison)
| Aspect | Real DOM | Virtual DOM |
|---|---|---|
| What it is | The actual structure of the webpage, rendered on the browser | A virtual (in-memory) representation/"blueprint" of the Real DOM |
| Updates | React updates the complete document in the Real DOM; changes reflect directly on the whole webpage | React updates state changes in the Virtual DOM first, then syncs the difference with the Real DOM (this syncing process is called reconciliation) |
| Performance | Slower for repeated updates — re-rendering the whole document each time is costly; all UI components re-render on every update | Faster — only the changed/affected nodes are updated in the Real DOM, not the entire page |
| Analogy | The actual machine | A blueprint of the machine — you can edit the blueprint, but it isn't the machine itself until synced |
Why Use ReactJS?
Main objective: build fast, performant UIs using the Virtual DOM (a JavaScript object), which is faster than manipulating the regular DOM directly. React can be used on client and server side, and with other frameworks. Traditional frameworks recreate the entire DOM on every page load/modification, wasting memory and reducing performance — React solves this by using an in-memory Virtual DOM and only pushing the actual diffs to the browser's Real DOM.
Installing React (Create React App)
npx create-react-app my-app
cd my-app
npm start
If npx create-react-app fails, run in sequence: npm init → npm install create-react-app → npx create-react-app myapp.
React Elements
Elements are the smallest building blocks of a React app. An element is a plain object describing what should appear on the UI (in terms of DOM nodes). Creating a React element is cheap compared to creating a real DOM element. Elements can be created using JSX or plain React (without JSX).
import React from 'react';
import ReactDOM from 'react-dom';
const element = <h1 className='testClass'>Hello Devendra</h1>;
ReactDOM.render(element, document.getElementById('root'));
An element has a type (here, h1) and properties (here, className). The JSX code is compiled into plain JavaScript by Babel (a JavaScript compiler that transforms JSX into browser-executable JS).
React Function Components
Components are the building blocks of any React app — they let you split the UI into independent, reusable pieces. A component is a combination of: (1) template using HTML, (2) user interactivity using JS, (3) styling using CSS. Conceptually, a component is a JavaScript class or function that accepts inputs (called props) and returns a React element describing how a section of the UI should appear.
var Employee = (data) => {
return (
<div>
<p>Name : {data.name}</p>
<p>Salary : {data.salary}</p>
<p>Dept Name : <b>{data.dept}</b></p>
</div>
);
}
const element = <Employee name="Sara" salary="12345" dept="CSE" head="Ahmedabad" />;
ReactDOM.render(element, document.getElementById('root'));
When React sees an element representing a user-defined component, it passes the JSX attributes to that component as a single object — this object is called "props".
React Class Components
To define a class component, create a class that extends React.Component. The output of any class component depends entirely on the return value of its render() method — this is the only required method in a class component. Attributes passed to the component are accessed via this.props.
class Employee extends React.Component {
render() {
return (
<div>
<h2>Employee Details...</h2>
<p>ID : <b>{this.props.ID}</b></p>
<p>Name : <b>{this.props.Name}</b></p>
<p>Location : <b>{this.props.Location}</b></p>
<p>Salary : <b>{this.props.Salary}</b></p>
</div>
);
}
}
const element = <Employee ID="08" Name="Devendra" Location="IT-NU" Salary="12345"/>;
ReactDOM.render(element, document.getElementById("root"));
Function Components vs Class Components Comparison
| Aspect | Function Component | Class Component |
|---|---|---|
| Definition | A plain JavaScript function that accepts props and returns JSX | A class that extends React.Component |
| Required method | None — just return JSX directly | render() is the only required method |
| Accessing props | Directly via the function's parameter (e.g. data.name) | Via this.props.name |
| Syntax weight | Simpler, shorter | More boilerplate (class, constructor, render) |
Fetching API Data Asynchronously (Hooks: useState, useEffect)
import React, { useState, useEffect } from 'react';
function App() {
const [loading, setLoading] = useState(true);
const [records, setRecords] = useState([]);
useEffect(() => {
setLoading(true);
fetch('https://jsonplaceholder.typicode.com/photos')
.then(response => response.json())
.then(data => {
setRecords(data);
setLoading(false);
})
.catch(error => console.error(error));
}, []);
return (
<div>
{loading ? 'Loading...' : (
<div className="grid">
{records && records.map(item => (
<div className="item" key={item.id}>
<p>{item.title}</p>
</div>
))}
</div>
)}
</div>
);
}
export default App;
| Piece | Role |
|---|---|
useState(true) | Creates a state variable loading (and setter setLoading) initialized to true |
useState([]) | Creates a state variable records (and setter setRecords) initialized as an empty array |
useEffect(() => {...}, []) | Runs the fetch once when the component mounts (empty dependency array []) |
fetch(...).then(response => response.json()) | Makes the HTTP GET request and parses the JSON response |
setRecords(data); setLoading(false); | Stores fetched data and marks loading as complete |
| Conditional rendering | Shows "Loading..." while loading is true; otherwise maps over records to render each item |
useState manages state in function components; useEffect handles side effects (like API calls) and runs based on its dependency array ([] = run once on mount).Full Practical Example — Movie Ticket Booking (state + arrays + event handling) ⭐
This example is a good template for any "write a React component" question — it shows useState managing multiple pieces of state, rendering a list from an array with .map(), and handling clicks to update state.
import React, { useState } from 'react';
const MovieTicketBooking = () => {
const [selectedMovie, setSelectedMovie] = useState(null);
const [selectedSeats, setSelectedSeats] = useState([]);
const movies = [
{ id: 1, title: 'Movie 1', availableSeats: 100 },
{ id: 2, title: 'Movie 2', availableSeats: 80 },
{ id: 3, title: 'Movie 3', availableSeats: 120 }
];
const handleMovieSelect = (movie) => {
setSelectedMovie(movie);
setSelectedSeats([]);
};
const handleSeatSelect = (seat) => {
setSelectedSeats([...selectedSeats, seat]);
};
return (
<div>
<h2>Movie Ticket Booking</h2>
<h3>Select a movie:</h3>
<ul>
{movies.map(movie => (
<li key={movie.id} onClick={() => handleMovieSelect(movie)}>
{movie.title} ({movie.availableSeats} seats available)
</li>
))}
</ul>
{selectedMovie && (
<div>
<h4>Selected Movie: {selectedMovie.title}</h4>
<div>
{Array.from({ length: selectedMovie.availableSeats }, (_, index) => (
<button
key={index}
disabled={selectedSeats.includes(index)}
onClick={() => handleSeatSelect(index)}
>
{index + 1}
</button>
))}
</div>
<h4>Selected Seats:</h4>
{selectedSeats.map(seat => (<span key={seat}>Seat {seat + 1}, </span>))}
<button onClick={() => setSelectedSeats([])}>Reset</button>
</div>
)}
</div>
);
};
export default MovieTicketBooking;
| Piece | Role |
|---|---|
selectedMovie / setSelectedMovie | Tracks which movie the user picked (state) |
selectedSeats / setSelectedSeats | Tracks the array of chosen seat indices (state) |
movies.map(...) | Renders a clickable list item per movie from a plain JS array — the standard React list-rendering pattern (needs a unique key) |
handleMovieSelect | Event handler — updates state when a movie <li> is clicked, resetting any previous seat selection |
Array.from({length:n}, ...) | Generates n seat buttons dynamically based on availableSeats |
Conditional rendering (selectedMovie && (...)) | Only shows the seat-selection UI after a movie has been picked |
Complete Question Bank — All Questions with Answers
Disadvantages: chosen solution can be wrong for the project; outcome depends heavily on developer skill; creates key-person risk; increasing complexity of being a full-stack developer.
Definition: A 3-tier architecture is a way of structuring an application so that the code for each area of responsibility is cleanly split away from the others into three distinct layers: the Presentation layer, the Business layer, and the Data Access layer, which finally connects to the Database. (Draw the 3-Tier Architecture diagram and the Request/Response cycle diagram shown above — label all four boxes and the arrows between them.)
What each layer does: The Presentation layer holds the presentation logic (HTML/UI) and is the only layer that talks to the outside world (usually a person via a browser). The Business layer holds the business logic — the actual rules and workflows of the application. The Data Access layer holds the data access logic (DML — Data Manipulation Language) and is the only layer allowed to talk to the database. Crucially, the presentation layer has no direct communication with the data access layer — it can only reach it indirectly, through the business layer.
Why split into layers at all: this separation means you can replace the component in one layer without touching the others — e.g. swap the UI layer to output HTML, PDF, or CSV; swap the data access layer to move from MySQL to Oracle or SQL Server; or update business rules independently. It also allows reusability, since one Business-layer component can be shared across multiple Presentation-layer components (business logic defined once, used everywhere), and it lets different specialist teams build/maintain each layer independently.
Design note — don't assume one component per layer: real applications typically need a separate Presentation-layer component per user transaction, a separate Business-layer component per business entity/database table, and a separate Data-Access-layer component per supported DBMS.
Rules of 3-Tier Architecture:
- Code for each layer must live in separate files, maintainable independently — possibly by separate teams.
- Each layer may contain only the logic that belongs to it: business logic only in the Business layer, presentation logic only in the Presentation layer, data access logic only in the Data Access layer.
- The Presentation layer can only receive requests from, and return responses to, an outside agent (usually a person, sometimes another piece of software).
- The Presentation layer can only send requests to, and receive responses from, the Business layer — it has no direct access to either the database or the Data Access layer.
- The Business layer can only receive requests from, and return responses to, the Presentation layer.
- The Business layer can only send requests to, and receive responses from, the Data Access layer — it cannot access the database directly.
- The Data Access layer can only receive requests from, and return responses to, the Business layer — it cannot issue requests to anything except the DBMS it supports.
- Each layer must be totally unaware of the inner workings of the other layers — the Business layer must be database-agnostic (doesn't know/care how data access works) and presentation-agnostic (doesn't know/care whether the output becomes HTML, PDF, or CSV).
Skills needed per layer (good closing point for a 10-marker): Presentation → HTML, CSS, JavaScript, UI design. Business → a programming language capable of encoding business rules. Data Access → SQL skills (DDL + DML) plus database design. A single person can have all these skills, but such people are rare — which is exactly why large organisations split applications into these layers, letting each be built and maintained by a different specialist team.
Different combinations of technologies ("stacks") exist because different projects have different needs — some prioritize speed of development, some scalability, some mobile support, and some enterprise-grade security. Below are the major stacks, each with its core components, what makes it distinctive, and real companies using it:
- LAMP — Linux (OS), Apache (Web Server), MySQL (Database), PHP (Language). One of the first open-source stacks; efficiently handles dynamic pages where content changes on every load. Components are swappable — Windows instead of Linux gives a WAMP stack, macOS gives MAMP, and PHP can be swapped for Perl or Python. Used by: Wikipedia, Yahoo, Etsy, Shopify, WordPress, Magento.
- MEAN — MongoDB (NoSQL database), Express.js (Node.js web framework), Angular (Google's front-end framework), Node.js (server-side JS runtime). An end-to-end JavaScript stack, so a single language is used across the whole stack, enabling code reuse. All components are free/open-source and ideal for cloud hosting since they're flexible, scalable, and extensible; the database can scale on demand for traffic spikes. Used by: Google, Microsoft, IBM, Amazon, Uber, PayPal, LinkedIn.
- MERN — same as MEAN but Angular is replaced with React. React is popular for building high-end, single-page apps with highly interactive UI, using JSX and a Virtual DOM for fast updates. Since React is a library rather than a full framework, developers often need third-party additions for functionality Angular includes natively. Used by: Meta (Facebook), Tesla, GoDaddy, Walmart, Shutterfly, Under Armour, Accenture, Philips, Airbnb, Netflix, Mozilla.
- Ruby on Rails (RoR) — a server-side web framework written in Ruby, MIT-licensed, following the MVC (Model-View-Controller) pattern. Offers seamless database table creation, migrations, and scaffolding of views, enabling very rapid application development; encourages JSON/XML for data transfer and HTML/CSS/JS for the UI. Used by: SlideShare, Airbnb, CrunchBase, Bloomberg, Dribble, Shopify, GitHub.
- .NET — an open-source developer platform (tools, languages C#/F#/Visual Basic, libraries) for building modern, scalable, high-performing desktop/web/mobile apps that run natively across operating systems (Linux, macOS, Windows, iOS, Android). Known for ease of development, code reusability, and strong built-in security.
- Python-Django — Django is a high-level Python web framework encouraging rapid development with a clean, pragmatic design; often paired with Apache and MySQL for server-side work. Supports low-code development and can manage rising traffic/API request volumes.
- Flutter — an open-source Google framework for building multi-platform mobile apps from a single codebase, powered by the Dart language, often paired with Firebase on the back end for scalable apps.
- React Native — a JavaScript framework (based on React) for building native iOS and Android apps using a mix of JS and XML markup; renders using real mobile UI components (so apps look genuinely native) and allows up to 100% code reuse across platforms.
- Java Enterprise Edition (Java EE) — provides enterprise features like distributed computing and web services, run on application/microservers; the de-facto standard for secure, robust, multi-platform apps — ideal for e-commerce, accounting, and banking information systems.
- Serverless Stack — lets developers focus purely on application code rather than infrastructure, using Functions-as-a-Service (FaaS) like AWS Lambda, Google Cloud Functions, or Azure Functions. Highly cost-effective (you don't pay for unused server resources) and auto-scales during traffic spikes.
Closing point for full marks: note that all these stacks ultimately map back to the front-end/back-end/database split of full-stack development — they simply standardize which specific technology occupies each slot, trading off between rapid development, scalability, community support, and platform reach.
Definition: REST (REpresentational State Transfer) is an architectural style — not a protocol or a strict standard — that provides a set of conventions for communication between computer systems on the web, making it easier for systems built independently to talk to each other. Systems that follow these conventions are called RESTful. (Draw the "REST API — High-level Flow" diagram: Database ↔ Web Server ↔ RESTful API ↔ Client App.)
The four main constraints (this is the core of the answer):
- Separation of Client and Server — the client implementation and server implementation can be developed and changed completely independently, as long as both sides agree on the message format they exchange. This improves flexibility of the interface across platforms, improves scalability by simplifying server components, and lets each side evolve on its own timeline. Because of this, different clients hitting the same REST endpoint perform the same actions and get the same responses.
- Statelessness — the server does not need to remember anything about the client's previous requests, and vice versa; every request must contain all the information needed to understand and process it. This is enforced by interacting through resources (the "nouns" of the web — any object, document, or thing you need to store or send) rather than through stateful commands.
- Cacheability — server responses explicitly state whether they can be cached. This lets clients reuse cached responses instead of repeating identical requests, directly improving performance and reducing server load.
- Uniform Interface — the most important constraint, broken into four sub-rules:
- Identification of Resources — every resource is identified by a unique URI.
- Resource Manipulation through Representations — clients never touch the resource directly; they interact with a representation of it (typically JSON, sometimes XML).
- Self-Descriptive Messages — every message carries all the information needed to process it, including how to interpret the data (e.g. its media type).
- HATEOAS (Hypermedia As The Engine Of Application State) — server responses include hypermedia links guiding the client toward related resources/actions, so the client doesn't need out-of-band knowledge of the API's structure.
How communication actually happens (the "streamlining" part): Every request is built from four standard parts — an HTTP verb (what operation to perform), a header (e.g. the Accept field, listing acceptable MIME types like application/json), a path to the resource (conventionally the plural resource name, e.g. /customers/223/orders/12), and an optional message body. The four standard HTTP verbs map directly onto CRUD-style operations: GET retrieves a resource (success → 200 OK), POST creates one (success → 201 Created), PUT updates one (success → 200 OK), and DELETE removes one (success → 204 No Content). On the response side, the server always returns a Content-Type header (matching one of the types the client said it could Accept) plus a standard status code — 200/201/204 for success, 400/403/404 for client-side problems, 500 for an unspecified server failure.
Why this streamlines communication: because every RESTful system — regardless of what language or framework built it — agrees on the same verbs, the same status codes, the same idea of a stateless request/response cycle, and the same resource-based URI structure, any REST client can talk to any REST server without needing custom, one-off integration code. This uniformity is precisely what makes REST the standard choice for modern web APIs.
{ }) and arrays ([ ]). It's used because it's less verbose than XML, parses faster, is easily readable and maps cleanly to domain objects in any language, and is commonly used to serialize and transmit data between a server and a web app (e.g. API responses).<meta name="viewport" content="width=device-width, initial-scale=1.0">; (2) making images responsive via width:100% or (better) max-width:100%; height:auto;, or using the <picture> element for different images per screen width; (3) making text responsive using the vw unit; and (4) using media queries with breakpoints to apply different CSS rules at different screen widths.vw stands for viewport-width, where 1vw = 1% of the current viewport's width. Setting font-size:6vw; means the text size is always 6% of the browser window's width, so it automatically scales up or down as the window is resized — no media query needed for this specific effect.max-width:100%; height:auto; on the image (instead of plain width:100%). This is considered the best/most-used responsive-image method because it lets the image shrink to fit smaller containers, but caps its size at the image's true original resolution, preventing pixelation from over-enlarging.@media media_type and (media_feature) { CSS rules }. A breakpoint is the specific media-feature value (e.g. a screen width like min-width:600px) at which those styles activate — you add one simply by writing a new @media block targeting that width and placing the desired CSS rules inside it. Breakpoints are usually chosen to match typical device categories (mobile/tablet/desktop) but are ultimately set based on your own design's needs.<video>/<audio> and a controls attribute. (2) Canvas — draw graphics dynamically via JavaScript using width/height attributes. (3) Geolocation API — request the user's location via navigator.geolocation.getCurrentPosition(). (4) Local Storage — key-value storage in the browser via localStorage.setItem()/getItem(), useful for offline apps though storage is limited. (5) Drag and Drop API — make elements draggable (draggable="true") and define drop zones using ondragstart, ondragover, and ondrop event handlers.Definition: Bootstrap is an open-source front-end framework developed by Twitter. It is a collection of pre-written HTML, CSS, and JavaScript tools and components that help developers build responsive and mobile-first web applications quickly. Rather than writing every UI element and its styling from scratch, Bootstrap gives you a library of pre-built, pre-styled components that you can drop into a page and customize.
Key features, explained:
- Responsive Design — Bootstrap is built with a mobile-first approach: base styles target small screens first, then progressively enhance for larger ones, ensuring sites adapt well from small phones all the way up to large desktop monitors.
- Grid System — a responsive layout system based on 12 columns. By combining
.container,.row, and.colclasses, developers can create flexible, dynamic multi-column layouts that automatically reflow at different screen widths. - CSS Components — a large set of pre-styled, ready-to-use components: navigation bars, buttons, forms, typography, cards, alerts, and more, so common UI patterns don't need to be designed from zero.
- JavaScript Plugins — built-in interactive behaviour such as modals, carousels (image sliders), tooltips, and popovers, without writing custom JS for these common interactions.
- Customization — while Bootstrap ships with sensible defaults, it is highly customizable: developers can edit the source Sass/Less files to change colors, spacing, and component styles to match a project's own branding.
- Community & Documentation — a large, active developer community means abundant tutorials, third-party themes, and extensions are freely available, and the official documentation is comprehensive and beginner-friendly.
- Cross-Browser Compatibility — Bootstrap is engineered to behave consistently across different web browsers, removing the burden of manually patching browser-specific quirks.
Closing point: together, these features let a full-stack developer prototype and ship a professional, responsive UI far faster than hand-rolling CSS for every screen size and component — which is exactly why Bootstrap remains one of the most widely adopted front-end frameworks in industry.
<link> tag pointing to a CDN URL in the <head>; advantages are faster loading (geographically distributed servers), reduced burden on your own server, and automatically using the latest version — but it requires an internet connection. Compiled CSS (offline) — download the Bootstrap ZIP, extract, and host the CSS/JS files locally; advantages are offline availability, reduced dependency on external servers, improved performance (no network request needed), full customization/version control, better security/privacy, and immunity to CDN outages — though it requires manually updating versions and increases project size..container from there on — .container-xxl stays fluid longest. (See breakpoint width table above.)bind — called only once, when the directive is first bound to the element; used for one-time setup. inserted — called when the bound element is inserted into the DOM; good for DOM manipulation. update — called when the bound element's value/expression changes. componentUpdated — called after the containing component has updated. unbind — called only once, when the directive is unbound from the element.Vue.directive('uppercase', { bind(el){ el.style.cursor='pointer'; el.addEventListener('click', () => { el.innerText = el.innerText.toUpperCase(); }); } }), then apply it in HTML as <p v-uppercase>...</p>. The bind hook runs once, sets a pointer cursor as a visual cue, and attaches a click listener that reads and rewrites the element's text in uppercase. (Full code under Unit-2 → Vue.js → Practical I above.)Vue.directive('list', { bind(el, binding){ ... binding.value.forEach(item => { create <li> and append }); el.appendChild(ul); } }) and use it as <ul v-list="items"></ul>, where items is an array in the Vue instance's data. binding.value gives the directive access to that array so it can build and insert list items dynamically. (Full code under Unit-2 → Vue.js → Practical II above.)Vue.directive('format-date', { inserted(el, binding){ el.textContent = formatDate(binding.value); } }), apply it as <p v-format-date="date"></p>, and implement formatDate() using new Date(dateString).toLocaleDateString('en-US', {year:'numeric', month:'long', day:'numeric'}) to convert an ISO date string (e.g. 2022-03-05T12:00:00) into a readable form (e.g. "March 5, 2022"). (Full code under Unit-2 → Vue.js → Practical III above.)bg-blue-500, text-white, p-4, text-2xl, and mt-2.bg-blue-500 sets background color to blue at intensity 500; text-white sets text color to white; p-4 adds padding of size 4 on all sides; text-2xl sets an extra-large font size; mt-2 adds margin-top of size 2. Each follows Tailwind's naming convention: property abbreviation + value/scale-step.const element = <h1>Hello</h1>;) or without JSX. They're rendered into the page using ReactDOM.render(element, document.getElementById('root')), where root is a container div in the HTML file. JSX is compiled to plain JavaScript by Babel.React.Component and must implement a render() method (the only required method), accessing props via this.props. Function components are simpler and involve less boilerplate.useState hook to create state variables (e.g. loading, records) and the useEffect hook to perform the fetch as a side effect. Inside useEffect, call fetch(url).then(res => res.json()).then(data => { setRecords(data); setLoading(false); }), with an empty dependency array [] so it runs only once when the component mounts. The JSX conditionally renders a loading message while loading is true, and maps over records once data arrives."comments": "He is a nice man", which any parser will just treat as a normal string value rather than a real comment.<script src="https://cdn.tailwindcss.com"></script>) lets you try Tailwind directly in the browser with zero build step — great for quick demos/learning. It should not be used in production, since it compiles styles on the fly in the browser and isn't optimized (no purging of unused CSS, larger payload, slower).function Employee(data) {
return (
<div>
<p>Name: {data.name}</p>
<p>Salary: {data.salary}</p>
</div>
);
}
const element = <Employee name="Sara" salary="12345" />;
ReactDOM.render(element, document.getElementById('root'));
The function receives the JSX attributes bundled as a single props object (here called data), and returns JSX referencing data.name/data.salary — React then renders that returned JSX wherever the component is used.{"employees":[
{"name":"Ram", "email":"ram@gmail.com", "age":23},
{"name":"Shyam", "email":"shyam23@gmail.com", "age":28},
{"name":"John", "email":"john@gmail.com", "age":33}
]}
employees is a key whose value is an array ([ ]) of objects ({ }); each object holds key-value pairs of type String (name, email) and Number (age).Comparison-Style Questions
GET retrieves a resource/collection (success → 200). POST creates a new resource (success → 201). PUT updates an existing resource by id (success → 200). DELETE removes a resource by id (success → 204, no content returned)..container = fixed max-width at every breakpoint (never full width). .container-fluid = always 100% width, at every breakpoint (never fixed). .container-{breakpoint} (responsive container) = 100% width up to the named breakpoint, then locks to a fixed width from that breakpoint onward — a hybrid of the two.width:100% method vs the max-width:100% method for responsive images.width:100% makes the image always fill its container — scaling both up and down, which can enlarge a small image beyond its native resolution (pixelation). max-width:100%; height:auto; lets the image shrink to fit a smaller container, but caps growth at the image's original size — considered the safer, best-practice method.useState, useEffect). Class components extend React.Component, must implement render(), and access props via this.props — more verbose, and were the only way to manage state/lifecycle before Hooks existed.bind fires once, immediately when the directive attaches to the element — used for one-time setup (e.g. attaching event listeners). inserted fires once the element is actually placed into the live DOM — needed when a DOM-dependent operation (like measuring size or setting focus) must happen after insertion. update fires every time the bound value/expression changes, letting the directive react to new data — unlike bind/inserted, which fire only once.Last-Minute Recall Checklist
- Draw the 3-tier architecture diagram and state all its rules without looking
- Name REST's 4 main constraints + all 4 HTTP verbs with their success status codes
- Explain JSON's structure and why it's preferred over XML
- List all 10 HTML5 features with one example each
- Explain viewport meta tag, both image-responsiveness methods, and the vw unit
- Recite what's new in Bootstrap 5 (especially: no jQuery, Offcanvas, own icons)
- Draw the difference between .container / .container-fluid / .container-{breakpoint}, and recall the breakpoint width table
- Explain CDN vs offline Bootstrap installation, with 2 pros of each
- Explain Tailwind's utility-first approach and decode a few utility class names on sight (e.g.
hover:bg-green-600) - Explain Vue.js directives, SPAs, and all 5 custom-directive hook functions (bind/inserted/update/componentUpdated/unbind)
- Write the uppercase-on-click custom directive from memory
- Explain Real DOM vs Virtual DOM and why React is fast
- Differentiate React function components vs class components, and recall useState/useEffect for async data fetching