Lock screen interview questions 100 days, adhere to update the interview questions every working day. Lock screen interview questions app, small program has been launched, website address: https://www.demosoftware.cc/#… . It has included all the contents of the interview questions updated daily, as well as features such as unlocking screen review interview questions, daily programming questions email push, etc. This will give you a head start in the interview and give the interviewer a leg up! Here are today’s interview questions:

==== What is the HTTP protocol? HTTP (Hyper Text Transfer Protocol) Protocol is to realize the reliability of the transmission of Text, pictures, audio, video and other hypertext data between the client and the server, the format is referred to as “Hypertext Transfer Protocol” HTTP Protocol belongs to the application layer.

==== What is the format of request and response messages for HTTP requests? 1) HTTP request message: An HTTP request message is composed of request line, request header, blank line and request data. ① Request line: The request line is composed of request method field, URL field and HTTP protocol version field, which are separated by space. For example, GET /index.html HTTP/1.1. ② Request header: The request header is composed of key/value pairs, one pair for each line, and the key and value are separated by English colon “:”. The request header notifies the server that it has information about the client request. Typical request headers are:

User-Agent: The type of browser that makes the request.

Accept: A list of content types recognized by the client.

A blank line is sent after the last request header. A carriage return and a newline are sent to inform the server that there are no more headers below. ④ Request data: Request data is not used in GET method, but in POST method. The POST method is suitable for situations where a customer is required to fill out a form. The most commonly used request headers associated with request data are Content-Type and Content-Length

2) HTTP response message :HTTP response consists of three parts, which are: status line, message header and response body. ① Status line: by the protocol type and version number, status code, status code text description composed of them separated by a space, such as :HTTP/1.1 200 OK ② message header: the same format as the request header ③ response body: the main information content returned by the response

