The front-end questions from the interview

worked at the front end for more than three years, but when I went to the interview again, the interviewer asked a lot of basic questions, such as es 6"s promise three-status, let var.. The differences between const, such as the three-way handshake of http s, such as the life cycle of react, how to organize the render of react, and how do peer components pass values to each other, such as deep copy and shallow copy, such as closure? I can"t answer these questions. I feel that there is nothing wrong with the code, but when the interviewer asks, I can"t answer why. What should I do? I feel very confused

Apr.25,2021

Let me share with you the interview questions I have accumulated:

JavaScript:

  1. prototype inheritance (handwritten class B inherits class A)
  2. differences between call, apply and bind
  3. explain what closures are and their applications
  4. variable scope + variable promotion
  5. how many ways to convert string integer digits to digits (implicit conversion)
  6. Asynchronous programming (callback, promise, async await) (js single-threaded event loop) (handwritten native implementation of simple promise)
  7. js event model (handwritten native implementation of simple event listening)
  8. localStorage, cookie (what are the cache-related cookie)
  9. csrf, xss, https (Network Security)
  10. how to implement cross-domain requests

ES6:

  1. let, const (for loop example)
  2. set, map
  3. characteristics of the arrow function this
  4. what are the common grammars

layout:

  1. Center horizontally and vertically (fixed size, indefinite size)
  2. flex (contour layout, adaptive layout, vertical center)
  3. Adaptive square (padding, vw)
  4. Mobile screen adaptation (how to implement rem) (, how to implement 1px border)
  5. what are the methods of clearing floats (involving BFC)

Vue:

  1. vue response principle
  2. calculation properties, watch differences
  3. vue Lifecycle
  4. non-inherited component Newsletter (vuex, publish / subscribe)

programming:

  1. Array deduplication (array items are of various types)
  2. find the maximum value of an array of unordered values
  3. what are the common array operations (which destroy the original structure)
  4. sorting algorithm (involving complexity)
  5. bit operation (sum of two numbers) (searching in pairs of numeric arrays)
  6. Fibonacci sequence
  7. factorial
  8. reverse the linked list
  9. traverse the dom tree (breadth first, depth first)

other:

  1. what are the new features of html5 (semantic tags, audio and video, cache.)
  2. what are the communication methods between hybrid and native (what are the advantages of mixed development) (how to achieve hot updates)
  3. what are the compatibility problems of ios and android encountered
  4. sass, less, postcss (functions, advantages)
  5. understanding and use of webpack
  6. what are the experiences of opening a html
  7. performance optimization (image processing: webp, base64, merge, compression, deferred loading.) (pre-rendering) (static resource volume reduction) (resource asynchronous loading) (resource cache)
  8. the difference between (git revert and git reset commands commonly used in git)
  9. Wechat authorization login process (difference between openid and unionid)
  10. AMD, CMD (require (), import, import () application scenarios)

practice:

  1. implementation of rich text mixed with multiple types of cards
  2. draw hexagons in pure css (a tag can be) (svg or trimmed)
  3. pure css drawing progress circle (applied to task center) (svg, trimming is also available)
  4. how to implement drag and drop

understand the principle to make good things, debug do not understand the principle do not know where the problem is, how to solve the problem? The foundation is always the most important.


in the same three years, I did ionic development, but I didn't use rn very much.
other problems besides rn are three-way handshakes. Handshakes should be something of the tcp layer, only knowing that they consume a lot, so making good use of long links can optimize performance in some cases. I think all other problems are basic and can no longer be based.

promise is not difficult for you to understand if you implement a promise according to the document. It is mainly the process of dealing with the value of resolv, as well as several static and common methods. If you have a good js foundation, you can probably write it out in a day if you look at the document.
other basic problems are the core of the js language, and the ones you listed are not particularly partial to the basic problems of the js language, just gnaw on the book. Anyway, in the rhino book, I read the core part of the language three times and the js part on the client side twice.


except for the framework, all other problems are the basics of js and should be mastered. Although you have worked for more than three years, you do not necessarily study systematically. It is recommended to spend some time brushing the following questions before the interview.


is this state wrong now? Do not pay attention to these basic problems at work, always blindly write code!
do I have to brush the test questions before the interview? How can I pay attention to these basic knowledge at work?


that code is also full of flawed garbage. You can't still use Vue, then you're right again.


has been employed for two and a half years. I am ashamed to say that apart from let const and closures, I have never used it in the project. I feel that if I don't study, I will be eliminated. Both girls are so much better than me to learn from the landlord and @ Little Meow.


I have recently interviewed several companies, and the form of the interview is different, some pay attention to the basis of asking, some prefer to ask about the framework, but also ask about the principle of the framework, ask about the project, and ask about what is mentioned on the resume. I feel that the ability is usually accumulated bit by bit, otherwise there will always be a lot of people who will not be asked during the interview


.

https://yuchengkai.cn/docs/zh/

this document will help you


you can't just focus on the problems and technologies used in your daily work, but also look at new things from time to time, otherwise it's easy to get out of touch, and now the front-end technology is updated too fast.

Menu