Ali CBU front end 1-4 + HR face to face

Shout… The second department inside, overall experience is quite good. (The first one is nail nail, not ready to face, directly cool)

Batch one side ahead of time at 8:30, 90min

About two or three days after I applied, I got a call at 8:30 p.m. one night. As a result of the long time, the specific problem is not quite clear 😂 mainly asked the following aspects.

Project part

It’s a little bit more detailed here. It goes to one point. Here, the interviewer asked me deeply about the realization of a data flow optimization scheme and the application of Dva in my resume.

  • Details of the project why how
  • Data flow optimization scheme
  • Dva principle and design idea
  • Problems solved by Dva

ES6 part

  • Way of inheritance
  • There are no advantages and disadvantages of inheritance
  • Introduce object.assign () and pit points
  • Introduce depth and light copy
  • Depth copy implementation
  • Generator, Promise, async/await (this section expands to ask for more details)
  • Promise exception catching
  • Promise interrupts the chain
  • Can await be used alone
  • Request (fetch, Axios)
  • (Some of the details are expanded, too old to remember 🤦♂️)

React + others

Here are the usual interview questions… What is specific really do not remember 😂

  • Enter the URL to the page that appears
  • React lifecycle
  • Fiber
  • Use of TypeScript, how some scenarios are designed.
  • Etc., etc.

The CSS part

