Questions: Web Technologies
Back to Topics List

Web Technologies Questions

Page 2 of 13 (Displaying Questions 101 – 200 of 1207 Total)

101. What is a cookie?

Show Answer

A small piece of data stored on the user's computer by the web browser, often used for session management, user tracking, and personalization.

Added: Nov 30, 2025

102. What is an HTTP status code? Give two examples.

Show Answer

A three-digit code returned by a server in response to a request, indicating the result. Examples: 200 (OK), 404 (Not Found).

Added: Nov 30, 2025

103. What are localStorage and sessionStorage?

Show Answer

Client-side storage mechanisms. localStorage persists data until explicitly deleted. sessionStorage clears data when the browser tab is closed.

Added: Nov 30, 2025

104. What is Cross-Origin Resource Sharing (CORS)?

Show Answer

A browser security mechanism that allows web pages to request restricted resources from another domain outside the domain from which the first resource was served.

Added: Nov 30, 2025

105. What is rendering?

Show Answer

The process by which the browser takes the HTML, CSS, and JavaScript and displays the actual visual content on the screen.

Added: Nov 30, 2025

106. What is the role of the viewport meta tag?

Show Answer

It is essential for responsive design, instructing the browser on how to control the page's dimensions and scaling to match the device width.

Added: Nov 30, 2025

107. Explain the concept of Web Components.

Show Answer

A set of standards (Custom Elements, Shadow DOM, HTML Templates) that allow developers to create reusable, encapsulated custom HTML tags.

Added: Nov 30, 2025

108. What is Shadow DOM?

Show Answer

A way to attach a hidden, separate DOM tree to an element, encapsulating styles and markup so they don't interfere with the main document's DOM.

Added: Nov 30, 2025

109. What is the importance of using heading tags (H1-H6) correctly for SEO?

Show Answer

Headings provide structure and context, helping search engines understand the hierarchy and main topics of the content on the page.

Added: Nov 30, 2025

110. What is the difference between synchronous and asynchronous JavaScript loading?

Show Answer

Synchronous loading blocks page rendering until the script is fetched and executed. Asynchronous loading allows the browser to continue parsing the page while the script is loading.

Added: Nov 30, 2025

111. Explain the purpose of the <template> and <slot> elements.

Show Answer

<template> holds content that is not rendered immediately but can be instantiated later via script. <slot> is used within Web Components to define placeholders for content.

Added: Nov 30, 2025

112. What is the significance of the lang attribute on the <html> tag?

Show Answer

It declares the primary language of the document, which is important for accessibility, search engines, and browser translation features.

Added: Nov 30, 2025

113. How do you handle non-standard browser features or old browser compatibility in HTML/CSS?

Show Answer

Using polyfills (code that implements a missing feature) or shims (code that intercepts API calls to fix inconsistent behavior).

Added: Nov 30, 2025

114. What is form serialization?

Show Answer

The process of converting form data (key-value pairs) into a format that can be easily transmitted, typically JSON or URL-encoded strings.

Added: Nov 30, 2025

115. How does the browser determine the language for the user interface?

Show Answer

Based on the operating system's language settings and the Accept-Language HTTP header sent by the browser.

Added: Nov 30, 2025

116. What is a CSS preprocessor? Name two popular ones.

Show Answer

A tool that extends CSS with features like variables, nesting, and mixins, and compiles the enhanced code into standard CSS. Examples: Sass and LESS.

Added: Nov 30, 2025

117. Explain the Block, Element, Modifier (BEM) methodology.

Show Answer

A naming convention for CSS classes that aims to create independent, reusable components by structuring names as block-name__element-name--modifier-name.

Added: Nov 30, 2025

118. What is the difference between viewport width (vw) and viewport height (vh) units?

Show Answer

vw is 1% of the viewport width. vh is 1% of the viewport height. Both are useful for truly responsive sizing.

Added: Nov 30, 2025

119. How does the position: sticky property work?

Show Answer

The element is treated as relative until it reaches a specified scroll position within its container, after which it becomes fixed.

Added: Nov 30, 2025

120. Explain the concept of writing mode in CSS.

Show Answer

A property that defines whether text lines are laid out horizontally or vertically, and the direction in which successive lines are written.

