Questions: Web Technologies
Back to Topics List

Web Technologies Questions

Page 5 of 13 (Displaying Questions 401 – 500 of 1207 Total)

401. What is the purpose of the `WebDriver` protocol?

Show Answer

A standard protocol that defines a platform- and language-neutral interface for controlling the behavior of web browsers, primarily used for automated testing.

Added: Nov 30, 2025

402. What is the difference between unit testing and integration testing?

Show Answer

Unit testing verifies individual components or functions in isolation. Integration testing verifies that different parts of the application work together correctly.

Added: Nov 30, 2025

403. What is the concept of a Mock object in testing?

Show Answer

A test-doubles object used to replace a real dependency (like a function or module) to control its behavior and track how it is called during a test.

Added: Nov 30, 2025

404. Explain the purpose of the `CI/CD` pipeline.

Show Answer

Continuous Integration (CI) and Continuous Delivery/Deployment (CD) are practices that automate the building, testing, and deployment of software changes.

Added: Nov 30, 2025

405. What is an `A/B test` in web development?

Show Answer

An experiment where two versions (A and B) of a webpage or feature are shown to users to determine which version performs better against a defined metric (e.g., conversion rate).

Added: Nov 30, 2025

406. What is the concept of `dark launching`?

Show Answer

A deployment technique where a new feature is deployed to production but remains hidden or inaccessible to users, allowing developers to monitor its performance and stability in a real environment.

Added: Nov 30, 2025

407. What are `feature flags` (or feature toggles)?

Show Answer

A software development technique that allows you to turn a feature on or off dynamically without deploying new code, enabling safe testing and phased rollouts.

Added: Nov 30, 2025

408. What is the role of `WebGPU`?

Show Answer

A new web API that exposes the capabilities of modern GPU hardware for high-performance graphics and computation, succeeding WebGL.

Added: Nov 30, 2025

409. Explain the concept of `WebTransport`.

Show Answer

A new API designed for bidirectional client-server data transfer, offering a low-latency, multiplexed experience over HTTP/3 (QUIC).

Added: Nov 30, 2025

410. What are `Signed Exchanges (SXGs)`?

Show Answer

A method for content distributors (like Google) to distribute web content that is authenticated as if it came directly from the origin server, improving performance and privacy.

Added: Nov 30, 2025

411. What is `Declarative Shadow DOM`?

Show Answer

An enhancement that allows developers to include Shadow DOM content directly in the HTML markup, eliminating the need for JavaScript to create the Shadow Root, improving SSR performance.

Added: Nov 30, 2025

412. What is the `Shared Workers` API?

Show Answer

A type of Web Worker that can be accessed by multiple scripts from different windows, tabs, or iframes of the same origin, enabling shared logic and resource management.

Added: Nov 30, 2025

413. Explain the `Broadcast Channel API`.

Show Answer

A simple API that allows scripts from the same origin (in different tabs or windows) to communicate with each other by sending messages to a named channel.

Added: Nov 30, 2025

414. What is the `Battery Status API`?

Show Answer

An API that provides information about the system's battery charge level and charging status, allowing applications to conserve energy during low battery.

Added: Nov 30, 2025

415. What is the purpose of the `Web Share API`?

Show Answer

It allows web applications to share links, text, and files with other applications installed on the user's device, similar to native mobile sharing functionality.

Added: Nov 30, 2025

416. Explain the `Page Lifecycle API`.

Show Answer

An API that provides hooks for developers to observe and respond to various browser-initiated lifecycle states of a page (e.g., hidden, frozen, discarded).

Added: Nov 30, 2025

417. What is the `Device Memory API`?

Show Answer

An API that provides an estimation of the device's total RAM (in gigabytes), allowing sites to dynamically adjust the loading of resource-intensive features based on device capabilities.

Added: Nov 30, 2025

418. What is the `Web MIDI API`?

Show Answer

An API that allows web applications to interface with Musical Instrument Digital Interface (MIDI) devices connected to the user's computer.

Added: Nov 30, 2025

419. How do you check for browser feature support in JavaScript?

Show Answer

By using feature detection: checking for the existence of an object, property, or method associated with the desired feature (e.g., `if ('Worker' in window)`).

Added: Nov 30, 2025

420. What is the `URL.createObjectURL()` method used for?

Show Answer

It creates a DOMString containing a unique URL representing the object (typically a File or Blob) passed in the parameter, used to display or handle local data.

