Original text: syean. Cn / 2018/12/27 /…

One of the most important things in my life in 2018 is to look for a job. I started my review in early June, promoted it in July, conducted mass written examination and interview in September, got my first offer in early September, and got the offer I am satisfied with in early October, which has been almost 4 months. Resume cast is mainly hangzhou, Shanghai some big factories, share some interview questions, test to bad such as input URL what happened, what is the closure, virtual DOM, etc., VUE two-way binding class will not put out.

But these interview questions although common, but still want to master attentively, because the test frequency is really quite high. I didn’t have much exposure to NodeJS and React at the time, so I didn’t have a lot of topics. I am a lazy person, so only a few offer the following ideas ~~

Js related

  • The difference between Ajax and AxiOS (Toeic)
  • Which phase of vUE is appropriate for asynchronous request (Ali, Baidu)
  • Mechanism of realizing the bottom of wechat Small Program (Jsbridge) (Ali)
  • How to implement vuex mapSetter in Vue (Bilibili)
  • What is bilibili?
  • Optimization Methods used in VUE Project (netease)
  • What is the difference between commonJS and ES6 modularity
  • What happens when webStoreage is full (error) (netease)
  • How to set application Cache (netease)
  • How to get all text nodes under a DIV (netease)
  • Some methods for Compatible Browsers (netease)
  • Why different browsers render things differently, and what is the nature of it (netease)
  • Writing a component in VUE (58)
  • Js how to achieve multithreading, webworker how to communicate (Meituan)
  • Vue asynchronous update investigation :(meituan)

The following code in VUE starts the update life cycle several times (once)

This. A =1 // this. A =3;Copy the code

The following code in VUE starts the Update life cycle several times (2 times)

setTimout(()=>{this.a=1},0);Copy the code

All those little Red books

The Little Red Book (javascript advanced programming must be good to look at it ~~~)

  • What is BOM (netease)
  • RequestAnimationFrame and setTimeout write animation difference (netease)
  • If what day is today (getDay () (netease) 【 after I answered, netease the interviewer said, how do you remember so clear – – | | |.

CSS related

  • How to achieve fonts less than 12px (DJI)
  • CSS Matching algorithm (from right to left) (DJI)
  • The difference between Animation and Transition (Ali)
  • How to animate a div from one place to another, and how to write a div that rotates when the mouse is placed on it.
  • Float and clear float survey (58) : how about 5 divs, the third of which becomes a float, how to change it back – clear float
  • How to implement a Progress bar (Sina)

Handwritten code

  • [1,[2],[3]]
  • Write a function that implements test(a)(b), returning a+b if b>0 and a-b if b<0 (Bilibili)
function test(){
    var a= [...arguments][0];
    return function(){
        var b = [...arguments][0];
        if(b>0){
            return a+b;
        }else{
            return a-b
        }
    }
}
Copy the code
  • Realize chain call (Baidu)
coder.sleep().print1().print2()

class Coder{
    sleep(){
        console.log("sleep");
        returnthis; // The key to chain calls}print1(){
        console.log(1);
        returnthis; // The key to chain calls}print2(){
        console.log(2);
        returnthis; // The key to chain calls}}Copy the code
  • What if the sleep function waits 3 seconds to print and then performs the subsequent operation?
class Coder {
  sleep(){
    var date = new Date();
    while((new Date() -date) < 3000) {// block here sleep} console.log("sleep");
    returnthis; // The key to chain calls}print1(){
    console.log(1);
    returnthis; // The key to chain calls}print2(){
    console.log(2);
    returnthis; }} var b = new Coder() b.leep ().print1().print2()Copy the code
  • What will the following code output (Baidu)
var date = new Date();
setTimeout(()=>{
    console.log(new Date()-date)
},1000)
while((new Date()-date)<3000){} // Print 3000+Copy the code
  • Event agent investigation :(baidu) if there is a page, there are many a tags, in the above write click event event agent how to write. If there are many children in the A tag, clicking on these children will also achieve the above effect, right? Thinking: circulation judge e. arget. ParentNode. TagName = = = “a”

  • Step jumping algorithm (Meituan)

  • Train Coal Transport Algorithm (Meituan)

  • [1,[2],[3,[4]] this infinite nested array becomes [1,2,3,4].

The database

  • Why to use mongodb in the project, the three paradigms of database (Baidu)
  • Mongodb aggregate (Ali)
  • Mysql optimization methods (Meituan)
  • Mysql > create index ();

Computer network

Q&A

  • Get and POST
  • Status code
  • Difference between HTTP and HTTPS

other

  • DNS Request Process
  • What protocol is DNS based on (Meituan)
  • Usage scenarios and differences between TCP and UDP (Meituan)
  • In addition to HTTP HTTPS protocol, can you have your own custom URL? For example, the principle of Js Bridge at the bottom of wechat applets is to use URL scheme to intercept

other

  • Operating system functions (Baidu)

  • What are the algorithms of page replacement (Bilibili)

  • Front-end security (XSS, CSRF) (almost every big factory asks)

  • AES and MD5

  • If you want to write and implement a red envelope snatching page, how to prevent people from maliciously playing red envelope snatching or sending packets to simulate the request for red envelope snatching? 1. Determine the number of requests from the same IP address within a period of time. 2. Malicious packet may be a direct page request 4, reach a certain number of times or red envelope limit, directly throw the packet

  • Js and C compiler differences

  • There is a user login form, what you would do to make it secure. (Meituan)

  • Principle of eTag (filename time Hash) (Meituan)

  • A microblog API provides top10 data, but each request does not necessarily update, so each time such a request to return data will waste traffic, hope to have an API can return whether update, how to operate. Hash the data to determine the last hash value.

  • The difference between jquery and Vue

Interview tips

  • Familiarize yourself with anything on your resume
  • When you answer a question, you refer to something that you’re familiar with like how you know ES6, you pick something that you’re familiar with like front-end optimization, you pick something that you understand how it works, like avoiding rearrangement and redrawing, and then you go on to ask what causes rearrangement and redrawing
  • When someone asks you a question you don’t know how to answer
1, lead to their own will: such as ask PHP inheritance, about js inheritance, ask mysql optimization means, about mongodb optimization means 2, about the general idea 3, please give tips 4, will not skip, do not delay too muchCopy the code
  • Present your blog
  • Familiar questions can be answered in depth
  • When writing code, consider encapsulation, data type judgment, etc
  • Think about the motivation behind these questions and the knowledge you are trying to explore.

Wish everyone can get the desired offer, yhoo ~~