Added: Nov 30, 2025

121. What is a CSS reset?

Show Answer

A collection of CSS rules that reset or normalize the styles of all HTML elements, providing a consistent baseline across different browsers.

Added: Nov 30, 2025

122. What is PostCSS?

Show Answer

A tool that uses JavaScript plugins to transform CSS code. It can be used for auto-prefixing, linting, and using future CSS syntax today.

Added: Nov 30, 2025

123. Describe the order of precedence for CSS properties.

Show Answer

Order is: Inline styles > IDs > Classes, Attributes, Pseudo-classes > Elements, Pseudo-elements. Important declarations (using !important) override all.

Added: Nov 30, 2025

124. How does the all property work in CSS?

Show Answer

It resets all CSS properties except for unicode-bidi, direction, and typically, properties handled by user-agent stylesheets.

Added: Nov 30, 2025

125. What is a CSS cascade layer?

Show Answer

A modern CSS feature (@layer) that allows explicit grouping of styles to control the cascade more predictably, independent of specificity and order.

Added: Nov 30, 2025

126. Explain the use of the @supports rule.

Show Answer

A conditional group rule (similar to @media) that checks if a browser supports a specific CSS property-value pair before applying the styles.

Added: Nov 30, 2025

127. What is the difference between grid-template-areas and grid-template-columns/rows?

Show Answer

grid-template-areas allows you to name grid cells to place items by name. grid-template-columns/rows defines the size and number of the grid tracks.

Added: Nov 30, 2025

128. What does justify-content do in Flexbox?

Show Answer

It aligns flex items along the main axis of the container (e.g., space-between, center).

Added: Nov 30, 2025

129. How do you deal with font size accessibility issues in CSS?

Show Answer

By using relative units like rem or em for font sizes instead of px, allowing users to scale the text through browser settings.

Added: Nov 30, 2025

130. What is the purpose of the outline property?

Show Answer

It draws a line outside the element's border to highlight it, often used to indicate focus (important for accessibility).

Added: Nov 30, 2025

131. Explain ES6 Modules (import/export).

Show Answer

A standardized way to organize code into reusable files. export makes functions/variables available externally, and import brings them into the current file.

Added: Nov 30, 2025

132. What is class syntax in JavaScript? Is it true class-based OOP?

Show Answer

It is syntactic sugar over JavaScript's existing prototype-based inheritance. It is not true class-based OOP like Java or C++.

Added: Nov 30, 2025

133. What are generator functions in JavaScript?

Show Answer

Functions defined with function* that can be paused and resumed, producing a sequence of results via the yield keyword.

Added: Nov 30, 2025

134. How does Promise.all() work?

Show Answer

It takes an array of promises and returns a single promise. This single promise resolves when all input promises have resolved, or rejects immediately if any one of the promises rejects.

Added: Nov 30, 2025

135. What are Web Workers and when should you use them?

Show Answer

Scripts executed in the background thread, separate from the main execution thread. Use them for heavy computations to avoid blocking the UI.

Added: Nov 30, 2025

136. Explain event delegation.

Show Answer

A technique where you attach a single event listener to a common ancestor instead of multiple listeners to individual elements, leveraging event bubbling.

Added: Nov 30, 2025

137. What is the difference between setTimeout and requestAnimationFrame?

Show Answer

setTimeout schedules code to run after a delay. requestAnimationFrame schedules code to run just before the browser's next repaint, optimized for smooth animations.

Added: Nov 30, 2025

138. What is method chaining?

Show Answer

A syntax that allows multiple methods to be called sequentially on the same object, where each method returns the object itself (this).

Added: Nov 30, 2025

139. What is optional chaining and the nullish coalescing operator?

Show Answer

Optional chaining (?.) allows safe access to deeply nested object properties. Nullish coalescing (??) provides a default value only if the evaluated expression is null or undefined.

Added: Nov 30, 2025

140. Explain the concept of immutability.

Show Answer

The principle that once an object is created, it cannot be changed. In JavaScript, this usually means creating new data structures rather than modifying existing ones.

Added: Nov 30, 2025

141. What is the difference between Array.slice() and Array.splice()?