Added: Nov 30, 2025

421. What is the `document.head` property?

Show Answer

A read-only property that returns the `<head>` element of the current document, or `null` if it doesn't exist.

Added: Nov 30, 2025

422. What is the `document.scrollingElement` property?

Show Answer

A read-only property that returns a reference to the element that scrolls the document (either `<html>` or `<body>`).

Added: Nov 30, 2025

423. What is the difference between `getBoundingClientRect()` and properties like `offsetWidth`?

Show Answer

`getBoundingClientRect()` returns the size and position of an element relative to the viewport. `offsetWidth` returns the layout width of the element, including border and padding, regardless of the viewport.

Added: Nov 30, 2025

424. How do you prevent a form from submitting but still validate it?

Show Answer

Use `event.preventDefault()` in the submit handler, then manually run validation logic, and only submit via JavaScript if validation passes.

Added: Nov 30, 2025

425. What are `named capture groups` in regular expressions?

Show Answer

A feature allowing parts of the match to be named (e.g., `(?<name>pattern)`) instead of relying solely on numeric indexes, improving readability and maintainability.

Added: Nov 30, 2025

426. What are `lookarounds` in regular expressions?

Show Answer

Zero-width assertions that check for the presence of a pattern before (lookbehind) or after (lookahead) the current position without including it in the match.

Added: Nov 30, 2025

427. How does `String.prototype.replaceAll()` work?

Show Answer

A modern method that replaces all occurrences of a string or regular expression match within a string, eliminating the need for a global flag (`/g`) with strings.

Added: Nov 30, 2025

428. What is the purpose of the `at()` method for Arrays and Strings?

Show Answer

It allows access to an element or character at a specific index, supporting negative indexing to count from the end of the array or string.

Added: Nov 30, 2025

429. What is `Array.prototype.flat()` used for?

Show Answer

It creates a new array with all sub-array elements recursively concatenated up to a specified depth (default is 1).

Added: Nov 30, 2025

430. How does `Array.prototype.flatMap()` work?

Show Answer

It maps each element using a mapping function, then flattens the result into a new array. It is equivalent to a `map()` followed by `flat(1)`.

Added: Nov 30, 2025

431. What are the benefits of using a `Set` object?

Show Answer

Sets store unique values of any type, are useful for removing duplicates from arrays, and provide efficient O(1) membership testing (`.has()`).

Added: Nov 30, 2025

432. What are `private class fields` in JavaScript?

Show Answer

Class fields (properties or methods) that are prefixed with `#` and are truly inaccessible from outside the class body, enforcing encapsulation.

Added: Nov 30, 2025

433. Explain the purpose of the `constructor` method in a JavaScript class.

Show Answer

A special method for creating and initializing an object created with a class. It is called automatically when the class is instantiated with `new`.

Added: Nov 30, 2025

434. What are `static` methods in a JavaScript class?

Show Answer

Methods defined on the class itself rather than on instances of the class. They are often used for utility functions related to the class.

Added: Nov 30, 2025

435. How do you create a promise that rejects after a certain timeout?

Show Answer

By using `Promise.race()` with the original promise and a second promise that rejects using `setTimeout`.

Added: Nov 30, 2025

436. What is a `Microtask Queue`?

Show Answer

A queue where microtasks (like Promise callbacks and `queueMicrotask` calls) are placed. It is processed immediately after the main call stack is empty and before the next macrotask.

Added: Nov 30, 2025

437. What is the difference between a `Macrotask` and a `Microtask`?

Show Answer

Macrotasks (e.g., `setTimeout`, I/O, event listeners) execute one at a time per loop cycle. Microtasks (e.g., Promises, MutationObserver) execute all at once after a macrotask and before the next macrotask.

Added: Nov 30, 2025

438. What is the `queueMicrotask()` method?

Show Answer

A modern, optimized way to explicitly schedule a function to be run on the microtask queue, ensuring it executes as soon as the current script finishes and before any new rendering or macrotasks.

Added: Nov 30, 2025

439. Explain the concept of `Monorepo` architecture.

Show Answer

A version-control repository that holds the code for many distinct projects or applications, often managed by a single tool like Lerna or Nx.

Added: Nov 30, 2025

440. What is the role of the `npm audit` command?

Show Answer

It scans the project dependencies for known security vulnerabilities and provides remediation advice, often recommending version updates.

Added: Nov 30, 2025

441. What is the JavaScript `Intl.DateTimeFormat` API used for?

