Questions: Web Technologies
Back to Topics List

Web Technologies Questions

Page 6 of 13 (Displaying Questions 501 – 600 of 1207 Total)

501. What is the `SameSite=Strict` cookie attribute?

Show Answer

A policy that prevents the cookie from being sent by the browser with any cross-site request, only allowing it on the top-level navigation from the site itself.

Added: Nov 30, 2025

502. How do you prevent caching of a specific response?

Show Answer

By setting `Cache-Control: no-store, no-cache` and `Pragma: no-cache` HTTP response headers.

Added: Nov 30, 2025

503. What is the difference between an opaque and a non-opaque cross-origin response in Service Workers?

Show Answer

An opaque response is a resource fetched from another origin with CORS disabled; its content cannot be inspected, protecting against information leakage.

Added: Nov 30, 2025

504. What is the `Stale-While-Revalidate` caching strategy?

Show Answer

A strategy where the cache serves the stored response immediately (stale), while an asynchronous request is made to the network to update the cached version (revalidate).

Added: Nov 30, 2025

505. How is a `Cache-Control: public` header used?

Show Answer

It indicates that the response may be cached by any cache, including those used by multiple users (e.g., CDNs or proxy servers).

Added: Nov 30, 2025

506. What is the purpose of the `Vary` HTTP header?

Show Answer

It tells caches that the server response varies based on the specified request headers (e.g., `Vary: Accept-Encoding`), so that clients receive the correct cached version.

Added: Nov 30, 2025

507. Explain the concept of `Edge Computing` in web architecture.

Show Answer

Processing data closer to the user (at the network edge, e.g., on a CDN or edge server) rather than in a centralized cloud, reducing latency and improving responsiveness.

Added: Nov 30, 2025

508. What is `Web Hooks`?

Show Answer

A mechanism for an application to provide information to other applications in real-time, sending data to a specified URL whenever a specific event occurs.

Added: Nov 30, 2025

509. What is the `Web Streams API`?

Show Answer

An API that allows JavaScript to process data (received from the network or a local source) sequentially and chunk by chunk, often used for performance optimization in I/O operations.

Added: Nov 30, 2025

510. What is the role of `WebAssembly System Interface (WASI)`?

Show Answer

A standardized system interface for WebAssembly, allowing Wasm code to run outside the browser (e.g., on a server or embedded device) with access to operating system resources.

Added: Nov 30, 2025

511. Explain the concept of `Server Components` (as seen in React/Next.js).

Show Answer

A paradigm shift where some UI components are rendered entirely on the server, resulting in faster initial page loads and smaller client-side bundles.

Added: Nov 30, 2025

512. What is the `Web Platform Baseline`?

Show Answer

A collaborative effort between browser vendors to identify web features that are safe to use across all major browsers, ensuring developers can rely on them.

Added: Nov 30, 2025

513. What is the difference between `WebRTC` Data Channels and Media Streams?

Show Answer

Data Channels transfer arbitrary data (text, binary). Media Streams handle audio and video data, allowing for real-time communication.

Added: Nov 30, 2025

514. What is the purpose of `STUN` and `TURN` servers in WebRTC?

Show Answer

STUN (Session Traversal Utilities for NAT) helps peers discover their public IP/port. TURN (Traversal Using Relays around NAT) is a relay server used when direct peer-to-peer connection is impossible.

Added: Nov 30, 2025

515. Explain the concept of `Homomorphic Encryption` in web security.

Show Answer

A form of encryption that allows computations to be performed on ciphertext, resulting in an encrypted result that, when decrypted, matches the result of computations on the plaintext.

Added: Nov 30, 2025

516. What is a `security bug bounty` program?

Show Answer

A crowdsourced initiative where individuals are invited to find and report vulnerabilities in an application in exchange for recognition and a monetary reward.

Added: Nov 30, 2025

517. What is the `Feature-Policy` (now `Permissions-Policy`) HTTP header?

Show Answer

A security header that allows a site to explicitly enable or disable the use of various browser features and APIs (e.g., geolocation, camera) for its own frame and any embedded iframes.

Added: Nov 30, 2025

518. What is `WebIDL`?

Show Answer

Web Interface Definition Language, a language used to define the interfaces of web APIs in a standardized, language-agnostic way.

Added: Nov 30, 2025

519. Explain the concept of `Type Coercion` in JavaScript.