Show Answer

slice() returns a shallow copy of a portion of an array (non-mutating). splice() changes the contents of an array by removing or replacing existing elements (mutating).

Added: Nov 30, 2025

142. How do you implement inheritance using ES6 classes?

Show Answer

Using the extends keyword to create a subclass and the super() keyword inside the subclass constructor to call the parent class constructor.

Added: Nov 30, 2025

143. What are JavaScript Symbols?

Show Answer

A unique and immutable data type often used to add unique property keys to an object that won't collide with keys from other code.

Added: Nov 30, 2025

144. Explain the process of shadowing in variables.

Show Answer

Declaring a variable in an inner scope that has the same name as a variable in an outer scope. The inner variable "shadows" the outer one within its context.

Added: Nov 30, 2025

145. What is the main benefit of using Promises over traditional callbacks?

Show Answer

Promises avoid "callback hell" by allowing cleaner, sequential, and catchable error handling through method chaining (.then().catch()).

Added: Nov 30, 2025

146. What is the difference between HTTP/1.1 and HTTP/2?

Show Answer

HTTP/2 is binary, multiplexed (sends multiple requests/responses over one connection), and supports header compression and server push, making it much faster.

Added: Nov 30, 2025

147. Explain browser caching. What are the key cache headers?

Show Answer

The process of storing copies of resources locally (client-side) to speed up future requests. Key headers include Cache-Control and Expires.

Added: Nov 30, 2025

148. What is Cross-Site Scripting (XSS)? How is it prevented?

Show Answer

A security vulnerability that allows attackers to inject malicious client-side scripts into web pages viewed by other users. Prevented by input validation and output encoding.

Added: Nov 30, 2025

149. What is Cross-Site Request Forgery (CSRF)?

Show Answer

An attack that forces an end-user to execute unwanted actions on a web application in which they are currently authenticated.

Added: Nov 30, 2025

150. What is a Service Worker?

Show Answer

A type of Web Worker that acts as a proxy between the browser and the network, enabling features like offline capabilities, push notifications, and asset caching.

Added: Nov 30, 2025

151. How does a CDN (Content Delivery Network) improve performance?

Show Answer

It geographically distributes static assets (images, CSS, JS) closer to the end-user, reducing latency and load times.

Added: Nov 30, 2025

152. What is server-side rendering (SSR)?

Show Answer

The process where the server generates the full HTML for a page on each request, sending a fully rendered page to the client for faster initial load times.

Added: Nov 30, 2025

153. Explain the concept of Content Security Policy (CSP).

Show Answer

An HTTP security header that helps prevent XSS attacks by defining which sources of content (scripts, styles, images) are trusted and allowed to load.

Added: Nov 30, 2025

154. What is lazy loading?

Show Answer

A performance optimization technique that defers the loading of non-critical resources (like images or components) until they are actually needed (e.g., when they enter the viewport).

Added: Nov 30, 2025

155. What is the purpose of the Robots.txt file?

Show Answer

It instructs search engine crawlers (robots) which parts of a website they should or should not access and index.

Added: Nov 30, 2025

156. Explain the Critical Rendering Path (CRP).

Show Answer

The sequence of steps the browser takes to convert HTML, CSS, and JavaScript into pixels on the screen. Optimizing the CRP improves perceived page load speed.

Added: Nov 30, 2025

157. What are Core Web Vitals?

Show Answer

A set of real-world, user-centric metrics (Largest Contentful Paint, First Input Delay, Cumulative Layout Shift) that quantify key aspects of the user experience.

Added: Nov 30, 2025

158. What is Tree Shaking in JavaScript?

Show Answer

A form of dead code elimination that removes unused code from the final bundle when building an application, relying on ES6 module syntax.

Added: Nov 30, 2025

159. What is the benefit of HTTP compression (e.g., Gzip)?

Show Answer

It reduces the size of files (HTML, CSS, JS) transferred from the server to the client, significantly reducing network latency and improving load times.

Added: Nov 30, 2025

160. How do you measure First Contentful Paint (FCP)?

Show Answer

It is measured as the time from navigation to the time when the browser renders the first bit of content from the DOM.

Added: Nov 30, 2025

