Questions: Web Technologies
Back to Topics List

Web Technologies Questions

Page 7 of 13 (Displaying Questions 601 – 700 of 1207 Total)

601. How do you prevent a Service Worker from being immediately killed by the browser?

Show Answer

By ensuring that it is actively handling an event (like `fetch` or `push`) or by using APIs that signal ongoing work, such as `ExtendableEvent.waitUntil()`.

Added: Nov 30, 2025

602. What is the Service Worker `install` event?

Show Answer

The first event in the Service Worker lifecycle, used primarily to populate the browser cache with critical static assets using the `Cache API`.

Added: Nov 30, 2025

603. What is the Service Worker `activate` event?

Show Answer

An event that fires after the Service Worker is installed and signals an opportunity to manage old caches (cleanup) before the new worker takes control.

Added: Nov 30, 2025

604. What is the purpose of the `postMessage` method in the Service Worker context?

Show Answer

It allows the Service Worker to send messages to the controlling pages (client windows) and vice versa, enabling inter-thread communication.

Added: Nov 30, 2025

605. Explain the term `Network Partitioning` (Double-Keying) in modern browsers.

Show Answer

A security feature that partitions cache, cookies, and storage by both the top-level site and the resource site, preventing third-party tracking across different sites.

Added: Nov 30, 2025

606. What is the `CHIPS` cookie proposal?

Show Answer

Cookies Having Independent Partitioned State, a proposal to allow third-party cookies to be partitioned by the top-level site, enabling them to be used safely for non-tracking purposes.

Added: Nov 30, 2025

607. What is the `Top-Level Site` property in web security?

Show Answer

The domain or origin of the document currently visible in the main browser window, used as a key component in cookie and storage partitioning.

Added: Nov 30, 2025

608. Explain the `document.domain` API and why it is discouraged.

Show Answer

An API that allowed setting the domain of a document to its registrable domain to enable cross-origin scripting access. It is discouraged due to security risks and is being deprecated.

Added: Nov 30, 2025

609. What is the `Clear-Site-Data` HTTP header?

Show Answer

A response header that instructs the browser to clear all stored data (cookies, storage, cache) associated with the requesting domain, simplifying site logouts and reset flows.

Added: Nov 30, 2025

610. What is a `Subresource Integrity (SRI)` hash?

Show Answer

A security feature that allows the browser to verify that a fetched resource (like a script or stylesheet) has not been tampered with by an attacker by checking its cryptographic hash.

Added: Nov 30, 2025

611. Explain the `Certificate Transparency (CT)` log.

Show Answer

Public, append-only logs of all SSL/TLS certificates issued by Certificate Authorities, allowing domain owners to monitor for erroneously or maliciously issued certificates.

Added: Nov 30, 2025

612. What is the purpose of the `X-Permitted-Cross-Domain-Policies` header?

Show Answer

An HTTP response header used for cross-domain requests involving legacy technologies like Flash/Silverlight, controlling access to data via cross-domain policy files.

Added: Nov 30, 2025

613. How do you prevent a script from executing if the CSP is not met?

Show Answer

By setting the `script-src-attr: none;` directive in the Content Security Policy, which blocks all inline event handlers (like `onclick`).

Added: Nov 30, 2025

614. What is the `CSP3` nonce-based approach to XSS mitigation?

Show Answer

Using a unique, random value (`nonce`) in the CSP header and on the script tag to ensure only whitelisted, client-side generated scripts are executed.

Added: Nov 30, 2025

615. What is `CORS-Safelisted` request headers?

Show Answer

A list of HTTP headers that are allowed to be sent in a CORS request without triggering a preflight request, such as `Accept` or `Content-Type` (for certain values).

Added: Nov 30, 2025

616. Explain the `Preflight Request` in detail.

Show Answer

An automatic `OPTIONS` HTTP request sent by the browser before a complex cross-origin request to determine if the server allows the intended method, headers, and credentials.

Added: Nov 30, 2025

617. What is the purpose of the `Access-Control-Max-Age` header?

Show Answer

It specifies how long the results of a CORS preflight request can be cached by the client, reducing the number of unnecessary preflight requests.

Added: Nov 30, 2025