Show Answer

The automatic or implicit conversion of values from one data type to another (e.g., converting a number to a string) during operations or comparisons.

Added: Nov 30, 2025

520. What is the purpose of `Object.is()`?

Show Answer

A method that determines whether two values are the same value, providing a stricter equality check than `===` for cases involving `NaN` and `+0`/`-0`.

Added: Nov 30, 2025

521. What is the JavaScript `for await...of` loop?

Show Answer

A loop used to iterate over asynchronous iterable objects, pausing iteration until each element is resolved via a Promise.

Added: Nov 30, 2025

522. What is the purpose of the `queueMicrotask` API?

Show Answer

It schedules a function to be executed at the end of the current task, but before any new event handling or rendering, using the microtask queue.

Added: Nov 30, 2025

523. Explain `Destructuring Assignment` in JavaScript.

Show Answer

A feature that allows you to extract values from arrays or properties from objects into distinct variables using a syntax that mirrors the array or object literal.

Added: Nov 30, 2025

524. What are `Rest parameters` in JavaScript?

Show Answer

An improved way to handle function parameters, allowing an indefinite number of arguments to be represented as an array (prefixed by `...`).

Added: Nov 30, 2025

525. What is the difference between `class` and `id` in CSS selectors and specificity?

Show Answer

`id` is unique and has the highest specificity (1,0,0). `class` is reusable and has lower specificity (0,1,0).

Added: Nov 30, 2025

526. How do you create a self-referencing selector in CSS?

Show Answer

Using the `:is()` or `:where()` pseudo-class (e.g., `:is(h1, h2, h3).active`) to target multiple selectors with one rule, often simplifying code.

Added: Nov 30, 2025

527. What is the CSS `mask-image` property?

Show Answer

A property used to hide parts of an element visually by masking or clipping them using an image, gradient, or SVG as the mask.

Added: Nov 30, 2025

528. What is `CSS Nesting`?

Show Answer

A proposed CSS feature that allows selectors to be nested inside others, reducing repetition and keeping related styles together, similar to preprocessors.

Added: Nov 30, 2025

529. Explain the purpose of the `::backdrop` pseudo-element.

Show Answer

It is used to style the element that sits directly behind a full-screen element (like a modal dialog or an element in fullscreen mode).

Added: Nov 30, 2025

530. What is the `prefers-reduced-motion` media query?

Show Answer

A media query that detects if the user has requested the system minimize the amount of non-essential motion or animation.

Added: Nov 30, 2025

531. What is the `prefers-contrast` media query?

Show Answer

A media query that detects if the user has requested a system preference for a higher or lower contrast interface.

Added: Nov 30, 2025

532. How does `CORS Preflight` work?

Show Answer

It uses the HTTP `OPTIONS` method to ask the server which origins, methods, and headers are allowed for the actual cross-origin request, preventing unauthorized requests.

Added: Nov 30, 2025

533. What is a `wildcard subdomain` in DNS?

Show Answer

A record (often `*.example.com`) that matches any subdomain that does not have an explicit DNS record, used for dynamic environments or large numbers of subdomains.

Added: Nov 30, 2025

534. What is `Brotli` compression?

Show Answer

A modern, lossy compression algorithm developed by Google that often provides better compression ratios than Gzip, resulting in smaller file sizes and faster page loads.

Added: Nov 30, 2025

535. How do you configure a web server for `HTTP/2 Server Push`?

Show Answer

A server-side technique that allows the server to proactively send resources (CSS, JS) to the client that it anticipates the client will need, before the client requests them.

Added: Nov 30, 2025

536. What is the benefit of `DNS Prefetching`?

Show Answer

It resolves the DNS for external resources ahead of time, reducing latency when the browser actually tries to fetch those resources later.

Added: Nov 30, 2025

537. Explain the concept of `long-term caching` in deployment.

Show Answer

Using versioned file names (e.g., `app.12345.js`) based on file content hash, allowing files to be cached indefinitely by the browser until their content changes.

Added: Nov 30, 2025

538. What is the `Web Performance Budget`?

Show Answer

A set of measurable constraints on the size, quantity, and load time of assets (like JavaScript, images) that the development team agrees not to exceed to maintain performance goals.

Added: Nov 30, 2025

539. What is `Speed Index` as a performance metric?

Show Answer

