"> < p style =" margin-bottom: 0px; margin-bottom: 0px;Copy the code
Byte side
It took an hour
- He talked about the project and explained it
- CSS implements a rectangle that is twice as long as it is wide enough to fill the page.
- The browser’s event-loop mechanism, which then gives a fairly complicated promise and setTimeout, asks for the output value
- Do you know trapping and bubbling?
- Do you know the HTTP status code? What does 302 mean?
- http tcp udp
- What are processes and threads, and what are the differences
- Are browsers single-threaded? Can its other threads name a few?
- (Write code) determine whether there is a sum of n from the root node to the leaf node in the binary tree
- (Write code) A single linked list, take the last KTH pointer reference
- (Write code) Compare two versions and return the larger one (format: XXX.xxx.xxx), if it is a number how to judge, if it is a letter?
Byte 2 face
It took fifty minutes
- I heard that your answer in the last interview was not very good. I…… ? “He asked. ðŸ˜
- Http2
- Count all tagnames under the body and count occurrences, and then get the KTH element tagName and times(times).
- Talk about your project and introduce the background, the rough implementation mechanism
- The egg of the backend is well known.
- One year class monitor experience can talk about
- How to study at ordinary times ah…
- Why do you choose the front end of the industry…
Bytes on three sides
It took fifty minutes
- To achieve an effect, pickpocket, pickpocket, pickpocket… What is the difference between absolute and fix?
- What else is addEventListener besides Click, hover?
- When did you touch the front end
- Implement convenient recursion to the parent element
- Two stacks implement a queue
- What do you know most about JS
- Career planning
- Do you know the process of sending requests
- (because the network is not good, he said to chat quickly forget ðŸ˜) bala bala
Ali side
It took an hour
Written test (the answer is then the interview system directly sent email back, not guarantee can run directly, the general idea is correct)
It took thirty minutes
Description: Given a non-empty array of numbers with one and only one non-repeating item, implement a method to get a single item * Example: * getSingleNumber([1, 2, 1, 2, 0]); // 0 * getSingleNumber([0, 1, 0, 0]); // 1 * getSingleNumber([1, 2, 3, 1, 2]); Const getSingleNumber = (numbers) => {// const getLenumber = (numbers) => {// const getLenumber = (numbers) => {return numbers.reduce((acc,cur)=>acc^cur)
}
function getSingleNumber(numbers) {
const map = new Map();
numbers.forEach((item) => {
map.has(item)?
map.set(item, map.get(item)+1):
map.set(item, 1);
})
const vec = [...map];
for(leti = 0,len = vec.length; i<len; i++) {if(vec[i][1] === 1) {
returnvec[i][0]; }}return false;
}
/**
* 2. 找出数组ä¸ç¬¬k大和第m大的数å—ç›¸åŠ ä¹‹å’Œ
* 说明:实现一个方法,找出数组ä¸ç¬¬k大的和第m大的数å—ç›¸åŠ ä¹‹å’Œ
* 示例:
* letArr =,2,4,4,3,5 [1], k = 2, m = 4 * findTopSum (arr, k, m); // The second largest number is 4, which occurs twice, and the fourth largest number is 2, which occurs once, so the result is 10 */functionFindTopSum (arr, k, m) {//[5,4,4,3,2,1] const map = new map (); arr.forEach((item) => { map.has(item)? map.set(item, map.get(item)+1): map.set(item, 1); }) // Const vec = [...new Set(arr)]; vec.sort((a, b) => b-a)
let [numK,numM] = [vec[k-1], vec[m-1]];
returnnumK*map.get(numK) + numM*map.get(numM) } /** * 3. Description: Given a nested array, implement a method to obtain the maximum depth of a nested array. If an array has no nested subarray, return 0, if there is a nested subarray, return 1, and so on. * Example: * getArrayDeep([1, 2, [3, [1, [0]]]]); // return 3 * getArrayDeep([]); // Return 0 * getArrayDeep([[[[]]]]); GetArrayDeep ([0, [2], [2, [3]]]); // Returns 2 */function getArrayDeep(arr) {
let res = 0;
const dfs = (vec, cur) => {
res = Math.max(res, cur);
vec.forEach((item) => {
if(item instanceof Array) {
dfs(item, cur+1);
}
})
}
dfs(arr, 0);
returnres; } /** * 4. Design a simple traffic light policy with a red light for console.log(" red ") and a yellow light for console.log("yellow"), and the green light is console.log("green"Const sleep = (time) => {const sleep = (time) => {return new Promise((resolve, reject) => {
setTimeout(resolve, time)
})
}
function main = () => {
red();
}
function red() {the console. The log (" red "); sleep(3000).then(()=>{ yellow(); })}function yellow() {the console. The log (" yellow "); sleep(1000).then(()=>{ green(); })}function green() {the console. The log (" green "); sleep(3000).then(()=>{ red(); })}Copy the code
Telephone interview:
It took thirty minutes
- project
- One-year monitor experience
- apply, call, bind
- React why do you have a vue
- React hooks, react hooks
- The node single-threaded
- Js inheritance, what is the difference between ES6 and ES5 inheritance
- Js commissioned
Ali 2 face
It took thirty minutes
- Describe your project (make it comprehensible, it’s a real struggle)
- What’s good about React
- What is a closure
- The uses and problems of closures
- Why do closures cause memory leaks
- . Forget the rest