618. What is `GraphQL`?

Show Answer

A query language for APIs and a server-side runtime for executing those queries, enabling clients to request exactly the data they need, no more and no less.

Added: Nov 30, 2025

619. What is the difference between a `GraphQL Query` and a `Mutation`?

Show Answer

Queries are used for reading or fetching data (similar to GET). Mutations are used for writing, updating, or deleting data (similar to POST, PUT, DELETE).

Added: Nov 30, 2025

620. What are `GraphQL Subscriptions`?

Show Answer

A feature that allows the server to push real-time data updates to the client (typically via WebSockets) when specific events occur.

Added: Nov 30, 2025

621. What is the concept of a `Resolver` in GraphQL?

Show Answer

A function in the GraphQL server that fetches the data for a specific field in the schema, translating the GraphQL request into actions against the backend data sources.

Added: Nov 30, 2025

622. Explain `N+1 Problem` in the context of GraphQL and how to solve it.

Show Answer

A common performance issue where fetching a list of items results in an additional N queries to retrieve details for each item. Solved using data loaders or batching mechanisms.

Added: Nov 30, 2025

623. What is `OpenAPI (Swagger)`?

Show Answer

A specification for defining a machine-readable interface for RESTful APIs, enabling automated documentation, client generation, and testing.

Added: Nov 30, 2025

624. What is the difference between `Idempotent` and `Safe` HTTP methods?

Show Answer

Safe methods (`GET`, `HEAD`, `OPTIONS`) produce no side effects on the server. Idempotent methods (`GET`, `PUT`, `DELETE`) produce the same server state regardless of how many times they are executed.

Added: Nov 30, 2025

625. What is the `418 I'm a teapot` HTTP status code?

Show Answer

An unused, humorous status code defined in 1998 as an April Fools' joke, sometimes used as a custom error code but not for production use.

Added: Nov 30, 2025

626. What is the purpose of the `Transfer-Encoding: chunked` header?

Show Answer

It specifies that the response body is being sent as a series of chunks, which is necessary when the server doesn't know the final size of the response beforehand.

Added: Nov 30, 2025

627. What is the `Link` HTTP header used for?

Show Answer

It allows defining resource hints (like `preload`, `prefetch`, `preconnect`) or specifying relationships to external resources (like canonical URLs) in the HTTP response.

Added: Nov 30, 2025

628. Explain the purpose of the `If-None-Match` header.

Show Answer

A conditional header sent by the client containing one or more ETags. If any match the server's current ETag, the server returns a 304 Not Modified response.

Added: Nov 30, 2025

629. What is the `Content-Security-Policy-Report-Only` header?

Show Answer

A version of CSP that monitors security policy violations without enforcing them, reporting violations to a specified URI for testing before full deployment.

Added: Nov 30, 2025

630. What is `Security Headers`?

Show Answer

A general term for HTTP response headers (like CSP, HSTS, X-Frame-Options) used to enhance the security posture of a web application against common attacks.

Added: Nov 30, 2025

631. What is the role of `JWT (JSON Web Token)`?

Show Answer

A compact, URL-safe means of representing claims (information) transferred between two parties, used primarily for stateless authentication and authorization.

Added: Nov 30, 2025

632. What are the three parts of a standard JWT?

Show Answer

Header (type and algorithm), Payload (claims), and Signature (used to verify the sender and integrity of the token).

Added: Nov 30, 2025

633. How does `WebAuthn` improve security over passwords?

Show Answer

It uses public-key cryptography to eliminate passwords, making the system highly resistant to phishing, man-in-the-middle, and server-side breach attacks.

Added: Nov 30, 2025

634. What is the purpose of a `Salt` in password hashing?

Show Answer

A unique, random string added to a password before hashing, which prevents pre-computation attacks like using rainbow tables and makes brute-forcing more resource-intensive.

Added: Nov 30, 2025

635. What is `Zero-Trust Architecture`?

Show Answer

A security concept centered on the belief that organizations should not automatically trust anything inside or outside its perimeters and must verify anything and everything trying to connect to its systems.

Added: Nov 30, 2025

636. What is `Horizontal Privileges Escalation`?

Show Answer

