preface
After 6 years working at two big factories and 3 years as a front end interviewer, I put together some of the more difficult interview questions and answers on My Github. Hope to be helpful to you, help you to enter their ideal enterprises.
The project address is: github.com/airuikun/We…
I hope you do not see the topic directly to look at the answer, or hope to think first, in the process of thinking, there will be unexpected harvest.
Interview Challenge
I have written down the difficulty level of each of the questions below, and the grade of the mark, so that you can refer to it, but it is not the only criterion.
Question 1: Please design a strategy to attack the server
Let me offer a few common strategies
- A very popular example is the fake NPM package + NodeJS version payload
- Deserialization attacks on NodeJS
In fact, if you pay more attention to Zhihu or some front-end hot spots, you will find that there are many cases of such attacks and vulnerabilities, but are there some difficult strategies and ideas that people have never thought of?
You are welcome to show your strength and creativity
The answers will be out on Friday, and if you have a good idea or answer, please leave a comment on github: github.com/airuikun/We…
2. Write a re that removes all attributes from the HTML tag string and keeps the SRC and href attributes
Write a regular expression that converts a string ‘re’ to a ‘re’.
Of course, the actual string that contains the HTML of a web page is more complex than that.
In addition, the answers of the first three articles on this question in Google all have serious problems, and a few random cases cannot be satisfied.
The problem of re, many front-end personnel are stuck in how to use re to determine whether a number is a mobile phone number, a string is not an email, to be honest, this does not use the regular knowledge system of one tenth
On some project challenges, a single line of regex can really be worth 1000 lines of code if it’s used properly.
The suggestion has the ability small partner, can play this problem.
The answers will be out on Friday, and if you have a good answer or idea, please leave a comment on the topic on Github: github.com/airuikun/We…
Constructor (){this.target = this.func.bind(this); },JSX onChange={this.target} is more efficient than non-bind func = () => {}
This question examines the function in memory block usage execution and scheduling, and the deep understanding of bind.
Welcome to the challenge
The answers will be out on Friday, and if you have a good idea or answer, please leave a comment on github: github.com/airuikun/We…
Question 4: How to optimize and handle DB insertion with high concurrency when 100,000 data is inserted into the database
This kind of question, you know, force gao gao, bright blind, big factory loves to take an exam too much.
However, this is a good opportunity for FE, which is capable and has really handled these high concurrency situations.
My mentor used NodeJS to achieve high concurrency intelligent disaster, which I still remember very well, and he also gained high performance that year.
Do you want to play?
The answers will be posted on Friday, welcome the challenge, if you have a good idea or answer, please leave a comment on github for this question: github.com/airuikun/We…
Why is 0.1+0.2 equal to 0.30000000000000004 in js? How to solve this problem in code?
The second question I give a simple idea: to convert floating point numbers to integers to calculate.
The answer is not unique, welcome to provide better idea
The answers will be out on Friday, welcome the challenge, and if you have a good idea or answer, please leave a comment on github for this question: github.com/airuikun/We…
Question 6: Design a strategy and method for making HTTP requests in HTTPS front-end projects
The answers will be out on Friday, welcome the challenge, and if you have a good idea or answer, please leave a comment on github for this question: github.com/airuikun/We…
Question 7: An iframe contains an embedded A page. The width and height of the IFrame change constantly. How to make the width and height of the A page adapt to the width and height of the iframe in real time? Name at least three ways, the more difficult the better
There’s an easy way to do this, and there’s a hard way to do this, and I recommend that when you’re interviewing, you try to say it as hard as you can.
The answers will be out on Friday, welcome the challenge, and if you have a good idea or answer, please leave a comment on github for this question: github.com/airuikun/We…
Question 8: Have you read about V8? Talk about the modules and parts of V8 you’ve seen, such as v8’s hidden class
Again, the depth of your answer to a question is a reference and standard for the interviewer to evaluate your ability.
Challenge yourself
The answers will be out on Friday, welcome the challenge, and if you have a good idea or answer, please leave a comment on github for this question: github.com/airuikun/We…
Question 9: There are multiple SPA projects, angular, Vue, and React, how to merge them into one unified SPA project
A lot of companies, there are a lot of old projects, and they are all different frameworks, very dispersed, a lot of managers, managers like to talk about the need to unify multiple projects.
This is where you are faced with refactoring projects with different frameworks.
If you run into these problems and try to rewrite the project, it can be very thankless. These problems, in fact, can be solved at the framework level.
Let me give you an idea for integrating react projects into Angular projects. You can start with ReactDOM. Render and Angular routing.
Another idea, such as simple VUE and React projects, is to use ast and other techniques to transfer code to each other. But I have practiced this before, and will face a lot of bad cases.
The rest of the ideas, you are welcome to challenge.
The answer will be announced on Friday. Please leave a comment on github: github.com/airuikun/We…
Png8, PNG16, and PNG32 are different
In view of the PNG principle of the problem, I wrote an article, easy to laugh and easy to understand, you can have a look, relax relax “PNG picture compression principle – diaosi tears”
communication
I am tadpole, currently as a senior front-end engineer
Welcome to pay attention to my wechat public number, wechat scan the following TWO-DIMENSIONAL code or search the public number “front-end diaosi”, about a front-end diaosi counter attack of the heart process, encourage.