==== What’s the difference between HTTP and HTTPS? In fact, HTTPS is from HTTP plus encryption processing (usually SSL secure communication lines) + authentication + integrity protection difference:

  1. HTTPS requires a CA certificate
  2. The port is not the same, HTTP is 80, https443
  3. HTTP is the Hypertext Transfer Protocol (HTTPS), in which messages are transmitted in clear text. HTTPS is the secure SSL encrypted transport protocol.
  4. HTTP and HTTPS use completely different connections (HTTP connections are simple and stateless; HTTPS is a network protocol built by SSL+HTTP, which can be used for encrypted transmission and identity authentication. It is more secure than HTTP.

==== How does HTTPS work? First, the HTTP request server generates the certificate, and the client verifies the validity, legality, domain name consistency and public key of the certificate (RSA encryption). 2. If the client passes the verification, it will generate a random number according to the validity of the public key of the certificate, and the random number will be encrypted with the public key (RSA encryption); 3. After the message body is generated, its digest is encrypted by MD5 (or SHA1) algorithm, and then the RSA signature is obtained. Send to the server, only the server (RSA private key) can decrypt. Five, the random number obtained by decryption, and then encrypted with AES, as the key (at this time the key only the client and server know).

==== How many steps do a complete HTTP request go through?

  1. How to establish a TCP connection to establish a connection, see the above three hand
  2. The Web browser sends a request line to the Web server. Once a TCP connection is established, the Web browser sends a request command to the Web server. For example: GET /sample/hello.jsp HTTP/1.1.
  3. The Web Browser Sends the Request Header After the browser sends its request command, it sends some additional information to the Web server in the form of a header, after which the browser sends a blank line to notify the server that it has terminated the sending of the header.
  4. Web server reply After the client makes a request to the server, the server sends the client back the reply, HTTP/1.1 200 OK, the first part of the reply is the protocol version number and the reply status code.
  5. The Web server sends the reply header Just as the client sends information about itself along with the request, the server sends data about itself along with the reply to the user along with the requested document.
  6. After the Web server sends the header to the browser, it sends a blank line to indicate that the header is finished, and then it sends the actual data requested by the user in the format described in the Content-Type reply header. 7.Web server closes TCP connection

==== commonly used HTTP status code is how to classify, what are the common status code? (Key) Category: 1xx: Indicator message – indicates the request has been received and is in process 2xx: Successful – indicates the request has been successfully received, understood, accepted 3xx: Redirect – further action must be done to complete the request 4xx: Client error – request has syntax error or request cannot be implemented 5xx: Server-side error — The server failed to implement a valid request Common status code: 206: The client is only a part of the requested resource, and the server only performs GET method on the requested part of the resource. The corresponding message specifies the resource in the content-range. 304: Send a conditional request, and return it if the condition is not met. It has no relation to redirection. 307: Send a conditional request, and return it if the condition is not met. 404: The request requires authentication 403: The requested resource is not allowed to be accessed 404: The server could not find the corresponding resource 500: Server internal error 503: The requested resource is not available Server is busy

==== What are the request modes in the HTTP protocol? GET: Request access to a resource that has been identified by a URI (Uniform Resource Identifier) and can be passed to the server via the URL POST: Transfer information to the server. The main function of GET is similar to that of the method, but it is generally recommended to use POST. Put: Transmits a file containing the contents of the file in the body of the message and saves it to the corresponding URI location. Head: Gets the header of the message, similar to the GET method but does not return the body of the message. It is used to verify that the URI is valid. PATCH: The data sent by the client to the server supersedes the content of the specified document (partially supersedes). This TRACE traces back the original request message of the client requesting the server. This is used to “loop back” the diagnostic DELETE: Delete: file. OPTIONS: Queries the HTTP methods supported by the corresponding URI.

==== What is the difference between GET and POST methods? One difference: GET focuses on getting resources from the server, while POST focuses on sending data to the server. Difference two: the amount of data transmitted by GET is small, because it is limited by the length of URL, but the efficiency is high. POST can transfer a large amount of data, so you can only upload a file by POST. Difference three: GET is not secure, because GET request to send data is on the URL, is visible, may disclose private information, such as password, etc. The POST is placed in the request data and is secure

==== HTTP version comparison? Features of version 1.0 of HTTPS:

The previous 1.0 version of HTTP was a stateless, connectionless application-layer protocol. HTTP1.0 specifies that the browser and server maintain a short connection, that each request from the browser requires a TCP connection to the server, that the server disconnects the TCP connection immediately after processing (connectionless), and that the server does not track each client or record past requests (stateless).

New features in HTTP1.1

The default persistent connection saves traffic. As long as either side of the client server does not explicitly request to disconnect the TCP connection, the connection is maintained. Multiple HTTP requests can be sent == Pipeline, so clients can make multiple HTTP requests simultaneously without waiting for a response

Features of the HTTP2.0 version

== Binary Framing (Encoding it in binary format) == First Compression (HPack algorithm with special first compression design is set up.) == Flow control (some flow control that sets how many bytes of a data stream are received) == Multimultiplexing (you can send requests and responses at the same time on the basis of shared TCP links) == Request priority (you can further optimize performance by optimizing the interlacing and transmission order of these frames) == Server push (that is, the server can send more than one response to a client request. The server pushes resources to the client without an explicit request from the client. (Major Update))

==== What are cookies and sessions? Cookies are files (key-value format) that are kept by the Web server on the user’s browser and can contain information related to the user. The client makes a request to the server, and the user information in the browser is extracted and sent to the server via HTTP. A session is a chunk of storage allocated by the server during a session between the browser and the server. By default, the server sets the SessionID in the cookie of the client browser, and the SessionID corresponds to the cookie. The cookie transmitted by the browser during the request to the server contains the SessionID. The server obtains the information stored in the session according to the SESSIONID in the transmission cookie, and then determines the identity information of the session.

==== The difference between a cookie and a session?

  1. Cookie data is stored on the client, which has poor security, while session data is stored on the server, which has higher security
  2. The data stored in a single cookie cannot exceed 4K. If the session has no such information, it will use its own private key to decrypt it. Since asymmetric encryption does not need to send a private key to decrypt, it can ensure security. But compared to symmetric encryption, it’s very slow

More interview questions or learning resources can be found on my homepage or in the comments