HTML (HyperText Markup Language)
What is HTML?
HTML (HyperText Markup Language) is the standard language for creating webpages.What are HTML tags?
Tags define elements in an HTML document, e.g.,<p>,<h1>,<a>.What is the difference between HTML and HTML5?
HTML5 is the latest version, with new features like<video>,<audio>, and semantic elements like<header>and<article>.What is the purpose of the
DOCTYPEdeclaration?
It tells the browser which version of HTML is being used.What is a semantic element in HTML?
Semantic elements clearly describe their meaning, e.g.,<article>,<footer>,<section>.What is the difference between
<div>and<span>?<div>is a block-level element, while<span>is an inline element.What are void elements in HTML?
Elements that don’t require a closing tag, e.g.,<br>,<img>,<input>.What is the difference between
idandclassattributes?idis unique, whileclasscan be used multiple times.What is the difference between relative and absolute URLs?
A relative URL is based on the current document, while an absolute URL includes the full address.What is the
altattribute in an<img>tag?
It provides alternative text for accessibility and SEO.
CSS (Cascading Style Sheets)
What is CSS?
CSS styles HTML elements to enhance visual presentation.What are the different types of CSS?
- Inline CSS (
style="color: red;") - Internal CSS (
<style> ... </style>) - External CSS (
<link rel="stylesheet" href="styles.css">)
- Inline CSS (
What is the difference between
em,rem, andpxin CSS?px: Fixed sizeem: Relative to the parent elementrem: Relative to the root element
What is Flexbox in CSS?
A layout module that makes designing responsive layouts easier.What is the difference between
position: relative;andposition: absolute;?relative: Moves the element relative to its normal position.absolute: Moves the element relative to its nearest positioned ancestor.
What are pseudo-classes in CSS?
Special selectors that style elements in a specific state, e.g.,:hover,:nth-child(n).What is the difference between
visibility: hidden;anddisplay: none;?visibility: hidden;hides the element but retains space.display: none;removes the element from the layout.
What is Grid in CSS?
A layout system that provides a two-dimensional grid-based layout.What is the
z-indexproperty?
It defines the stack order of elements.What is the difference between
max-widthandmin-widthin CSS?max-width: Sets the maximum width.min-width: Sets the minimum width.
JavaScript
What is JavaScript?
A scripting language used for web development.What are JavaScript data types?
- Primitive:
string,number,boolean,null,undefined,symbol,bigint - Non-primitive:
object,array,function
- Primitive:
What is the difference between
let,var, andconst?var: Function-scoped, can be redeclared.let: Block-scoped, cannot be redeclared.const: Block-scoped, cannot be reassigned.
What is an arrow function in JavaScript?
A concise syntax for writing functions:const add = (a, b) => a + b;What is event bubbling?
When an event on a child element propagates to its parent.What is the difference between
==and===?==compares values (loose equality).===compares values and types (strict equality).
What is the
thiskeyword in JavaScript?
Refers to the object it belongs to.What is closure in JavaScript?
A function that remembers the scope in which it was created.What is the difference between synchronous and asynchronous JavaScript?
- Synchronous: Executes line by line.
- Asynchronous: Uses callbacks, promises, and
async/await.
What is a promise in JavaScript?
A way to handle asynchronous operations.
Frontend Frameworks
What is React?
A JavaScript library for building user interfaces.What is JSX?
A syntax extension for writing HTML inside JavaScript.What are React hooks?
Functions that allow state and lifecycle features in functional components.What is Angular?
A TypeScript-based framework for building web applications.What is Vue.js?
A progressive JavaScript framework for building UI.
Backend Development
What is Node.js?
A JavaScript runtime for backend development.What is Express.js?
A web framework for Node.js.What is a REST API?
An API that follows REST principles.What is GraphQL?
A query language for APIs.What is JWT (JSON Web Token)?
A secure way to transmit authentication data.
Database & Deployment
What is the difference between SQL and NoSQL?
- SQL: Structured databases like MySQL, PostgreSQL.
- NoSQL: Unstructured databases like MongoDB.
What is an ORM?
Object-Relational Mapping, a way to interact with databases.What is Docker?
A tool for containerizing applications.What is CI/CD?
Continuous Integration and Continuous Deployment.What is Web Hosting?
Storing website files on a server.
Security & Performance
What is HTTPS?
A secure version of HTTP.What is XSS (Cross-Site Scripting)?
An attack where hackers inject malicious scripts.What is SQL Injection?
A hacking technique to manipulate databases.What is CORS?
A security feature that restricts resource sharing across origins.What is Lazy Loading?
Deferring loading of non-essential resources.
JavaScript Advanced Concepts
What is a higher-order function in JavaScript?
A function that takes another function as an argument or returns a function.What is the difference between
map(),filter(), andreduce()in JavaScript?map(): Returns a new array after applying a function to each element.filter(): Returns a new array with elements that satisfy a condition.reduce(): Reduces an array to a single value.
What is the difference between local storage, session storage, and cookies?
- Local Storage: Stores data permanently.
- Session Storage: Data is removed when the browser is closed.
- Cookies: Stores small data sent between the browser and server.
What is debouncing in JavaScript?
A technique that delays function execution to optimize performance.What is throttling in JavaScript?
Limits function execution to a fixed time interval.What is the difference between synchronous and asynchronous code?
- Synchronous: Executes line by line.
- Asynchronous: Uses callbacks, promises, or
async/awaitto run non-blocking operations.
What is the difference between
call(),apply(), andbind()in JavaScript?call(): Calls a function with arguments separately.apply(): Calls a function with arguments in an array.bind(): Returns a new function with a fixedthisvalue.
What is
async/awaitin JavaScript?
A syntax for writing asynchronous code in a synchronous style.What is the event loop in JavaScript?
A mechanism that handles asynchronous code execution.What is a Web Worker in JavaScript?
A way to run scripts in background threads.
React.js
What are React components?
Reusable pieces of UI built using JavaScript.What are functional and class components in React?
- Functional components: Simple, stateless components using functions.
- Class components: More complex, stateful components using ES6 classes.
What is the virtual DOM in React?
A lightweight representation of the real DOM that updates efficiently.What is state in React?
Data that changes over time within a component.What is the difference between props and state in React?
- Props: Immutable data passed from a parent component.
- State: Mutable data managed inside a component.
What is React Router?
A library for handling navigation in React applications.What is Redux?
A state management library for React applications.What is the
useEffecthook in React?
It allows side effects like data fetching in functional components.What is the
useStatehook in React?
A hook that allows state management in functional components.What is React Context API?
A way to manage global state without using Redux.
Backend Development (Node.js & Express.js)
What is middleware in Express.js?
Functions that run before request handlers.What is the difference between REST and SOAP APIs?
- REST: Uses JSON, lightweight, stateless.
- SOAP: Uses XML, more secure but heavier.
What is MongoDB?
A NoSQL database used for storing JSON-like data.What is Mongoose?
An ODM (Object-Document Mapping) library for MongoDB in Node.js.What is SQL indexing?
A technique to speed up database queries.What is an API endpoint?
A specific URL where a client interacts with a server.What is WebSocket?
A protocol for real-time, bidirectional communication.What is OAuth?
An authentication protocol for secure API access.What is bcrypt used for in web development?
Hashing passwords securely.What is the difference between GET and POST methods?
- GET: Retrieves data from a server.
- POST: Sends data to a server.
Performance Optimization
What is lazy loading in web development?
Loading images and resources only when needed.What is a Content Delivery Network (CDN)?
A network of servers that deliver content faster based on user location.What is minification in web development?
Removing unnecessary characters from code to reduce file size.What is caching in web development?
Storing data temporarily to speed up future requests.What is critical rendering path?
The process of converting HTML, CSS, and JavaScript into pixels on the screen.What is the difference between first paint and first meaningful paint?
- First Paint: First pixel is rendered.
- First Meaningful Paint: Main content is visible.
What are WebP images?
A modern image format that reduces file size while maintaining quality.What is Gzip compression?
A method to reduce file size for faster web performance.What is tree shaking in JavaScript?
A technique to remove unused code from a project.What is the Lighthouse tool?
A Google tool for web performance auditing.
Security in Web Development
What is Cross-Site Request Forgery (CSRF)?
An attack where a user is tricked into submitting unauthorized requests.What is Content Security Policy (CSP)?
A security measure to prevent malicious scripts from loading.What is HTTPS and why is it important?
A secure version of HTTP that encrypts data transmission.What is a Same-Origin Policy (SOP)?
A security feature that prevents scripts from different origins from accessing each other.What is a security header in web development?
HTTP headers that enhance website security (e.g.,X-Frame-Options).What is a DDoS attack?
A cyberattack that floods a website with traffic to make it unavailable.What is SQL injection?
An attack where hackers insert malicious SQL queries.What is role-based access control (RBAC)?
A security mechanism that grants permissions based on user roles.What is two-factor authentication (2FA)?
An additional layer of security requiring a second verification step.What is an SSL certificate?
A digital certificate that encrypts data and secures website communication.