A metric that measures how quickly the contents of a page are visibly populated, with lower scores being better.

Added: Nov 30, 2025

540. Explain the concept of `Taint Checking` in security.

Show Answer

A technique where data from an untrusted source is "tainted" to prevent it from being used in sensitive sinks (like `eval()` or database queries) unless it is properly sanitized.

Added: Nov 30, 2025

541. What is a `security sandbox`?

Show Answer

A security mechanism that isolates running programs, restricting the resources (like file systems or network access) that the application can access.

Added: Nov 30, 2025

542. What is the purpose of the `Expect-CT` header?

Show Answer

A security header used to ensure that a website's SSL/TLS certificates are publicly logged in Certificate Transparency logs, helping to detect misissued certificates.

Added: Nov 30, 2025

543. What is `OWASP Top 10`?

Show Answer

A standard awareness document for developers and web application security, representing a broad consensus about the most critical security risks to web applications.

Added: Nov 30, 2025

544. What is the difference between `Symmetric` and `Asymmetric` encryption?

Show Answer

Symmetric uses a single secret key for both encryption and decryption. Asymmetric uses a pair of public and private keys for security.

Added: Nov 30, 2025

545. What is a `Key Derivation Function (KDF)`?

Show Answer

A cryptographic hash function that derives one or more secret keys from a secret value, like a password or master key, used to make dictionary attacks harder.

Added: Nov 30, 2025

546. How do you handle secrets (API keys, tokens) in a serverless function?

Show Answer

By storing them in secure, centralized secret management services (like AWS Secrets Manager or Azure Key Vault) and retrieving them at runtime.

Added: Nov 30, 2025

547. What is the `Adapter Pattern` (or Wrapper) in JavaScript design?

Show Answer

A structural pattern that converts the interface of a class into another interface that clients expect, allowing classes with incompatible interfaces to work together.

Added: Nov 30, 2025

548. Explain the `Facade Pattern`.

Show Answer

A structural pattern that provides a simplified interface to a large body of code (a library or subsystem), shielding the client from the complexity of the internal components.

Added: Nov 30, 2025

549. What is the `Decorator Pattern` in JavaScript?

Show Answer

A structural pattern that dynamically attaches additional responsibilities to an object, providing a flexible alternative to subclassing for extending functionality.

Added: Nov 30, 2025

550. What is `Dependency Injection (DI)`?

Show Answer

A design pattern where components receive their dependencies from an external source (like a framework or container) rather than creating them themselves, increasing modularity and testability.

Added: Nov 30, 2025

551. What is the concept of a `Render Prop` pattern?

Show Answer

A component-based pattern where a component takes a function (the render prop) as a prop, which it calls to determine what to render, enabling sharing of stateful logic.

Added: Nov 30, 2025

552. Explain the purpose of `React Hooks` (conceptually).

Show Answer

A feature that allows functional components to "hook into" (use) state and lifecycle features without needing to convert them to class components, promoting reuse of stateful logic.

Added: Nov 30, 2025

553. What are `memoized selectors` (e.g., Reselect) used for in state management?

Show Answer

They prevent unnecessary recalculations of derived data when the input state has not changed, improving performance in complex state trees.

Added: Nov 30, 2025

554. What is the benefit of `server-side rendering (SSR)` over client-side rendering (CSR)?

Show Answer

SSR provides faster First Contentful Paint (FCP) and better SEO, as the initial HTML is fully formed and crawlable by search engines.

Added: Nov 30, 2025

555. What is the `Web Worker` limit?

Show Answer

There is generally no formal specification limit, but modern browsers typically limit the number of active workers to around 20 for performance reasons, with more being queued.

Added: Nov 30, 2025

556. How do you pass data between a Service Worker and the main thread?

Show Answer

Using the `postMessage()` method via the `MessageChannel` or the Service Worker's registration object.

Added: Nov 30, 2025

557. What is the purpose of the `Notification.permission` property?

Show Answer

It provides the current permission status for displaying notifications to the user (e.g., `default`, `granted`, or `denied`).

Added: Nov 30, 2025

558. Explain the `window.postMessage()` method.

Show Answer

A method that enables secure cross-origin communication between `Window` objects (e.g., between an iframe and its parent, or two different windows).

Added: Nov 30, 2025

559. What is the role of `Trusted Types` (browser security feature)?

Show Answer

