In the first interview, there was no written test or handwritten questions. The whole process took less than 30 minutes. Maybe it was because lunch was near, or I was too bad to ask, so I failed the interview. The biggest problem of the interview is that the foundation of the net is not firm
Introduce the project
- Let me directly introduce the project first, through the introduction of the project to extend a variety of examination points (big factories seem to start from the project). My project is a personal blog project with separate front and back ends, and the other two are pure front ends, presumably with no interesting questions.
How is login implemented?
One of my friends was also asked about the login method when meeting the same position, so it is necessary to have a comprehensive understanding of the login method if it is involved in the project
- My project is based on token. In this way, when the client logs in for the first time, the server will generate a token (a header + a string in the form of carrier as an identity symbol, please check the JWT token for details) and return it to the client, save it in the client, and request login with the token next time. The server verifies that the token matches
- In addition to tokens, there are session login, SSO SSO, and OAuth login modes
Where does token exist?
- It can be stored in cookie, localStorage and sessionStorage. I choose localStorage that is valid for a long time. Cookie storage capacity is small and insecure, and the sessionStorage page will be cleared when closed
The presence of tokens raises a later caching issue
Talk about caching
This is best done in conjunction with the HTTP header cache-control
- Strong cache
- Negotiate the cache
Tell me what headers you know
-
Get, post, head, and so on. I used get or POST to log in.
-
General head
- Cache-control: specifies the Cache mechanism (strong Cache, negotiated Cache, etc.)
- Data: time
- .
-
Request header
-
There are several that begin with Accept
-
Accept: Specifies the type of content that the client can receive
-
Accept-charset: a set of character encodings accepted by the browser
-
.
-
-
Response headers
-
Several at the beginning of Content
-
Content-encoding: Response body language
-
Content-length: indicates the Length of the response body
-
Get and POST
- The parameter of 1 is placed in the URL (www. xxxx. com? Parameter = XXX), and the parameter of 2 is placed in the request header
- 1 is actively cached by the browser, but 2 is not (this can be set manually)
- 1 can only encode URLS, while 2 supports multiple urls
- The parameter length of 1 is limited (because the URL length is limited), and the parameter length of 2 is not
- .
When will your project use ES5 and when will you use ES6?
Come to think of it, this should be the difference between es5/6
- So let me give you an overview. Es6 has a lot of new features that are more convenient than ES5
- Then he mentioned some new es6 features such as arrow functions. The examiner asked me about arrow functions and also referred to this
Arrow function and this
I forgot how exactly, but there are a few important points to answer
- Arrow function
- Writing is simple
- Does not have its own this, or inherits from its outer layer
- this
- This is defined at runtime!!
Since some of your projects use VUE2 and others use VUe3, do you know about this major version update?
At that time, I didn’t understand anything except composite apis (which I didn’t know much about), and I didn’t realize file structure, VUE instantiation, so to speak. Later, I found that these points were simple but could be talked about
What advantages does Vue have over native JS and JQury? (Classic questions)
- The first topic is of course the MVVM model, and then combined with the two key words of data-driven attempt and componentization
How are projects packaged?
At that time, I didn’t realize what the test was about. I said NPM build first, but later I guided it and found it was to ask Webpack, but obviously I didn’t. Then I skipped it and asked how to transfer ES6 to ES5, I said Babel, but I didn’t know the details and didn’t ask in detail
I didn’t know those two things on my resume, but I did