161. Explain resource hinting (prefetch, preload).

Show Answer

Techniques used to tell the browser which resources will be needed in the near future so it can start fetching them earlier, improving load performance.

Added: Nov 30, 2025

162. What is code splitting?

Show Answer

A technique used in bundlers (like Webpack) to split code into smaller chunks that can be loaded on demand or in parallel, reducing the initial payload size.

Added: Nov 30, 2025

163. What is render-blocking resource optimization?

Show Answer

Reducing or deferring CSS and JavaScript files that must be loaded and processed before the browser can start rendering the page content.

Added: Nov 30, 2025

164. What is the purpose of the srcset attribute on the <source> tag within <picture>?

Show Answer

It defines a set of different images and their sizes for the browser to choose the most appropriate one based on resolution and screen density.

Added: Nov 30, 2025

165. What is Time to Interactive (TTI)?

Show Answer

A performance metric that measures how long it takes for a page to become fully interactive, meaning the main thread is idle enough to handle user input.

Added: Nov 30, 2025

166. What is JSON Web Token (JWT)?

Show Answer

A compact, URL-safe means of representing claims (information) between two parties. It is commonly used for authorization and information exchange.

Added: Nov 30, 2025

167. Explain the concept of OAuth 2.0.

Show Answer

An authorization framework that enables third-party applications to obtain limited access to an HTTP service, either on behalf of a resource owner or by obtaining its own access.

Added: Nov 30, 2025

168. What is the purpose of the Strict-Transport-Security (HSTS) header?

Show Answer

A security header that forces the browser to only communicate with the server over HTTPS, preventing protocol downgrade attacks.

Added: Nov 30, 2025

169. How does the Same-Origin Policy (SOP) work?

Show Answer

It is a critical security mechanism that prevents documents or scripts loaded from one origin from interacting with resources from another origin.

Added: Nov 30, 2025

170. What is the SameSite cookie attribute?

Show Answer

A security attribute that controls whether cookies are sent along with cross-site requests, mitigating the risk of CSRF attacks.

Added: Nov 30, 2025

171. What is a man-in-the-middle (MITM) attack?

Show Answer

An attack where the attacker secretly relays and possibly alters the communication between two parties who believe they are directly communicating with each other.

Added: Nov 30, 2025

172. Explain the HTTPS handshake process briefly.

Show Answer

The process where the client and server agree on cryptographic keys and ciphers to establish a secure, encrypted connection via the SSL/TLS protocol.

Added: Nov 30, 2025

173. What is subresource integrity (SRI)?

Show Answer

A security feature that allows browsers to verify that resources fetched from third-party servers (like CDNs) have not been tampered with, using a cryptographic hash.

Added: Nov 30, 2025

174. What is the difference between path-based and domain-based routing?

Show Answer

Path-based routes resources based on the URL path. Domain-based routes resources based on the subdomain or entire domain name.

Added: Nov 30, 2025

175. What is fuzzing in web security?

Show Answer

A software testing technique that involves automatically providing invalid, unexpected, or random data inputs to a computer program to expose bugs and security flaws.

Added: Nov 30, 2025

176. What is REST (Representational State Transfer)?

Show Answer

An architectural style for building web services that uses standard HTTP methods (GET, POST, PUT, DELETE) to manipulate resources identified by URLs.

Added: Nov 30, 2025

177. How does GraphQL differ from REST?

Show Answer

GraphQL is a query language for your API that allows clients to request exactly the data they need, avoiding over-fetching or under-fetching, unlike fixed REST endpoints.

Added: Nov 30, 2025

178. What are WebSockets?

Show Answer

A communication protocol that provides full-duplex, persistent communication channels over a single TCP connection, ideal for real-time data exchange.

Added: Nov 30, 2025

179. Explain Server-Sent Events (SSE).

Show Answer

A mechanism that allows a server to push data to a client over a single persistent HTTP connection, suitable for one-way, server-to-client updates.

Added: Nov 30, 2025

180. What is API Gateway?

Show Answer

A single entry point for all clients, handling requests by routing them to appropriate backend services, often dealing with authentication, rate limiting, and monitoring.

Added: Nov 30, 2025

181. What is HATEOAS?