A security mechanism that requires certain APIs (like `innerHTML`) to only accept pre-sanitized input, mitigating DOM-based XSS vulnerabilities.

Added: Nov 30, 2025

560. How does `WebAuthn` (Web Authentication API) work?

Show Answer

It enables users to authenticate to a web application using hardware authenticators (e.g., security keys, biometrics) instead of passwords, leveraging public-key cryptography.

Added: Nov 30, 2025

561. What is the difference between `localStorage` and `sessionStorage`?

Show Answer

`localStorage` persists data across browser sessions and tabs. `sessionStorage` clears data when the browser tab or window is closed.

Added: Nov 30, 2025

562. What is the size limit for `localStorage`?

Show Answer

Typically 5MB to 10MB per origin, depending on the browser.

Added: Nov 30, 2025

563. What is the purpose of the `window.location.assign()` method?

Show Answer

It loads a new document at the specified URL, similar to setting `window.location.href`, but explicitly indicates an intent to navigate.

Added: Nov 30, 2025

564. What is the `window.history.pushState()` method used for?

Show Answer

It adds a state to the browser's session history stack without loading a new document, allowing for client-side routing in SPAs.

Added: Nov 30, 2025

565. How do you check if a browser is running offline?

Show Answer

By inspecting the `navigator.onLine` property, which returns a boolean indicating the network status.

Added: Nov 30, 2025

566. What is the purpose of the `<datalist>` element?

Show Answer

It provides a set of pre-defined options for an `<input>` element, offering suggestions to the user as they type.

Added: Nov 30, 2025

567. What is the difference between `<time>` and `<input type="time">`?

Show Answer

`<time>` is a semantic element for marking up human-readable dates/times. `<input type="time">` is a form control for user input of time.

Added: Nov 30, 2025

568. How do you define a custom animation keyframe set in CSS?

Show Answer

Using the `@keyframes` rule, followed by the animation name and a set of keyframe rules (e.g., `from`/`to` or percentage selectors).

Added: Nov 30, 2025

569. What is the purpose of `animation-fill-mode`?

Show Answer

It specifies which values are applied to the element before the animation starts or after it finishes (e.g., `forwards` to keep the end state).

Added: Nov 30, 2025

570. What is the CSS `clip-path` property?

Show Answer

A property that allows you to specify a clipping region, determining which parts of an element should be visible, creating custom shapes.

Added: Nov 30, 2025

571. What is the `text-wrap: balance` property (future CSS)?

Show Answer

A future CSS property designed to optimize the line breaks in short blocks of text (like headings) to create a more aesthetically balanced appearance.

Added: Nov 30, 2025

572. What is the `hyphens` CSS property?

Show Answer

A property that controls how words should be hyphenated when text wraps across multiple lines, improving text layout and readability.

Added: Nov 30, 2025

573. What is the purpose of the `::first-line` pseudo-element?

Show Answer

It allows you to apply styles to the first formatted line of a paragraph of text.

Added: Nov 30, 2025

574. What is the JavaScript `Generator` function?

Show Answer

A special type of function that can be paused and resumed, allowing for the creation of iterators and yielding multiple values over time using the `yield` keyword.

Added: Nov 30, 2025

575. What is the difference between `yield` and `return` inside a Generator function?

Show Answer

`yield` pauses the function and returns a value, but the function can be resumed later. `return` terminates the Generator function permanently.

Added: Nov 30, 2025

576. How do you pass a value *into* a running Generator function?

Show Answer

By passing the value as an argument to the `.next()` method call, which becomes the result of the `yield` expression inside the generator.

Added: Nov 30, 2025

577. Explain the purpose of the `yield*` expression.

Show Answer

It is used inside a Generator to delegate to another iterable or Generator object, effectively flattening nested iterations.

Added: Nov 30, 2025

578. What is the JavaScript `WeakSet`?

Show Answer

A collection of unique objects, similar to a `Set`, but holding references to its members weakly. If the only reference to an object is in a `WeakSet`, it can be garbage collected.

Added: Nov 30, 2025

579. What is the primary restriction on values stored in a `WeakSet`?

Show Answer

They must be objects. Primitive types like numbers or strings cannot be stored in a `WeakSet`.

Added: Nov 30, 2025

580. Explain the `private methods` proposal for JavaScript classes.

Show Answer