An attack where a user gains access to the resources or data of another user who is at the same privilege level, often due to poor authorization checks.

Added: Nov 30, 2025

637. Explain the concept of `Denial of Service (DoS)` attack.

Show Answer

An attack intended to make a machine or network resource unavailable to its intended users by temporarily or indefinitely disrupting the services of a host connected to the Internet.

Added: Nov 30, 2025

638. What is the `npm fund` command?

Show Answer

A command used to list the funding opportunities for a project's dependencies, allowing users to support the creators of the open-source software they rely on.

Added: Nov 30, 2025

639. What is `pnpm` and its main advantage?

Show Answer

A package manager that uses a content-addressable store to save disk space and improve installation speed by sharing hard links to the same dependencies across projects.

Added: Nov 30, 2025

640. What is `Bundling` vs. `Tree Shaking`?

Show Answer

Bundling combines multiple files into a single output file. Tree Shaking is the process of removing unused code (dead code) from the final bundle.

Added: Nov 30, 2025

641. What is the `Polyfill.io` service?

Show Answer

A service that automatically detects the user's browser and serves only the polyfills necessary to support the requested features, reducing the downloaded JavaScript size.

Added: Nov 30, 2025

642. What is the purpose of a `.browserslistrc` file?

Show Answer

A configuration file used by tools (like Babel, Autoprefixer) to specify the target browsers for a project, ensuring consistent and optimal output for that environment.

Added: Nov 30, 2025

643. Explain the `PostCSS` tool.

Show Answer

A tool that uses JavaScript plugins to transform CSS code, allowing for the use of future CSS features, linting, optimization, and modularization.

Added: Nov 30, 2025

644. What is `CSS Modules`?

Show Answer

A system for composing CSS that ensures that every class name is locally scoped by default, preventing naming collisions and making styling more modular.

Added: Nov 30, 2025

645. What is `Critical CSS`?

Show Answer

The minimum required CSS that is needed to render the visible part of a webpage (the content above the fold) as quickly as possible.

Added: Nov 30, 2025

646. How do you load non-critical CSS asynchronously?

Show Answer

By using the `<link rel="preload" as="style">` hint with a fallback using `onload` to prevent render blocking, or using the `media="print"` trick.

Added: Nov 30, 2025

647. What is the `CSS Typed OM` (Object Model)?

Show Answer

A modern API for working with CSS values in JavaScript that exposes values as typed JavaScript objects rather than simple strings, improving performance and reliability.

Added: Nov 30, 2025

648. What is the CSS `initial` keyword?

Show Answer

A keyword that resets a property to its initial (default) value, as specified by the CSS specification, ignoring inheritance.

Added: Nov 30, 2025

649. What is the CSS `unset` keyword?

Show Answer

A keyword that resets a property to its inherited value if the property is normally inherited, or to its initial value if it is not inherited.

Added: Nov 30, 2025

650. What is the purpose of the `::placeholder` pseudo-element?

Show Answer

It allows developers to style the placeholder text of form fields (like `<input>` or `<textarea>`).

Added: Nov 30, 2025

651. Explain the CSS property `isolation: isolate`.

Show Answer

When used, it creates a new stacking context for the element, preventing its contents from mixing with the rest of the document's elements in complex ways.

Added: Nov 30, 2025

652. What is `The New Stack` in modern web development?

Show Answer

A generalized term referring to a combination of modern technologies, often including Serverless, GraphQL, Next.js/Nuxt.js, or Jamstack principles.

Added: Nov 30, 2025

653. What is a `Monolith` architecture?

Show Answer

A traditional architecture where the entire application (frontend, backend, database) is developed, deployed, and run as a single, unified service.

Added: Nov 30, 2025

654. What is `Server-Side Rendering (SSR)`?

Show Answer

The process of rendering a client-side application to regular HTML on the server and sending the fully rendered page to the client, improving initial load performance and SEO.

Added: Nov 30, 2025

655. What is `Static Site Generation (SSG)`?

Show Answer

The process of pre-rendering all pages of a website to static HTML files at build time, leading to maximum performance and security at runtime.

Added: Nov 30, 2025

656. 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