Show Answer

It provides a way to format dates and times according to the rules of a specific locale, handling time zones and calendar systems.

Added: Nov 30, 2025

442. Explain the purpose of the `Intl.RelativeTimeFormat` API.

Show Answer

It is used to format relative time strings in a linguistically appropriate manner (e.g., "in 3 days" vs. "3 days ago") based on the locale.

Added: Nov 30, 2025

443. What is Unicode and why is it important for web internationalization?

Show Answer

Unicode is a standard that assigns a unique number to every character across all written languages, ensuring consistent rendering of text globally.

Added: Nov 30, 2025

444. What are Bidirectional (BiDi) issues and how are they addressed in HTML/CSS?

Show Answer

BiDi issues involve correctly rendering text that mixes right-to-left (RTL, e.g., Arabic) and left-to-right (LTR, e.g., English) languages, primarily addressed using the `dir` attribute and CSS `direction` and `unicode-bidi` properties.

Added: Nov 30, 2025

445. What is the `Content-Language` HTTP header?

Show Answer

It describes the language(s) intended for the audience of the returned content, used by search engines and browsers.

Added: Nov 30, 2025

446. Explain the concept of `plurals` in i18n.

Show Answer

Handling plurals means providing different text strings based on the quantity of a number, as plural rules vary significantly across languages (e.g., zero, one, few, many, other).

Added: Nov 30, 2025

447. What is the purpose of the `WebXR Device API`?

Show Answer

A set of standards that enables web applications to interface with augmented reality (AR) and virtual reality (VR) devices.

Added: Nov 30, 2025

448. What is the `WebUSB API` used for?

Show Answer

It allows web pages to safely and securely communicate with USB devices connected to the user's computer.

Added: Nov 30, 2025

449. Explain the `Web Bluetooth API`.

Show Answer

An API that allows web pages to connect and communicate with Bluetooth Low Energy (BLE) devices near the user.

Added: Nov 30, 2025

450. What is the `Web Serial API`?

Show Answer

It allows websites to read from and write to serial ports, enabling communication with microcontrollers and industrial equipment.

Added: Nov 30, 2025

451. How does the `Web Share Target API` work?

Show Answer

It allows PWAs to register as a share target, enabling other applications (native or web) to share data (text, links, files) with the PWA.

Added: Nov 30, 2025

452. What is the `Payment Request API`?

Show Answer

A standardized browser API that provides a consistent and user-friendly interface for payment flow, simplifying the checkout process.

Added: Nov 30, 2025

453. What is the role of the `Credential Management API`?

Show Answer

It allows websites to programmatically store and retrieve credentials (passwords, federated logins) to manage user sign-in securely and seamlessly.

Added: Nov 30, 2025

454. What is the `Fullscreen API`?

Show Answer

An API that provides methods to programmatically present an element (or the entire document) in fullscreen mode, often used for videos or games.

Added: Nov 30, 2025

455. Explain the `Prioritized Task Scheduling API`.

Show Answer

A draft standard that provides a way to prioritize and schedule work, ensuring that critical user-facing tasks (like animation) run before lower-priority background tasks.

Added: Nov 30, 2025

456. What are `CSS Custom Highlighting API`s (e.g., `::selection`)?

Show Answer

APIs that allow developers to define the look and feel of text ranges using CSS, such as the color and background of selected text.

Added: Nov 30, 2025

457. What is the importance of the `user-scalable=no` meta tag and why is it discouraged?

Show Answer

It prevents users from zooming the page. It is discouraged as it negatively impacts accessibility for users who rely on zooming to read content.

Added: Nov 30, 2025

458. How do you define different fonts for print versus screen?

Show Answer

Using the `@media print` query in CSS to apply specific styles, including `@font-face` definitions, only when the document is being printed.

Added: Nov 30, 2025

459. Explain the CSS property `object-fit`.

Show Answer

It specifies how an `<img>` or `<video>` should be resized to fit its container, often using values like `contain`, `cover`, or `fill`.

Added: Nov 30, 2025

460. What is the difference between `:focus` and `:focus-visible`?

Show Answer

`:focus` styles an element whenever it has focus. `:focus-visible` styles it only when the focus is gained via keyboard navigation or a mechanism that suggests visibility is helpful.

Added: Nov 30, 2025

461. What is the purpose of the `forced-colors` media query?

Show Answer

It allows authors to adapt their content styles when the user has enabled a limited color palette mode (e.g., High Contrast mode on Windows).