Show Answer

Hypermedia as the Engine of Application State, a constraint of REST architecture where resources contain links to related resources, guiding clients through the application.

Added: Nov 30, 2025

182. What is the idempotency principle of APIs?

Show Answer

An operation is idempotent if executing it multiple times yields the same result as executing it once (e.g., GET, PUT, DELETE are generally idempotent).

Added: Nov 30, 2025

183. What are microservices?

Show Answer

An architectural approach where a large application is structured as a collection of smaller, independent services, communicating with each other, often via APIs.

Added: Nov 30, 2025

184. How does HTTP request pipelining work?

Show Answer

A technique (largely superseded by HTTP/2) where multiple HTTP requests are sent over a single TCP connection without waiting for the respective responses.

Added: Nov 30, 2025

185. What is the function of WebRTC?

Show Answer

Web Real-Time Communication, an API that enables real-time voice, video, and data communication between peers directly in the browser without requiring plugins.

Added: Nov 30, 2025

186. Explain the Decorator pattern in JavaScript.

Show Answer

A design pattern that allows behavior to be added to an individual object, either statically or dynamically, without affecting the behavior of other objects from the same class.

Added: Nov 30, 2025

187. What are Proxy and Reflect in ES6?

Show Answer

Proxy allows you to create an object that can intercept and redefine fundamental operations (like property lookup). Reflect is a built-in object providing methods for those same operations.

Added: Nov 30, 2025

188. What is the Module pattern in JavaScript?

Show Answer

A traditional design pattern used to implement classes, modules, and encapsulation using closures to shield private properties and methods.

Added: Nov 30, 2025

189. Explain JavaScript Mixins.

Show Answer

A way of injecting properties and methods from one class into another without using inheritance, useful for sharing common functionality.

Added: Nov 30, 2025

190. What is Currying in functional JavaScript?

Show Answer

The technique of converting a function that takes multiple arguments into a sequence of functions, each taking a single argument.

Added: Nov 30, 2025

191. What is Tail Call Optimization (TCO)?

Show Answer

An optimization technique (though not widely implemented in browsers) where a recursive function call at the very end of a function avoids adding a new stack frame, preventing stack overflow.

Added: Nov 30, 2025

192. What are WeakMaps and WeakSets?

Show Answer

Collections similar to Map and Set, but their keys/elements are held weakly, meaning they do not prevent garbage collection if the only reference is held by the weak collection.

Added: Nov 30, 2025

193. What is the difference between let/const declarations and assigning properties to the global object?

Show Answer

let/const create variables in the global scope but do not create properties on the global object (window/globalThis), unlike variables declared with var or function.

Added: Nov 30, 2025

194. Explain the concept of memoization.

Show Answer

An optimization technique used to speed up computer programs by caching the results of expensive function calls and returning the cached result when the same inputs occur again.

Added: Nov 30, 2025

195. What is property accessors (getters and setters) in JavaScript?

Show Answer

Special methods defined on objects that look like properties when accessed but execute code when read (get) or written (set).

Added: Nov 30, 2025

196. What are CSS Logical Properties?

Show Answer

Properties that define layout relative to the flow of content (e.g., writing direction) rather than physical directions (top/left/right/bottom), improving internationalization.

Added: Nov 30, 2025

197. What is CSS Subgrid?

Show Answer

A feature in CSS Grid that allows a nested grid to inherit the track definition (columns or rows) from its immediate parent grid, aligning items across complex layouts.

Added: Nov 30, 2025

198. Explain the use of the `contain` CSS property.

Show Answer

It tells the browser that an element's subtree is independent of the rest of the page, allowing the browser to apply optimizations and avoid recalculating the layout of the entire page.

Added: Nov 30, 2025

199. What are Viewport APIs in CSS?

Show Answer

New units (like dvw, dvh, svw, lvh) that account for dynamic browser toolbars on mobile devices, providing more stable viewport measurements.

Added: Nov 30, 2025

200. What is the significance of color contrast ratios in CSS and accessibility?

Show Answer

The contrast ratio ensures that text is sufficiently legible against its background for users with low vision or color blindness, mandated by WCAG guidelines.

Added: Nov 30, 2025