Using the `#` prefix for class methods (e.g., `#privateMethod()`) to ensure they can only be called from within the class body, enforcing true encapsulation.

Added: Nov 30, 2025

581. What is the JavaScript `BigInt` data type?

Show Answer

A numeric primitive data type that allows developers to work with whole numbers larger than 2^53 - 1, which is the largest number a regular `Number` can safely represent.

Added: Nov 30, 2025

582. What is the purpose of the `globalThis` object?

Show Answer

A unified way to access the global object in all JavaScript environments (it is `window` in browsers, `global` in Node, etc.), solving fragmentation issues.

Added: Nov 30, 2025

583. What is the `Top-Level Await` feature?

Show Answer

A modern feature that allows the use of the `await` keyword at the top level of an ES Module, eliminating the need to wrap code in an async function for simple setup.

Added: Nov 30, 2025

584. Explain the concept of `Tail Call Optimization (TCO)`.

Show Answer

A compiler optimization that allows a function call to be executed without adding a new stack frame, preventing stack overflow errors during recursion (though implementation varies across engines).

Added: Nov 30, 2025

585. What is `Memoization` in JavaScript?

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

586. What is the browser's `Painting` step in rendering?

Show Answer

The process of converting the render tree into actual pixels on the screen, often broken down into layers and handled by the compositor.

Added: Nov 30, 2025

587. Explain the purpose of `will-change: transform` in CSS.

Show Answer

A performance hint that tells the browser the `transform` property is likely to change soon, encouraging the browser to optimize the element by promoting it to its own rendering layer.

Added: Nov 30, 2025

588. What is the `Render Tree`?

Show Answer

A visual tree structure built by the browser that combines the DOM tree (content) and the CSSOM tree (style), containing only elements necessary for rendering.

Added: Nov 30, 2025

589. What is `Time to Interactive (TTI)`?

Show Answer

A key performance metric that measures the time from the start of page load until the page is visually rendered and capable of reliably responding to user input (main thread is quiet).

Added: Nov 30, 2025

590. How do you measure `Total Blocking Time (TBT)`?

Show Answer

A metric that measures the total time a page is blocked from responding to user input, calculated by summing up the blocking time (time over 50ms) of all long tasks between FCP and TTI.

Added: Nov 30, 2025

591. What is the `First Contentful Paint (FCP)`?

Show Answer

A performance metric that measures the time from when the page starts loading to when any part of the page's content is rendered on the screen.

Added: Nov 30, 2025

592. What is `Long Animation Frame (LoAF)`?

Show Answer

A proposed metric to replace FID, focusing on long animation frames to better measure the responsiveness of the main thread and jank in UI rendering.

Added: Nov 30, 2025

593. Explain the concept of `Critical Request Chains`.

Show Answer

The sequence of dependent network requests that must be completed to render the critical resources (CSS, JS) required for the page's initial view.

Added: Nov 30, 2025

594. What is the `Web Workers` API?

Show Answer

An API that allows JavaScript code to run in a background thread, separate from the main execution thread, enabling multi-threading for non-UI-blocking tasks.

Added: Nov 30, 2025

595. What is the primary constraint of code running in a Web Worker?

Show Answer

It does not have direct access to the DOM or the `window` object.

Added: Nov 30, 2025

596. What is the `Transferable` concept in Web Workers?

Show Answer

A mechanism for moving large data objects (like `ArrayBuffer`s) between the main thread and a worker with minimal overhead, as the data ownership is transferred rather than copied.

Added: Nov 30, 2025

597. Explain the purpose of the `MessageChannel` API.

Show Answer

It allows for the creation of a direct, two-way communication channel between two scripts in different browsing contexts, using `Port1` and `Port2` to exchange messages.

Added: Nov 30, 2025

598. What is the `Client-Side Storage Estimation API`?

Show Answer

An API that allows web applications to query the browser for the current storage usage and the maximum quota available for that origin.

Added: Nov 30, 2025

599. What is `Cache API` used for in Service Workers?

Show Answer

A powerful, promise-based API that provides programmatic control over a collection of `Request`/`Response` object pairs, used for caching assets for offline support.

Added: Nov 30, 2025

600. What is the `Web Push Protocol` (spec)?

Show Answer

The underlying protocol that defines how a Push Service (provider) communicates with a web application's Service Worker, usually via a standardized API.

Added: Nov 30, 2025