Write down some of my own find interesting face questions

 

November 11, 2019 --- November 13, 2019 three days earlier this week in an interview, interview several companies, all recorded several feel very interesting interview questions:

1. Aurora

What should be noted in the use of arrays and objects?

Fu passers company

1. What are the common status codes:

Answer: 200500404401 

 

502BadGateway: as a gateway or proxy server try to perform a work request received from the upstream to the server invalid response.

504 Gateway Timeout error means (Gateway timeout), it refers to as a gateway or a proxy server, but the request is not received from the upstream server

 

More interesting is 304

If a client sends a conditional GET request and the request has been allowed, and the contents of the document (or since the last visit in accordance with the conditions requested) has not changed, the server should return the 304 status code. The expression is simple: the server has performed a GET, but the file was not changed.

304 returns a status code under what circumstances

The client is aware of how the content is not updated it? In fact, this is not a client of things, but what you server, we all know the server can be set caching mechanism, this feature is to increase the access speed of the site, when you issue a GET request when the server calls you from the cache access to content, this time the server can determine whether this page is not updated, and if not then he will give you updated returns a 304 status code.
For example: Some how search engines know whether our website for updates. One place the most direct way to determine whether a web page is changed settings page to monitor the area, always grab the contents of the partial area, and then save the local or the last to crawl content, and if there are differences on the show page It changes before they can be resolved. This method is safe, it can achieve the effect almost foolproof. However, this approach at each scan must download the page content, and go to the interception of content monitoring area and, finally string comparison, the whole process is time consuming. In fact, many pages, there are web content part of the site is static page , such as images, html, js, etc. These static pages can often be the server had prepared, when a user accesses just download it. So for this static page, it can only be judged by the 304 status code, if the content has changed.

How to analyze the 304 status code from the site log

For example, a site log in following this paragraph:
2011-12-18 23:45:33 W3SVC7499849XX 61.145.116.XX GET /asyj/1112_5544.html - 80 - 123.125.71.78 Mozilla/5.0+(compatible;+ Baiduspider/2.0;++http://***.baidu.coX/search/spider.html  [1]  ) 304 0 0
In fact, this text is understandable.
2011-12-18 23:45:33 - date and time of the visit representatives.
W3SVC7499849XX - on behalf of the virtual host name
61.145.116.XX - Representative visited ip
GET - approach represents visit
/asyj/1112_5544.html-- file represents a specific access
80-- port representatives visit
123.125.71.78 - represents the source ip
Mozilla / 5.0 + (compatible; + Baiduspider / 2.0; ++ http: //***.baidu.coX/search/spider.html) - represents the access source ; here is on behalf of Baidu spider . Note * changed to w
304--304 return code. This is also the focus presented here. This means that the client has performed a GET, but the file does not change
Before a 0 - Representative server to the client's size in bytes
After a 0 - behalf of the client to the server transmits byte size
From this section of the log. We can see the results of this visit Baidu spider returns a 304 status code. Then the search engine would not have been our pages to crawl up again

Significance lies 304 status code

If a website is more search engines to crawl frequency and the frequency then he is the more favorable rankings, but if your site is 304 too many, then we will reduce the crawl frequency and the number of search engines, so that their own the site's ranking fell one step ahead of others.
 
@ Ranking refers to the search engine (Baidu mainly domestic, foreign mainly google) site shows out of the order, currently ranking do site work called SEO, there are many factors rank the quality of the site.
Factors ranking of now, there are a lot of influence in the final after doing site optimization is based on the user experience.
2. The method of using a recursive way to implement Fibonacci column
Cache performance optimization problem
 
By asking these questions, I think the way the rich is good.
 
 

Guess you like

Origin www.cnblogs.com/DZzzz/p/11846347.html