Added: Nov 30, 2025

462. What is the CSS `initial-letter` property?

Show Answer

A property used to set the size and sinking of the first letter of a paragraph, allowing for magazine-style drop caps.

Added: Nov 30, 2025

463. Explain the concept of an `Accessibility Tree`.

Show Answer

A parallel structure to the DOM tree that browsers create, containing only objects relevant to accessibility, which is read by assistive technologies like screen readers.

Added: Nov 30, 2025

464. What is the `alt` attribute required for, beyond screen readers?

Show Answer

It is used by search engines to understand image content and is displayed in the browser if the image file fails to load.

Added: Nov 30, 2025

465. How do you create an accessible carousel component?

Show Answer

Ensure it is keyboard-navigable, provides clear labels (e.g., using `aria-label` or `aria-labelledby`), and stops auto-playing when focused.

Added: Nov 30, 2025

466. What is the `aria-live` attribute?

Show Answer

An ARIA attribute used to indicate that an element's content is likely to change dynamically and should be read aloud by a screen reader.

Added: Nov 30, 2025

467. What is TCP Slow Start?

Show Answer

A congestion control algorithm used by TCP where the rate of sending data increases exponentially at the beginning of a connection to probe the network's capacity.

Added: Nov 30, 2025

468. Explain the concept of connection pooling.

Show Answer

A technique used by application servers to maintain a cache of open database connections for reuse, reducing the overhead of repeatedly establishing new connections.

Added: Nov 30, 2025

469. What is ALPN (Application-Layer Protocol Negotiation)?

Show Answer

A TLS extension that allows the application layer to negotiate which protocol (e.g., HTTP/1.1, HTTP/2, HTTP/3) will be used over the secure connection.

Added: Nov 30, 2025

470. How does HTTP/3 (QUIC) address Head-of-Line Blocking?

Show Answer

Since QUIC streams are independent and mapped over UDP, the loss of one packet only affects the specific stream it belongs to, not the others, eliminating HOL blocking at the transport layer.

Added: Nov 30, 2025

471. What is the purpose of a TLS certificate?

Show Answer

It cryptographically links a public key to an organization's identity, proving the website is secure and verifying the server to the client.

Added: Nov 30, 2025

472. What is the `Timing-Allow-Origin` HTTP header?

Show Answer

A header used to explicitly allow cross-origin access to resource timing metrics retrieved via the Performance API.

Added: Nov 30, 2025

473. What is the browser's `Compositor`?

Show Answer

A component responsible for taking the different layers (from the rendering tree) and composing them into a final image on the screen, often using the GPU.

Added: Nov 30, 2025

474. Explain the concept of `Layering` in browser rendering.

Show Answer

The browser organizes elements into separate layers (e.g., for elements with `transform` or `will-change`) to allow for independent painting and compositing, which improves animation performance.

Added: Nov 30, 2025

475. What is the difference between `Reflow` (Layout) and `Repaint` (Paint)?

Show Answer

Reflow calculates the position and size of all elements in the DOM. Repaint only redraws the elements visible on the screen whose styles have changed (but not their geometry). Reflow is more expensive.

Added: Nov 30, 2025

476. How does `transform: translateZ(0)` force hardware acceleration?

Show Answer

It tricks the browser into creating a new compositing layer for the element, which allows the GPU to handle the rendering of that layer, often leading to smoother animations.

Added: Nov 30, 2025

477. What are `Microformats`?

Show Answer

A set of simple, open data formats built upon existing HTML standards, used to tag human-readable data (like events, contacts) so machines can easily parse it.

Added: Nov 30, 2025

478. What is the `Command Pattern` in JavaScript?

Show Answer

A behavioral design pattern that turns a request into a stand-alone object (command), containing all information about the request, allowing for parameterization, queuing, or logging of operations.

Added: Nov 30, 2025

479. Explain the `Strategy Pattern`.

Show Answer

A behavioral design pattern that defines a family of algorithms, encapsulates each one, and makes them interchangeable, allowing the algorithm to vary independently from clients that use it.

Added: Nov 30, 2025

480. What is the `Adapter Pattern`?

Show Answer

A structural design pattern that allows the interface of an existing class to be used as another interface, making two incompatible interfaces work together.

Added: Nov 30, 2025

481. What is the `Model-View-Presenter (MVP)` pattern?

Show Answer