I asked a lot of things that I think are a bit cold

  • Introduce the flex
  • Flex properties (given a real requirement implemented in Flex)
  • How to define the main axis of Flex
  • Is the flex order affected by location (interviewer means location… The place of the real region… I want to expand to RTL.
  • Will Flex’s performance on mobile be changed by screen upside down (black question mark)
  • There are also a lot of cold 😂

Software Engineering

The interviewer looked at my major: Software engineering. Ask about software engineering. Then began the long journey of software engineering 😢

  • Talk about how to achieve a project from 0 to 1 in a project, the specific process
  • Demand analysis and approval stage
  • The development phase
  • Testing phase
  • The acceptance stage
  • The delivery phase
  • (ABOUT this several 😂, all from the actual project to talk)
  • Then we talked about the division of labor and responsibilities of the people in the project

I remember one side asked these 😂, the interviewer see time is also quite late, and then said that the follow-up will fill a written test what, will be sent within these two days.

One written test will be approved in advance

Three days after the interview, the interviewer called to set up a written exam. The written test is a question sent by email, completed within a given time and sent back. There are three questions that you need to design your own test cases

Pen questions a

Give coins of different denominations and an amount write a function to calculate the minimum number of coins needed to make up the amount 🥬🐔

function coinChange(coins, amount{

  let ans = new Array(amount + 1).fill(Infinity);

  ans[0] = 0;

  for (let i = 1; i <= amount; i++) {

    for (let coin of coins ) {

      if (i >= coin) {

       ans[i] = Math.min(ans[i], ans[i - coin] + 1);

      }

    }

  }

  return ans[amount] === Infinity ? - 1 : ans[amount];

}



/ / test

coinChange([1.2.5].11); / / 3

coinChange([2.4].- 1// -1

coinChange([1.2.4.5.10].100/ / 10





/ *

test



Data Test 1:

coins = [1, 2, 5]

amount = 11;

Expected output 3

coinChange([1, 2, 5], 11)

Actual output 3



Data Test 2:

coins = [2, 4]

amount = 3;

Expected output -1

coinChange([2, 4], -1)

The actual output is -1



Data Test 3:

coins = [1, 2, 4, 5, 10]

amount = 100;

Expected output 3

coinChange([1, 2, 4, 5, 10], 100)

Actual output 10



* /


Copy the code

Pen test question 2

/ * *

* Price arrays are converted to more readable text sequences

* Note: there is an array, inside is.

* the sample:

* var input = [

* {

* "moqPe": 5,

* "pricePe" : 12.85

*},

* {

* "moqPe": 15,

* "pricePe" : 11.36

*}

*]



* var output = rangeStringify(input);

*

* / output: "¥12.85 (5-15); Selections of 11.36 (15) or higher"

* /


Copy the code

🥬🐔

function rangeStringify(arr{

  // Verify the validity of the parameters

  if (arr.length === 0return [];

  // Parameter initialization

  let resultTmp = ' ';

  const arrLen = arr.length;

  // The comparison function defines a custom comparison rule

  const compare = (x, y) = > {

    if (+x.moqPe < +y.moqPe) {

      return - 1;

    } else if( +x.moqPe > +y.moqPe) {

      return 1;

    } else {

      return 0;

    }

  }

  // Format each item as a string

  const dataToString = ({ currentMoqPe, pricePe, index, nextMoqPe }) = > {

  // Determine the last item

    if (index === arrLen - 1) {

      return "Selections" + pricePe + "(" + "≥" + currentMoqPe + "个)";

    } else {

      return "Selections" + pricePe + "(" + currentMoqPe + "-" + nextMoqPe + ")";

    }

  }

  // Array handles sorting

  arr.sort(compare);

  // Iterate through the array to generate the result array

  const result = arr.map((item, index, currentArr) = > {

    /*item data format

    {

    moqPe: 5, // number | string

PricePe: 11.36, / / the number | string

    }

* /


    resultTmp = dataToString({

     currentMoqPe: item.moqPe,

     pricePe: item.pricePe,

     index,

     nextMoqPe: index === arrLen - 1 ? 0 : currentArr[index + 1].moqPe,

    });

    return resultTmp;

  })

  // The result array is converted to a string

  let returnResult = result.join("; ");

  return returnResult;

}



/ / the first group

let input = [{

"moqPe"5.

"pricePe"12.85

}, {

"moqPe"15.

"pricePe"11.36

}];

let output = rangeStringify(input);

console.log(output);



/ / the second group

input = [{

"moqPe"5.

"pricePe"12.85

}, {

"moqPe"6.

"pricePe"13.2323

}, {

"moqPe"15.

"pricePe"11.36

}];

output = rangeStringify(input);

console.log(output);



/ / the third group

input = [

{

"moqPe"20.

"pricePe"20.1

}, {

"moqPe"5.

"pricePe"12.85

}, {

"moqPe"15.

"pricePe"11.36

}, {

"moqPe"4.

"pricePe"10.0

}]

output = rangeStringify(input);

console.log(output);



/ / the fourth group

input = [{

"moqPe"5.

"pricePe"12.85

}]

output = rangeStringify(input);

console.log(output); / / "selections 12.85 (5) or higher"



/ / test

//

/ *

Test Data 1:

input1 = [{

"moqPe": 5,

"PricePe" : 12.85

}, {

"moqPe": 15,

"PricePe" : 11.36

}]

Expected output: "¥12.85 (5-15); Selections of 11.36 (15) or higher"

Actual output: "¥12.85 (5-15); Selections of 11.36 (15) or higher"



Test Data 2:

input2 = [{

"moqPe": 5,

"PricePe" : 12.85

}, {

"moqPe": 6,

"PricePe" : 13.2323

}, {

"moqPe": 15,

"PricePe" : 11.36

}]

Expected output: "¥12.85 (5-6); Selections of 13.2323 (6 to 15); Selections of 11.36 (15) or higher"

Actual output: "¥12.85 (5-6); Selections of 13.2323 (6 to 15); Selections of 11.36 (15) or higher"



Test Data 3:

input3 = [

{

"moqPe": 20,

"PricePe" : 20.1

}, {

"moqPe": 5,

"PricePe" : 12.85

}, {

"moqPe": 15,

"PricePe" : 11.36

}, {

"moqPe": 4,

"PricePe" : 10.0

}]

Expected output: "¥10 (4-5); Selections of 12.85 (5-15); Selections of 11.36 (15-20); Selections of 20.1 (20) or higher"

Actual output: "¥10 (4-5); Selections of 12.85 (5-15); Selections of 11.36 (15-20); Selections of 20.1 (20) or higher"

Test Data 4:

inpur4 = [{

"moqPe": 5,

"PricePe" : 12.85

}]



Expected output: "¥12.85 (≥5 PCS)"

Actual output: "¥12.85 (≥5 pieces)"

* /


Copy the code

Pen test three

/ *

* The string hides part of the content

* Description: Implement a method that accepts a string and a symbol, hiding the middle four digits of the string by the specified symbol

* 1. Use an asterisk (*) when no symbol is specified

* 2. If the received character string is less than or equal to four characters, the symbol string of the same length is returned, which is equivalent to full hiding, such as 123. After hiding, *** is returned

* 3. If the string is an odd number of more than four digits, for example, 123456789, the hidden string is 12****789

* the sample:

* mask('alibaba', '#'); // a####ba

* mask('85022088'); * * * * 88 / / 85

* mask('hello'); // ****o

* mask('abc', '? '); / /???

* Mask (' Alibaba Group ', '? '); / /?????? group

* /


Copy the code

🥬 🐔 answers

function mask(str, char{

 // Verify the validity of the parameters

  if (arguments.length === 0) {

   console.log("Please enter parameters");

   return "";

  }

  if (str ===""return "";



  // * is used when no parameter is specified

  char = char === undefined ? The '*' : char;



  / * *

* Accepts characters and lengths that need to be generated

  * @param char

  * @param len

* Returns the target string template

* /


  const tmpCreater = (char, len) = > new Array(len).fill(char).join("");



  // Get the length of the string

  let strLen = str.length;

  If the value is less than or equal to 4 bits, the value is returned

  if (strLen <= 4return tmpCreater(char, strLen);

  // Get the benchmark Index

  let pivotIndex = parseInt((str.length - 2) / 2.10) - 1;

  // Convert to a character array

  let strArr = str.split("");

  // Replace the string

  strArr.splice(pivotIndex, 4, tmpCreater(char, 4));

  // Returns the target string

  return strArr.join("");

}

mask('alibaba'.The '#'); // a####ba

mask('85022088'); * * * * 88 / / 85

mask('hello'); // ****o

mask('abc'.'? '); // ???

mask(Alibaba Group.'? '); / /?????? group

mask('abcdefgh123456789'.', '/ / abcdef... 3456789

mask('hg'/ / * *

mask(""/ / ""

mask() // Console print: Please enter valid parameters

/ *

Testing:

Test Data 1:

mask('alibaba', '#'); // a####ba

Expected output: a####ba

Actual output: a####ba



Test Data 2:

mask('85022088'); * * * * 88 / / 85

Expected output: 85****88

Actual output: 85****88



Test Data 3:

mask('hello'); // ****o

Expected output: ****o

Actual output: ****o



Test Data 4:

mask('abc', '? ')

Expected output:??

Actual output:??



Test Data 5:

Mask (' Alibaba Group ', '? ')

Expected output: a???? group

Actual output: a???? group



Test Data 6:

Mask (' abcdefgh123456789 ', ', ')

Expected output: abcdef··· 3456789

Actual output: abcdef··· 3456789

Test Data 7:

mask('hg')

Expected output: **

Actual output: **



* /


Copy the code

The three written exams actually took an hour? And then spent most of the rest of the time verifying the data 🤦♂️ and then submitted the overall topic is quite simple 😂.

Advance batch two interviews on a Thursday at 5:30, 60min

A week after the written exam, I received an appointment for the second interview with the interviewer on Tuesday afternoon, which happened to be full on those two days. Two face words are basically talk about the project part, I may write more projects 😂

  • Introduce the project
  • Difficulties of the project and how to solve them (focus on this part)
  • Project optimization
  • Project business understanding technology selection
  • Division of labor is

In the second interview, I still talked about my resume and the technical points of the project, and then I thought about the business.

Batch three sides 60min in advance

About two weeks after the second interview, I received a call from the third interview. At the beginning of the routine, I still introduced myself and the project, and then I talked deeply about the high concurrency in the project and how to optimize the front end of each project, gave some specific optimization schemes, and asked about the specific technical details of the project. How to learn front-end at ordinary times how to view the current front-end target plan in the next five years

Cross face 50min on all sides

Three after a week about four, is said to be like a cross director puffing. This question is biased towards the whole, the technical details are basically nothing.

  • Why do we choose project technology
  • There is no solution to settle the project difficulties
  • Why front-end
  • There is no systematic learning plan for the usual learning methods
  • How will future goals be achieved
  • Then there was some small talk

HR surface 3.30pm 7.30pm 40min

A couple of days after the crossover HR suddenly called in the evening and it started.

  • Self-introduction & College experience
  • Your position on the project team
  • How do teams communicate about staffing
  • How do you deal with team conflict
  • One’s own shortcomings
  • The person you admire the most
  • What about the workplace
  • Do you have any other offers?
  • How to choose wechat and Ali Offer at the same time

After the interview, HR said they would reply within a week. Then I secretly asked the inner push person, saying that everything is generally good and waiting for the Offer at ease. Shout… That’s the end of Ali’s story.

This article is formatted using MDNICE