The game client interview (Egret)

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/shirln/article/details/88570143

Recommended reading:

One. A company faces a friend

1. referring to the next let, var, const.
      var variable definition, there is no concept of a block, across the block access can not access across function.
      Variables let definition, can only be accessed in block scope, can not cross block access, it can not cross function access.
      const is used to define the constants, it must be initialized (i.e., must be assigned) when used, can only be accessed at block in scope, and can not be modified.
2. How to ensure that this point is correct.

分析:先从原理上说明this指向问题为什么会出现,什么情况下会出现,然后再说做法呗

      In order to prevent changes in the scope, the closure problem. To save this last pass, or pass in a bind.

3. How to write high-quality code.
Let a function be the basic unit of encoding, each function only one thing;
omit unnecessary code;
using active;
avoid loose series of expression;
the related code together;
multi affirmative statements;
take advantage of parallel structure;
a detailed explanation
4. how to check memory leaks, how to prevent memory leaks?
      Analysis: performance can keep track of, is the most macro analysis; then use the memory, you can refine the location, you can use source breakpoints investigation
5. word on what websocket. What is a three-way handshake? Why do we need three-way handshake.
      WebSocket is a network communication protocol, the server can automatically push a new message.
HTTP protocol: communication can only be initiated by the client.
      The first handshake: connection is established, the client sends syn packets (syn = j) to the server, and enters the SYN_SENT state, waiting for the server to confirm; the SYN: synchronization sequence number (Synchronize Sequence Numbers).
      Second handshake: server receives syn packets, must confirm the customer SYN (ack = j + 1) , while themselves sends a SYN packet (syn = k), i.e., SYN + ACK packet, then the server enters a state SYN_RECV;
      third handshake: the client receives the SYN + ACK packet to the server, the server sends an acknowledgment packet ACK (ack = k + 1) , this packet is sent, the client and server into the ESTABLISHED state, complete the three-way handshake.
      Complete three-way handshake, the client and server can start transferring the data
6. The front end for a growing system needs a few days of work?

7. say under what benefits using Graph.
      Graph Http reduce the number of requests. Graph time a suggestion: png and jpg Do not mix together together, otherwise, the Graph size of the picture will likely than all drawing resources out of time drawing large size. In addition, Graph width and height must not exceed 2048px, otherwise, most likely a problem on rendering ~~ appear
8. how to implement a circular list.

9.Here Insert Picture Description

Guess you like

Origin blog.csdn.net/shirln/article/details/88570143