Tencent side

  • Self introduction
  • Campus Project Introduction
  • TCP three-way handshake, what kind of network (http network) is entered after the connection is established
  • OSI seven-layer protocol architecture
    physical layer, data link layer, network layer, transport layer, session layer, application layer (http is in the application layer)
  • Events Bubble, Catch and Stop Them
  • Huffman tree (concept + how to construct)
  • Balanced binary tree
    It is an empty tree or the absolute value of the height difference between its left and right subtrees does not exceed 1, and both left and right subtrees are a balanced binary tree.
  • css box model
  • The difference between cookies and sessions
  • http protocol composition, https
    http + encryption (SSL, TLS) + authentication + integrity protection = HTTPS
  • The difference between get and post
  1. get pulls data, post transmits data
  2. get requests can be actively cached by the browser, post will not (unless manually)
  3. The parameters passed in the URL of the get request are limited in length
  4. The get request parameters are passed in the URL, and the post is passed in the request body
  5. get request parameters are preserved in the browser history
  6. The get request has no effect on the browser fallback, and the post will be requested again
  • es6 new features
  • Disadvantages and advantages of closures and closures :
  1. Protect the safety of variables in the function and strengthen the encapsulation
  2. Maintain a variable in memory (using too much becomes a disadvantage, occupying memory)
  3. Local variables for convenient calling contexts.
  4. The logic is continuous, when the closure is used as a parameter of another function call, it prevents you from writing additional logic separately from the current logic.

shortcoming:

  1. The function that returns the closure is a very large function.
  2. Resident memory will increase memory usage, and improper use can easily cause memory leaks.
  3. The problem of memory waste, the generation of invalid memory.

Notice:

  1. Because the closure will make the variables in the function are stored in the memory, the memory consumption is very large, so the closure cannot be abused, otherwise it will cause performance problems of the web page, and may cause memory leaks in IE.
  2. The workaround is to delete all unused local variables before exiting the function.
  • Ajax features and advantages and disadvantages
    :
  1. The page does not refresh, and communicates with the server within the page, giving the user a very good experience.
  2. It communicates with the server in an asynchronous way, without interrupting the user's operation, and has a more rapid response capability.
  3. The principle of ajax is to "fetch data on demand", which can minimize the burden of redundant requests and responses to the server.
  4. Based on standardized and widely supported technologies, there is no need to download plugins or applets.

shortcoming:

  1. Ajax kills the back button, which is the destruction of the browser's back mechanism. The back button is an important feature of a standard web site, but it doesn't play well with js. (, it is possible to go back under Gmail, but it does not change the mechanism of ajax, it is just a relatively stupid but effective method, that is, when the user clicks the back button to access the history, by creating or using a hidden IFRAME to reproduce changes on the page.)
  2. Security issues: Ajax technology is like establishing a direct channel for enterprise data. This allows developers to inadvertently expose more data and server logic than before.
  3. Weak support for search engines;
  4. The exception mechanism of the program is destroyed.
  • jQuery selectors and features
    class selectors, ID selectors, attribute selectors
  • Database Principles - The Concept of Transactions
  1. A transaction is a sequence of database operations defined by the user. These operations are either all done or not done at all, and are an inseparable unit of work. For example, in a relational database, a transaction can be an SQL statement, a group of SQL statements, or an entire program.
  2. Transactions have four characteristics : atomicity (Atomicity, either all or nothing), consistency (consistency, where a transaction changes from one consistent state to another), and isolation (Isolation, the execution of a transaction cannot Interference by other transactions) and persistence (Durability, once a transaction command is committed, changes to the database are permanent)
  • Knowledge of python
  • Front-end security (XSS attack principle and defense + CSRF attack principle and defense)
  1. XSS: (cross-site scripting) cross-domain scripting attack; principle: , without login verification, inject js script into the page, so that your js script is executed incorrectly; solution: (1) Use the HTTPonly attribute of set-cookie to add Restrictions, so that cookies are not accessed by JavaScript scripts; (2) Input checking: validation, special characters are filtered out; (3) Output checking.
  2. CRSF: (cross-siterequest forgery) cross-site resource forgery; principle: log in to website A with user registration, website A gives him a cookie, when the user visits website B, website B gives the user a temptation to click, so that the user clicks Enter the A website. (The user has logged in on the website, or the website has loopholes); Solution: (1) Token verification; (2) Referer verification (page source); (3) Hidden token (similar to Token, Token is hidden in the http header)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324977745&siteId=291194637