DEV Community

Cover image for Interview Questions for Web Developer - Web / Security
Mykhailo Toporkov πŸ‡ΊπŸ‡¦
Mykhailo Toporkov πŸ‡ΊπŸ‡¦

Posted on • Edited on

Interview Questions for Web Developer - Web / Security

1. Describe all levels of OSI model?
The OSI (Open Systems Interconnection) model is a conceptual framework that standardizes the functions of a telecommunication or computing system into seven abstraction layers. Each layer performs specific tasks that facilitate communication between devices in a network. Here are the seven layers of the OSI model, starting from the bottom
Image description

2. What is the difference between TCP and UDP protocols?
TCP (Transmission Control Protocol) is a connection-oriented protocol that ensures reliable and ordered data delivery with error checking and retransmission, while UDP (User Datagram Protocol) is a connectionless protocol that provides faster but less reliable data transmission without error correction or guaranteed delivery.

Image description

3. What is the difference between HTTP and HTTPS protocols?
HTTP (Hypertext Transfer Protocol) and HTTPS (Hypertext Transfer Protocol Secure) are both protocols used for transmitting data over the internet. The primary difference lies in their security mechanisms:

  • HTTP (Hypertext Transfer Protocol): It transmits data between a web server and a web browser, operating over a plain text communication, which means the data exchanged is not encrypted. This lack of encryption makes it vulnerable to interception or modification by attackers, compromising data integrity and confidentiality (works on port 80).

  • HTTPS (Hypertext Transfer Protocol Secure): HTTPS incorporates encryption through SSL/TLS protocols, providing a secure and encrypted connection between the web server and the browser. This encryption ensures that data transmitted between the server and the client is encrypted, making it significantly more secure and safeguarding sensitive information such as login credentials, personal details, and financial transactions (works on port 443).

In summary, HTTPS adds a layer of security by encrypting data exchanged between the server and the client, while HTTP does not employ encryption, leaving data vulnerable to potential interception or tampering.

4. Name base HTTP request methods, what are the differences between them?

  • GET: The purpose of the GET method is to request data from a specified resource, the data can be passed with a GET request inside a URL query string.
  • POST: The purpose of the POST method is to submit data to a specified resource, the data can be passed with a POST request inside a URL query string and request body.
  • PUT: The purpose of the PUT method is to send data to a specified resource for updating, the data can be passed with a PUT request inside a URL query string and request body.
  • DELETE: The purpose of the DELETE method is to delete the specified resource identified by the URL.

5. What are HTTP status codes, give examples of the most common ones?
HTTP status codes are three-digit numbers returned by a server in response to a client's request made to a web server via HTTP. These codes indicate the outcome of the request and help to diagnose and troubleshoot issues encountered during communication between the client (like a web browser) and the server.

1xx Informational:

  • 100 Continue: The server confirms the client's request and asks the client to proceed with the rest of the request.

2xx Success:

  • 200 OK: The request was successful, and the server provides the requested content.

  • 201 Created: The request has been fulfilled, resulting in the creation of a new resource.

  • 204 No Content: The server successfully processed the request but doesn't need to return any content.

3xx Redirection:

  • 301 Moved Permanently: The requested resource has been permanently moved to a new URL.

  • 302 Found (or Moved Temporarily): The requested resource temporarily resides under a different URL.

4xx Client Errors:

  • 400 Bad Request: The server cannot process the request due to a client error in the request syntax.

  • 403 Forbidden: The server understands the request but refuses to authorize it.

  • 404 Not Found: The requested resource could not be found on the server.

5xx Server Errors:

  • 500 Internal Server Error: A generic error message indicating that something has gone wrong on the server.

  • 503 Service Unavailable: The server is currently unable to handle the request due to temporary overloading or maintenance.


Top comments (0)