An architectural pattern (similar to MVC) that uses a Presenter to intermediate between the Model and the View, with the Presenter responsible for handling the application logic.

Added: Nov 30, 2025

482. What are `Higher-Order Components (HOCs)`?

Show Answer

A pattern in component-based architectures where a function takes a component as an argument and returns a new component with enhanced functionality.

Added: Nov 30, 2025

483. Explain the concept of `Inversion of Control (IoC)`.

Show Answer

A design principle where the control of object creation and lifecycle is shifted from the developer's code to a container or framework, enabling dependency injection.

Added: Nov 30, 2025

484. What is the `CSS Containment` specification?

Show Answer

A set of properties (`contain: layout`, `style`, `size`, `paint`) that explicitly tell the browser that an element's rendering is independent, allowing for aggressive optimization.

Added: Nov 30, 2025

485. What is the CSS property `font-display`?

Show Answer

A property used with `@font-face` to determine how a font face is displayed based on whether and when it is downloaded and ready to use, helping manage FOIT/FOUT.

Added: Nov 30, 2025

486. Explain the difference between FOIT (Flash of Invisible Text) and FOUT (Flash of Unstyled Text).

Show Answer

FOIT is when the text is hidden until the custom font loads. FOUT is when the text is displayed using a fallback font, and then switched to the custom font once it loads.

Added: Nov 30, 2025

487. What is the CSS `system-ui` font?

Show Answer

A generic font family keyword that represents the default user interface font of the operating system, often used to make web pages feel more native.

Added: Nov 30, 2025

488. How do you create a simple image gallery that supports native browser drag-to-dismiss?

Show Answer

By using CSS `scroll-snap` properties (e.g., `scroll-snap-type: x mandatory;`) on a horizontally scrolling container.

Added: Nov 30, 2025

489. What is the purpose of the `aria-owns` attribute?

Show Answer

An ARIA attribute used to indicate that one element is owned or logically grouped by another, especially when the elements are not structurally nested in the DOM.

Added: Nov 30, 2025

490. What is the `DOMPurify` library used for?

Show Answer

A fast, secure, and widely used library for sanitizing HTML, preventing Cross-Site Scripting (XSS) attacks by safely removing malicious code.

Added: Nov 30, 2025

491. Explain the `Passive Event Listener` feature in JavaScript.

Show Answer

Setting `{ passive: true }` on touch or wheel event listeners to inform the browser that the handler will *not* call `preventDefault()`, allowing scrolling to happen without delay.

Added: Nov 30, 2025

492. What is the `requestAnimationFrame` callback's relationship with the browser repaint cycle?

Show Answer

It is executed just before the browser performs its next repaint, ensuring that animations are synchronized with the display's refresh rate for maximum smoothness.

Added: Nov 30, 2025

493. How do you create a Promise that times out if not resolved quickly?

Show Answer

By using `Promise.race()` with the original promise and a second promise that rejects after a set time delay via `setTimeout`.

Added: Nov 30, 2025

494. What is the difference between `queueMicrotask()` and `setTimeout(fn, 0)`?

Show Answer

`queueMicrotask()` executes the function on the microtask queue (ASAP). `setTimeout(fn, 0)` executes it on the macrotask queue (after all microtasks and the next tick).

Added: Nov 30, 2025

495. Explain the concept of `Referential Transparency` in functional programming.

Show Answer

A property of an expression that can be replaced by its corresponding value without changing the program's behavior. It requires the use of pure functions.

Added: Nov 30, 2025

496. What is `Function Composition`?

Show Answer

The process of combining two or more functions to produce a new function, where the output of one function becomes the input of the next.

Added: Nov 30, 2025

497. What is the JavaScript `pipeline operator` (currently a proposal)?

Show Answer

An operator (`|>`) that provides a fluent way to chain function calls by passing the result of one expression as an argument to the next function.

Added: Nov 30, 2025

498. What is the purpose of the `Proxy` handler trap `apply`?

Show Answer

A trap that intercepts calls to a function or constructor, allowing developers to implement custom logic before or after the function is executed.

Added: Nov 30, 2025

499. What are `Temporal Dead Zone (TDZ)` errors?

Show Answer

Errors that occur when trying to access a `let` or `const` variable between the start of its scope and the point where its declaration is processed.

Added: Nov 30, 2025

500. Explain the purpose of the `Array.prototype.at()` method.

Show Answer

A method that allows access to array elements using an index, which can be negative to count from the end of the array.

Added: Nov 30, 2025