interview-questions

Web Interview Questions

1. What is AJAX? How does it work?

AJAX(Asynchronous Javascript And XML) uses a combination of technologies to load content on the web-page dynamically without a full reload:

2. What is CORS? How does it work? What is preflight?

Cross-Origin Resource Sharing (CORS) is a web browser security feature that controls how web applications at one origin can interact with resources at a different origin. It is an integral part of the browser’s security model, enforcing the same-origin policy which restricts documents or scripts from different origins from accessing each other’s resources.

How Does CORS Work?

CORS involves a set of steps and checks performed by both the browser and the server:

  1. Browser’s Check: When a page requests a resource from a different origin, the browser first checks the CORS policy of that resource.
  2. Server’s Response: The server hosting the resource responds with specific CORS headers, such as Access-Control-Allow-Origin, indicating whether the resource is accessible.
  3. Conditional Access: If the server’s CORS policy allows the request, the browser proceeds with loading the resource. Otherwise, the request is blocked.

What is Preflight in CORS?

Preflight is a CORS process used for validating certain types of cross-origin requests before the actual request is made:

3. What are cookies? How does it work?

Best answer ever! - https://stackoverflow.com/a/48654382/2109394

4. Which are the 5 groups of HTTP codes? What do we use them for?