657. What is the `Speed Index` performance metric?

Show Answer

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

Added: Nov 30, 2025

658. 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

659. 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

660. 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

661. 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

662. 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

663. 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

664. 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

665. 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

666. 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

667. 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

668. 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

669. 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

670. 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

671. 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

672. 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

673. 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

674. 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

675. 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

676. 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

677. 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

678. 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

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

Show Answer

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

Added: Nov 30, 2025

680. 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

681. 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

682. 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

683. What is the purpose of the `&lt;datalist&gt;` 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

684. 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

685. What is the Node.js `libuv` library?

Show Answer

A multi-platform support library written in C that provides Node.js with its non-blocking I/O operations by handling the event loop, thread pool, and file system tasks.

Added: Nov 30, 2025

686. Explain the purpose of the `Node.js Event Loop`.

Show Answer

It is the mechanism that handles asynchronous callbacks in Node.js. It checks queues (timers, I/O, microtasks) and pushes functions onto the call stack when the stack is empty.

Added: Nov 30, 2025

687. What is the `Node.js Thread Pool`?

Show Answer

A set of worker threads managed by `libuv` (typically four threads) used to handle blocking system calls like file I/O and DNS lookup, preventing the main event loop from stalling.

Added: Nov 30, 2025

688. What is the `Z-index` property in CSS and how is its stacking context determined?

Show Answer

It specifies the stack order of an element. The stacking context is determined by elements with properties like `position: relative|absolute|fixed|sticky` (if not 0) or certain CSS transforms/filters.

Added: Nov 30, 2025

689. Explain the CSS `calc()` function.

Show Answer

A functional notation that allows mathematical expressions to be used for property values, mixing different units (e.g., `width: calc(100% - 20px)`).

Added: Nov 30, 2025

690. What is the difference between CSS `grid` and `flexbox`?

Show Answer

Flexbox is designed for one-dimensional layout (row or column). Grid is designed for two-dimensional layout (rows and columns simultaneously).

Added: Nov 30, 2025

691. What is `grid-area` used for in CSS Grid?

Show Answer

A shorthand property that defines a grid item's size and location in a single declaration, often used in conjunction with named grid areas.

Added: Nov 30, 2025

692. What is the CSS `minmax()` function?

Show Answer

A function used in CSS Grid properties (`grid-template-columns`/`rows`) to define a range of minimum and maximum sizes for a grid track.

Added: Nov 30, 2025

693. Explain the purpose of `display: contents` in CSS.

Show Answer

It makes the container element disappear from the box model, causing its children to become direct children of the container's parent, affecting layout and accessibility.

Added: Nov 30, 2025

694. What is the CSS `line-clamp` property (non-standard)?

Show Answer

A property primarily used by WebKit browsers to limit the content of a block element to a specific number of lines, displaying an ellipsis if truncated.

Added: Nov 30, 2025

695. What is the `content-visibility` CSS property?

Show Answer

A property that controls whether an element renders its content, allowing the user agent to skip its layout and painting work if it is not relevant, significantly boosting rendering performance.

Added: Nov 30, 2025

696. What is the `gap` property in Flexbox and Grid?

Show Answer

A shorthand for `row-gap` and `column-gap`, used to set the spacing between rows and columns inside Flexbox or Grid containers.

Added: Nov 30, 2025

697. Explain the concept of `CSS Houdini`.

Show Answer

A set of APIs that exposes parts of the CSS engine to JavaScript, allowing developers to extend CSS by writing custom rendering code, such as worklets for layout and paint.

Added: Nov 30, 2025

698. What is a `Paint Worklet` in Houdini?

Show Answer

A browser thread that allows developers to write custom CSS functions that can generate images (like background images) programmatically using JavaScript.

Added: Nov 30, 2025

699. What is the `@property` rule in CSS?

Show Answer

A Houdini feature that allows developers to explicitly register and define custom CSS properties, including their syntax, initial value, and inheritance behavior.

Added: Nov 30, 2025

700. What is the JavaScript `Intl.NumberFormat` API?

Show Answer

An internationalization API used to format numbers according to the rules of a specific locale, handling separators, currency symbols, and unit formats.

Added: Nov 30, 2025